Skip to content

Commit

Permalink
Fill in docs on some of the new syntax tree nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Feb 6, 2023
1 parent 80b9d4c commit 391c9c6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
13 changes: 13 additions & 0 deletions src/item.rs
Expand Up @@ -847,6 +847,17 @@ impl Receiver {
}

ast_struct! {
/// The variadic argument of a foreign function.
///
/// ```rust
/// # struct c_char;
/// # struct c_int;
/// #
/// extern "C" {
/// fn printf(format: *const c_char, ...) -> c_int;
/// // ^^^
/// }
/// ```
#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
pub struct Variadic {
pub attrs: Vec<Attribute>,
Expand All @@ -857,6 +868,7 @@ ast_struct! {
}

ast_enum! {
/// The mutability of an `Item::Static` or `ForeignItem::Static`.
#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
#[non_exhaustive]
pub enum StaticMutability {
Expand All @@ -866,6 +878,7 @@ ast_enum! {
}

ast_enum! {
/// Unused, but reserved for RFC 3323 restrictions.
#[cfg_attr(doc_cfg, doc(cfg(feature = "full")))]
#[non_exhaustive]
pub enum ImplRestriction {}
Expand Down
2 changes: 2 additions & 0 deletions src/restriction.rs
Expand Up @@ -36,6 +36,8 @@ ast_struct! {
}

ast_enum! {
/// Unused, but reserved for RFC 3323 restrictions.
#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
#[non_exhaustive]
pub enum FieldMutability {
None,
Expand Down
12 changes: 1 addition & 11 deletions src/ty.rs
Expand Up @@ -238,17 +238,7 @@ ast_struct! {
}

ast_struct! {
/// The variadic argument of a foreign function.
///
/// ```rust
/// # struct c_char;
/// # struct c_int;
/// #
/// extern "C" {
/// fn printf(format: *const c_char, ...) -> c_int;
/// // ^^^
/// }
/// ```
/// The variadic argument of a function pointer like `fn(usize, ...)`.
#[cfg_attr(doc_cfg, doc(cfg(any(feature = "full", feature = "derive"))))]
pub struct BareVariadic {
pub attrs: Vec<Attribute>,
Expand Down

0 comments on commit 391c9c6

Please sign in to comment.