about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2021-06-22 00:00:44 +0900
committerGitHub <noreply@github.com>2021-06-22 00:00:44 +0900
commit2fdc2eab76dfbd003733111ec7dfa8848b9fb8c9 (patch)
tree8f092794e04cede341e1fd0cc20159aa702ad519
parentf3fe5c3ba14d788d19bf90ccb3dcd9dd636f6094 (diff)
parentf804d8d71b2c2d9b05386950953bf65efebe6454 (diff)
downloadrust-2fdc2eab76dfbd003733111ec7dfa8848b9fb8c9.tar.gz
rust-2fdc2eab76dfbd003733111ec7dfa8848b9fb8c9.zip
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.
-rw-r--r--library/proc_macro/src/lib.rs15
1 files changed, 9 insertions, 6 deletions
diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs
index 53f172717f0..c9079b1cbad 100644
--- a/library/proc_macro/src/lib.rs
+++ b/library/proc_macro/src/lib.rs
@@ -766,7 +766,7 @@ impl fmt::Debug for Group {
     }
 }
 
-/// An `Punct` is an single punctuation character like `+`, `-` or `#`.
+/// A `Punct` is a single punctuation character such as `+`, `-` or `#`.
 ///
 /// Multi-character operators like `+=` are represented as two instances of `Punct` with different
 /// forms of `Spacing` returned.
@@ -779,16 +779,19 @@ impl !Send for Punct {}
 #[stable(feature = "proc_macro_lib2", since = "1.29.0")]
 impl !Sync for Punct {}
 
-/// Whether an `Punct` is followed immediately by another `Punct` or
-/// followed by another token or whitespace.
+/// Describes whether a `Punct` is followed immediately by another `Punct` ([`Spacing::Joint`]) or
+/// by a different token or whitespace ([`Spacing::Alone`]).
 #[derive(Copy, Clone, Debug, PartialEq, Eq)]
 #[stable(feature = "proc_macro_lib2", since = "1.29.0")]
 pub enum Spacing {
-    /// e.g., `+` is `Alone` in `+ =`, `+ident` or `+()`.
+    /// A `Punct` is not immediately followed by another `Punct`.
+    /// E.g. `+` is `Alone` in `+ =`, `+ident` and `+()`.
     #[stable(feature = "proc_macro_lib2", since = "1.29.0")]
     Alone,
-    /// e.g., `+` is `Joint` in `+=` or `'#`.
-    /// Additionally, single quote `'` can join with identifiers to form lifetimes `'ident`.
+    /// A `Punct` is immediately followed by another `Punct`.
+    /// E.g. `+` is `Joint` in `+=` and `++`.
+    ///
+    /// Additionally, single quote `'` can join with identifiers to form lifetimes: `'ident`.
     #[stable(feature = "proc_macro_lib2", since = "1.29.0")]
     Joint,
 }