Skip to content

Commit 2fdc2ea

Browse files
authored
Rollup merge of #86495 - r00ster91:patch-11, r=petrochenkov
Improve `proc_macro::{Punct, Spacing}` documentation I noticed some misspellings and then thought I could improve it a bit overall.
2 parents f3fe5c3 + f804d8d commit 2fdc2ea

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

library/proc_macro/src/lib.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,7 @@ impl fmt::Debug for Group {
766766
}
767767
}
768768

769-
/// An `Punct` is an single punctuation character like `+`, `-` or `#`.
769+
/// A `Punct` is a single punctuation character such as `+`, `-` or `#`.
770770
///
771771
/// Multi-character operators like `+=` are represented as two instances of `Punct` with different
772772
/// forms of `Spacing` returned.
@@ -779,16 +779,19 @@ impl !Send for Punct {}
779779
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
780780
impl !Sync for Punct {}
781781

782-
/// Whether an `Punct` is followed immediately by another `Punct` or
783-
/// followed by another token or whitespace.
782+
/// Describes whether a `Punct` is followed immediately by another `Punct` ([`Spacing::Joint`]) or
783+
/// by a different token or whitespace ([`Spacing::Alone`]).
784784
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
785785
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
786786
pub enum Spacing {
787-
/// e.g., `+` is `Alone` in `+ =`, `+ident` or `+()`.
787+
/// A `Punct` is not immediately followed by another `Punct`.
788+
/// E.g. `+` is `Alone` in `+ =`, `+ident` and `+()`.
788789
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
789790
Alone,
790-
/// e.g., `+` is `Joint` in `+=` or `'#`.
791-
/// Additionally, single quote `'` can join with identifiers to form lifetimes `'ident`.
791+
/// A `Punct` is immediately followed by another `Punct`.
792+
/// E.g. `+` is `Joint` in `+=` and `++`.
793+
///
794+
/// Additionally, single quote `'` can join with identifiers to form lifetimes: `'ident`.
792795
#[stable(feature = "proc_macro_lib2", since = "1.29.0")]
793796
Joint,
794797
}

0 commit comments

Comments
 (0)