Skip to content

Commit

Permalink
Update doc comments about availability.
Browse files Browse the repository at this point in the history
  • Loading branch information
teymour-aldridge committed May 16, 2020
1 parent 74292f0 commit 409a4ae
Show file tree
Hide file tree
Showing 27 changed files with 220 additions and 220 deletions.
2 changes: 1 addition & 1 deletion codegen/src/fold.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ pub fn generate(defs: &Definitions) -> Result<()> {
///
/// [module documentation]: self
///
/// *This trait is available if Syn is built with the `"fold"` feature.*
/// *This trait is available only if Syn is built with the `"fold"` feature.*
pub trait Fold {
#traits
}
Expand Down
2 changes: 1 addition & 1 deletion codegen/src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ pub fn generate(defs: &Definitions) -> Result<()> {
///
/// [module documentation]: self
///
/// *This trait is available if Syn is built with the `"visit"` feature.*
/// *This trait is available only if Syn is built with the `"visit"` feature.*
pub trait Visit<'ast> {
#traits
}
Expand Down
2 changes: 1 addition & 1 deletion codegen/src/visit_mut.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ pub fn generate(defs: &Definitions) -> Result<()> {
///
/// [module documentation]: self
///
/// *This trait is available if Syn is built with the `"visit-mut"` feature.*
/// *This trait is available only if Syn is built with the `"visit-mut"` feature.*
pub trait VisitMut {
#traits
}
Expand Down
22 changes: 11 additions & 11 deletions src/attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use std::hash::{Hash, Hasher};
ast_struct! {
/// An attribute like `#[repr(transparent)]`.
///
/// *This type is available if Syn is built with the `"derive"` or `"full"`
/// *This type is available only if Syn is built with the `"derive"` or `"full"`
/// feature.*
///
/// <br>
Expand Down Expand Up @@ -189,7 +189,7 @@ impl Attribute {
/// Parses the content of the attribute, consisting of the path and tokens,
/// as a [`Meta`] if possible.
///
/// *This function is available if Syn is built with the `"parsing"`
/// *This function is available only if Syn is built with the `"parsing"`
/// feature.*
#[cfg(feature = "parsing")]
pub fn parse_meta(&self) -> Result<Meta> {
Expand Down Expand Up @@ -236,7 +236,7 @@ impl Attribute {
/// ^^^^^^^^^ what gets parsed
/// ```
///
/// *This function is available if Syn is built with the `"parsing"`
/// *This function is available only if Syn is built with the `"parsing"`
/// feature.*
#[cfg(feature = "parsing")]
pub fn parse_args<T: Parse>(&self) -> Result<T> {
Expand All @@ -245,7 +245,7 @@ impl Attribute {

/// Parse the arguments to the attribute using the given parser.
///
/// *This function is available if Syn is built with the `"parsing"`
/// *This function is available only if Syn is built with the `"parsing"`
/// feature.*
#[cfg(feature = "parsing")]
pub fn parse_args_with<F: Parser>(&self, parser: F) -> Result<F::Output> {
Expand All @@ -258,7 +258,7 @@ impl Attribute {

/// Parses zero or more outer attributes from the stream.
///
/// *This function is available if Syn is built with the `"parsing"`
/// *This function is available only if Syn is built with the `"parsing"`
/// feature.*
#[cfg(feature = "parsing")]
pub fn parse_outer(input: ParseStream) -> Result<Vec<Self>> {
Expand All @@ -271,7 +271,7 @@ impl Attribute {

/// Parses zero or more inner attributes from the stream.
///
/// *This function is available if Syn is built with the `"parsing"`
/// *This function is available only if Syn is built with the `"parsing"`
/// feature.*
#[cfg(feature = "parsing")]
pub fn parse_inner(input: ParseStream) -> Result<Vec<Self>> {
Expand Down Expand Up @@ -339,7 +339,7 @@ ast_enum! {
/// Distinguishes between attributes that decorate an item and attributes
/// that are contained within an item.
///
/// *This type is available if Syn is built with the `"derive"` or `"full"`
/// *This type is available only if Syn is built with the `"derive"` or `"full"`
/// feature.*
///
/// # Outer attributes
Expand All @@ -363,7 +363,7 @@ ast_enum! {
ast_enum_of_structs! {
/// Content of a compile-time structured attribute.
///
/// *This type is available if Syn is built with the `"derive"` or `"full"`
/// *This type is available only if Syn is built with the `"derive"` or `"full"`
/// feature.*
///
/// ## Path
Expand Down Expand Up @@ -401,7 +401,7 @@ ast_enum_of_structs! {
ast_struct! {
/// A structured list within an attribute, like `derive(Copy, Clone)`.
///
/// *This type is available if Syn is built with the `"derive"` or
/// *This type is available only if Syn is built with the `"derive"` or
/// `"full"` feature.*
pub struct MetaList {
pub path: Path,
Expand All @@ -413,7 +413,7 @@ ast_struct! {
ast_struct! {
/// A name-value pair within an attribute, like `feature = "nightly"`.
///
/// *This type is available if Syn is built with the `"derive"` or
/// *This type is available only if Syn is built with the `"derive"` or
/// `"full"` feature.*
pub struct MetaNameValue {
pub path: Path,
Expand All @@ -439,7 +439,7 @@ impl Meta {
ast_enum_of_structs! {
/// Element of a compile-time attribute list.
///
/// *This type is available if Syn is built with the `"derive"` or `"full"`
/// *This type is available only if Syn is built with the `"derive"` or `"full"`
/// feature.*
pub enum NestedMeta {
/// A structured meta item, like the `Copy` in `#[derive(Copy)]` which
Expand Down
8 changes: 4 additions & 4 deletions src/buffer.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! A stably addressed token buffer supporting efficient traversal based on a
//! cheaply copyable cursor.
//!
//! *This module is available if Syn is built with the `"parsing"` feature.*
//! *This module is available only if Syn is built with the `"parsing"` feature.*

// This module is heavily commented as it contains most of the unsafe code in
// Syn, and caution should be used when editing it. The public-facing interface
Expand Down Expand Up @@ -36,7 +36,7 @@ enum Entry {
/// `TokenStream` which requires a deep copy in order to traverse more than
/// once.
///
/// *This type is available if Syn is built with the `"parsing"` feature.*
/// *This type is available only if Syn is built with the `"parsing"` feature.*
pub struct TokenBuffer {
// NOTE: Do not derive clone on this - there are raw pointers inside which
// will be messed up. Moving the `TokenBuffer` itself is safe as the actual
Expand Down Expand Up @@ -98,7 +98,7 @@ impl TokenBuffer {
/// Creates a `TokenBuffer` containing all the tokens from the input
/// `TokenStream`.
///
/// *This method is available if Syn is built with both the `"parsing"` and
/// *This method is available only if Syn is built with both the `"parsing"` and
/// `"proc-macro"` features.*
#[cfg(all(
not(all(target_arch = "wasm32", any(target_os = "unknown", target_os = "wasi"))),
Expand Down Expand Up @@ -133,7 +133,7 @@ impl TokenBuffer {
/// Two cursors are equal if they have the same location in the same input
/// stream, and have the same scope.
///
/// *This type is available if Syn is built with the `"parsing"` feature.*
/// *This type is available only if Syn is built with the `"parsing"` feature.*
#[derive(Copy, Clone, Eq, PartialEq)]
pub struct Cursor<'a> {
// The current entry which the `Cursor` is pointing at.
Expand Down
18 changes: 9 additions & 9 deletions src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::punctuated::Punctuated;
ast_struct! {
/// An enum variant.
///
/// *This type is available if Syn is built with the `"derive"` or `"full"`
/// *This type is available only if Syn is built with the `"derive"` or `"full"`
/// feature.*
pub struct Variant {
/// Attributes tagged on the variant.
Expand All @@ -24,7 +24,7 @@ ast_struct! {
ast_enum_of_structs! {
/// Data stored within an enum variant or struct.
///
/// *This type is available if Syn is built with the `"derive"` or `"full"`
/// *This type is available only if Syn is built with the `"derive"` or `"full"`
/// feature.*
///
/// # Syntax tree enum
Expand Down Expand Up @@ -52,7 +52,7 @@ ast_struct! {
/// Named fields of a struct or struct variant such as `Point { x: f64,
/// y: f64 }`.
///
/// *This type is available if Syn is built with the `"derive"` or
/// *This type is available only if Syn is built with the `"derive"` or
/// `"full"` feature.*
pub struct FieldsNamed {
pub brace_token: token::Brace,
Expand All @@ -63,7 +63,7 @@ ast_struct! {
ast_struct! {
/// Unnamed fields of a tuple struct or tuple variant such as `Some(T)`.
///
/// *This type is available if Syn is built with the `"derive"` or
/// *This type is available only if Syn is built with the `"derive"` or
/// `"full"` feature.*
pub struct FieldsUnnamed {
pub paren_token: token::Paren,
Expand Down Expand Up @@ -147,7 +147,7 @@ impl<'a> IntoIterator for &'a mut Fields {
ast_struct! {
/// A field of a struct or enum variant.
///
/// *This type is available if Syn is built with the `"derive"` or `"full"`
/// *This type is available only if Syn is built with the `"derive"` or `"full"`
/// feature.*
pub struct Field {
/// Attributes tagged on the field.
Expand All @@ -172,7 +172,7 @@ ast_enum_of_structs! {
/// The visibility level of an item: inherited or `pub` or
/// `pub(restricted)`.
///
/// *This type is available if Syn is built with the `"derive"` or `"full"`
/// *This type is available only if Syn is built with the `"derive"` or `"full"`
/// feature.*
///
/// # Syntax tree enum
Expand Down Expand Up @@ -202,7 +202,7 @@ ast_enum_of_structs! {
ast_struct! {
/// A public visibility level: `pub`.
///
/// *This type is available if Syn is built with the `"derive"` or
/// *This type is available only if Syn is built with the `"derive"` or
/// `"full"` feature.*
pub struct VisPublic {
pub pub_token: Token![pub],
Expand All @@ -212,7 +212,7 @@ ast_struct! {
ast_struct! {
/// A crate-level visibility: `crate`.
///
/// *This type is available if Syn is built with the `"derive"` or
/// *This type is available only if Syn is built with the `"derive"` or
/// `"full"` feature.*
pub struct VisCrate {
pub crate_token: Token![crate],
Expand All @@ -223,7 +223,7 @@ ast_struct! {
/// A visibility level restricted to some path: `pub(self)` or
/// `pub(super)` or `pub(crate)` or `pub(in some::module)`.
///
/// *This type is available if Syn is built with the `"derive"` or
/// *This type is available only if Syn is built with the `"derive"` or
/// `"full"` feature.*
pub struct VisRestricted {
pub pub_token: Token![pub],
Expand Down
10 changes: 5 additions & 5 deletions src/derive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use crate::punctuated::Punctuated;
ast_struct! {
/// Data structure sent to a `proc_macro_derive` macro.
///
/// *This type is available if Syn is built with the `"derive"` feature.*
/// *This type is available only if Syn is built with the `"derive"` feature.*
pub struct DeriveInput {
/// Attributes tagged on the whole struct or enum.
pub attrs: Vec<Attribute>,
Expand All @@ -26,7 +26,7 @@ ast_struct! {
ast_enum_of_structs! {
/// The storage of a struct, enum or union data structure.
///
/// *This type is available if Syn is built with the `"derive"` feature.*
/// *This type is available only if Syn is built with the `"derive"` feature.*
///
/// # Syntax tree enum
///
Expand All @@ -53,7 +53,7 @@ ast_enum_of_structs! {
ast_struct! {
/// A struct input to a `proc_macro_derive` macro.
///
/// *This type is available if Syn is built with the `"derive"`
/// *This type is available only if Syn is built with the `"derive"`
/// feature.*
pub struct DataStruct {
pub struct_token: Token![struct],
Expand All @@ -65,7 +65,7 @@ ast_struct! {
ast_struct! {
/// An enum input to a `proc_macro_derive` macro.
///
/// *This type is available if Syn is built with the `"derive"`
/// *This type is available only if Syn is built with the `"derive"`
/// feature.*
pub struct DataEnum {
pub enum_token: Token![enum],
Expand All @@ -77,7 +77,7 @@ ast_struct! {
ast_struct! {
/// An untagged union input to a `proc_macro_derive` macro.
///
/// *This type is available if Syn is built with the `"derive"`
/// *This type is available only if Syn is built with the `"derive"`
/// feature.*
pub struct DataUnion {
pub union_token: Token![union],
Expand Down
Loading

0 comments on commit 409a4ae

Please sign in to comment.