about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-12-08 03:50:16 +0000
committerbors <bors@rust-lang.org>2018-12-08 03:50:16 +0000
commit059e6a6f57f4e80d527a3cd8a8afe7f51f01af8e (patch)
tree90e0d7a855be8202279b6bdde6cbdc95d834f07a /src/libsyntax
parent0a7798079608b4ff014471ae64b6c8201aa59cdf (diff)
parent003c5b796eae78c8c260bfddfc332a69926a6152 (diff)
downloadrust-059e6a6f57f4e80d527a3cd8a8afe7f51f01af8e.tar.gz
rust-059e6a6f57f4e80d527a3cd8a8afe7f51f01af8e.zip
Auto merge of #56578 - alexreg:cosmetic-1, r=alexreg
Various minor/cosmetic improvements to code

r? @Centril 😄
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ast.rs375
-rw-r--r--src/libsyntax/attr/mod.rs4
-rw-r--r--src/libsyntax/config.rs4
-rw-r--r--src/libsyntax/ext/base.rs6
-rw-r--r--src/libsyntax/ext/expand.rs2
-rw-r--r--src/libsyntax/ext/tt/macro_parser.rs8
-rw-r--r--src/libsyntax/ext/tt/macro_rules.rs12
-rw-r--r--src/libsyntax/ext/tt/quoted.rs12
-rw-r--r--src/libsyntax/feature_gate.rs288
-rw-r--r--src/libsyntax/fold.rs4
-rw-r--r--src/libsyntax/lib.rs2
-rw-r--r--src/libsyntax/parse/lexer/mod.rs2
-rw-r--r--src/libsyntax/parse/parser.rs24
-rw-r--r--src/libsyntax/parse/token.rs2
-rw-r--r--src/libsyntax/print/pp.rs2
-rw-r--r--src/libsyntax/ptr.rs6
-rw-r--r--src/libsyntax/test.rs2
-rw-r--r--src/libsyntax/util/parser.rs4
-rw-r--r--src/libsyntax/visit.rs4
19 files changed, 381 insertions, 382 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs
index 87225711871..f25f456e3ae 100644
--- a/src/libsyntax/ast.rs
+++ b/src/libsyntax/ast.rs
@@ -68,7 +68,7 @@ impl fmt::Debug for Lifetime {
 /// It's represented as a sequence of identifiers,
 /// along with a bunch of supporting information.
 ///
-/// E.g. `std::cmp::PartialEq`
+/// E.g., `std::cmp::PartialEq`.
 #[derive(Clone, RustcEncodable, RustcDecodable)]
 pub struct Path {
     pub span: Span,
@@ -96,8 +96,8 @@ impl fmt::Display for Path {
 }
 
 impl Path {
-    // convert a span and an identifier to the corresponding
-    // 1-segment path
+    // Convert a span and an identifier to the corresponding
+    // one-segment path.
     pub fn from_ident(ident: Ident) -> Path {
         Path {
             segments: vec![PathSegment::from_ident(ident)],
@@ -112,7 +112,7 @@ impl Path {
 
 /// A segment of a path: an identifier, an optional lifetime, and a set of types.
 ///
-/// E.g. `std`, `String` or `Box<T>`
+/// E.g., `std`, `String` or `Box<T>`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct PathSegment {
     /// The identifier portion of this path segment.
@@ -140,7 +140,7 @@ impl PathSegment {
 
 /// Arguments of a path segment.
 ///
-/// E.g. `<A, B>` as in `Foo<A, B>` or `(A, B)` as in `Foo(A, B)`
+/// E.g., `<A, B>` as in `Foo<A, B>` or `(A, B)` as in `Foo(A, B)`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub enum GenericArgs {
     /// The `<'a, A,B,C>` in `foo::bar::baz::<'a, A,B,C>`
@@ -282,7 +282,7 @@ pub type GenericBounds = Vec<GenericBound>;
 
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub enum GenericParamKind {
-    /// A lifetime definition, e.g. `'a: 'b+'c+'d`.
+    /// A lifetime definition (e.g., `'a: 'b + 'c + 'd`).
     Lifetime,
     Type {
         default: Option<P<Ty>>,
@@ -334,11 +334,11 @@ pub struct WhereClause {
 /// A single predicate in a `where` clause
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub enum WherePredicate {
-    /// A type binding, e.g. `for<'c> Foo: Send+Clone+'c`
+    /// A type binding (e.g., `for<'c> Foo: Send + Clone + 'c`).
     BoundPredicate(WhereBoundPredicate),
-    /// A lifetime predicate, e.g. `'a: 'b+'c`
+    /// A lifetime predicate (e.g., `'a: 'b + 'c`).
     RegionPredicate(WhereRegionPredicate),
-    /// An equality predicate (unsupported)
+    /// An equality predicate (unsupported).
     EqPredicate(WhereEqPredicate),
 }
 
@@ -354,7 +354,7 @@ impl WherePredicate {
 
 /// A type bound.
 ///
-/// E.g. `for<'c> Foo: Send+Clone+'c`
+/// E.g., `for<'c> Foo: Send + Clone + 'c`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct WhereBoundPredicate {
     pub span: Span,
@@ -368,7 +368,7 @@ pub struct WhereBoundPredicate {
 
 /// A lifetime predicate.
 ///
-/// E.g. `'a: 'b+'c`
+/// E.g., `'a: 'b + 'c`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct WhereRegionPredicate {
     pub span: Span,
@@ -378,7 +378,7 @@ pub struct WhereRegionPredicate {
 
 /// An equality predicate (unsupported).
 ///
-/// E.g. `T=int`
+/// E.g., `T = int`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct WhereEqPredicate {
     pub id: NodeId,
@@ -387,8 +387,8 @@ pub struct WhereEqPredicate {
     pub rhs_ty: P<Ty>,
 }
 
-/// The set of MetaItems that define the compilation environment of the crate,
-/// used to drive conditional compilation
+/// The set of `MetaItem`s that define the compilation environment of the crate,
+/// used to drive conditional compilation.
 pub type CrateConfig = FxHashSet<(Name, Option<Symbol>)>;
 
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
@@ -403,20 +403,20 @@ pub type NestedMetaItem = Spanned<NestedMetaItemKind>;
 
 /// Possible values inside of compile-time attribute lists.
 ///
-/// E.g. the '..' in `#[name(..)]`.
+/// E.g., the '..' in `#[name(..)]`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub enum NestedMetaItemKind {
     /// A full MetaItem, for recursive meta items.
     MetaItem(MetaItem),
     /// A literal.
     ///
-    /// E.g. "foo", 64, true
+    /// E.g., `"foo"`, `64`, `true`.
     Literal(Lit),
 }
 
 /// A spanned compile-time attribute item.
 ///
-/// E.g. `#[test]`, `#[derive(..)]`, `#[rustfmt::skip]` or `#[feature = "foo"]`
+/// E.g., `#[test]`, `#[derive(..)]`, `#[rustfmt::skip]` or `#[feature = "foo"]`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct MetaItem {
     pub ident: Path,
@@ -426,26 +426,26 @@ pub struct MetaItem {
 
 /// A compile-time attribute item.
 ///
-/// E.g. `#[test]`, `#[derive(..)]` or `#[feature = "foo"]`
+/// E.g., `#[test]`, `#[derive(..)]` or `#[feature = "foo"]`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub enum MetaItemKind {
     /// Word meta item.
     ///
-    /// E.g. `test` as in `#[test]`
+    /// E.g., `test` as in `#[test]`.
     Word,
     /// List meta item.
     ///
-    /// E.g. `derive(..)` as in `#[derive(..)]`
+    /// E.g., `derive(..)` as in `#[derive(..)]`.
     List(Vec<NestedMetaItem>),
     /// Name value meta item.
     ///
-    /// E.g. `feature = "foo"` as in `#[feature = "foo"]`
+    /// E.g., `feature = "foo"` as in `#[feature = "foo"]`.
     NameValue(Lit),
 }
 
 /// A Block (`{ .. }`).
 ///
-/// E.g. `{ .. }` as in `fn foo() { .. }`
+/// E.g., `{ .. }` as in `fn foo() { .. }`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct Block {
     /// Statements in a block
@@ -568,7 +568,7 @@ pub enum RangeSyntax {
 
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub enum PatKind {
-    /// Represents a wildcard pattern (`_`)
+    /// Represents a wildcard pattern (`_`).
     Wild,
 
     /// A `PatKind::Ident` may either be a new bound variable (`ref mut binding @ OPT_SUBPATTERN`),
@@ -577,13 +577,13 @@ pub enum PatKind {
     /// during name resolution.
     Ident(BindingMode, Ident, Option<P<Pat>>),
 
-    /// A struct or struct variant pattern, e.g. `Variant {x, y, ..}`.
+    /// A struct or struct variant pattern (e.g., `Variant {x, y, ..}`).
     /// The `bool` is `true` in the presence of a `..`.
     Struct(Path, Vec<Spanned<FieldPat>>, bool),
 
-    /// A tuple struct/variant pattern `Variant(x, y, .., z)`.
+    /// A tuple struct/variant pattern (`Variant(x, y, .., z)`).
     /// If the `..` pattern fragment is present, then `Option<usize>` denotes its position.
-    /// 0 <= position <= subpats.len()
+    /// `0 <= position <= subpats.len()`.
     TupleStruct(Path, Vec<P<Pat>>, Option<usize>),
 
     /// A possibly qualified path pattern.
@@ -592,24 +592,24 @@ pub enum PatKind {
     /// only legally refer to associated constants.
     Path(Option<QSelf>, Path),
 
-    /// A tuple pattern `(a, b)`.
+    /// A tuple pattern (`(a, b)`).
     /// If the `..` pattern fragment is present, then `Option<usize>` denotes its position.
-    /// 0 <= position <= subpats.len()
+    /// `0 <= position <= subpats.len()`.
     Tuple(Vec<P<Pat>>, Option<usize>),
-    /// A `box` pattern
+    /// A `box` pattern.
     Box(P<Pat>),
-    /// A reference pattern, e.g. `&mut (a, b)`
+    /// A reference pattern (e.g., `&mut (a, b)`).
     Ref(P<Pat>, Mutability),
-    /// A literal
+    /// A literal.
     Lit(P<Expr>),
-    /// A range pattern, e.g. `1...2`, `1..=2` or `1..2`
+    /// A range pattern (e.g., `1...2`, `1..=2` or `1..2`).
     Range(P<Expr>, P<Expr>, Spanned<RangeEnd>),
     /// `[a, b, ..i, y, z]` is represented as:
     ///     `PatKind::Slice(box [a, b], Some(i), box [y, z])`
     Slice(Vec<P<Pat>>, Option<P<Pat>>, Vec<P<Pat>>),
-    /// Parentheses in patterns used for grouping, i.e. `(PAT)`.
+    /// Parentheses in patterns used for grouping (i.e., `(PAT)`).
     Paren(P<Pat>),
-    /// A macro pattern; pre-expansion
+    /// A macro pattern; pre-expansion.
     Mac(Mac),
 }
 
@@ -807,23 +807,23 @@ pub enum StmtKind {
 
 #[derive(Clone, Copy, PartialEq, RustcEncodable, RustcDecodable, Debug)]
 pub enum MacStmtStyle {
-    /// The macro statement had a trailing semicolon, e.g. `foo! { ... };`
-    /// `foo!(...);`, `foo![...];`
+    /// The macro statement had a trailing semicolon (e.g., `foo! { ... };`
+    /// `foo!(...);`, `foo![...];`).
     Semicolon,
-    /// The macro statement had braces; e.g. foo! { ... }
+    /// The macro statement had braces (e.g., `foo! { ... }`).
     Braces,
-    /// The macro statement had parentheses or brackets and no semicolon; e.g.
-    /// `foo!(...)`. All of these will end up being converted into macro
+    /// The macro statement had parentheses or brackets and no semicolon (e.g.,
+    /// `foo!(...)`). All of these will end up being converted into macro
     /// expressions.
     NoBraces,
 }
 
-/// Local represents a `let` statement, e.g., `let <pat>:<ty> = <expr>;`
+/// Local represents a `let` statement, e.g., `let <pat>:<ty> = <expr>;`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct Local {
     pub pat: P<Pat>,
     pub ty: Option<P<Ty>>,
-    /// Initializer expression to set the value, if any
+    /// Initializer expression to set the value, if any.
     pub init: Option<P<Expr>>,
     pub id: NodeId,
     pub span: Span,
@@ -832,7 +832,7 @@ pub struct Local {
 
 /// An arm of a 'match'.
 ///
-/// E.g. `0..=10 => { println!("match!") }` as in
+/// E.g., `0..=10 => { println!("match!") }` as in
 ///
 /// ```
 /// match 123 {
@@ -878,8 +878,8 @@ pub enum UnsafeSource {
 
 /// A constant (expression) that's not an item or associated item,
 /// but needs its own `DefId` for type-checking, const-eval, etc.
-/// These are usually found nested inside types (e.g. array lengths)
-/// or expressions (e.g. repeat counts), and also used to define
+/// These are usually found nested inside types (e.g., array lengths)
+/// or expressions (e.g., repeat counts), and also used to define
 /// explicit discriminant values for enum variants.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct AnonConst {
@@ -901,7 +901,7 @@ pub struct Expr {
 static_assert!(MEM_SIZE_OF_EXPR: std::mem::size_of::<Expr>() == 88);
 
 impl Expr {
-    /// Whether this expression would be valid somewhere that expects a value, for example, an `if`
+    /// Whether this expression would be valid somewhere that expects a value; for example, an `if`
     /// condition.
     pub fn returns(&self) -> bool {
         if let ExprKind::Block(ref block, _) = self.node {
@@ -1049,24 +1049,24 @@ pub enum ExprKind {
     ///
     /// The `PathSegment` represents the method name and its generic arguments
     /// (within the angle brackets).
-    /// The first element of the vector of `Expr`s is the expression that evaluates
+    /// The first element of the vector of an `Expr` is the expression that evaluates
     /// to the object on which the method is being called on (the receiver),
     /// and the remaining elements are the rest of the arguments.
     /// Thus, `x.foo::<Bar, Baz>(a, b, c, d)` is represented as
     /// `ExprKind::MethodCall(PathSegment { foo, [Bar, Baz] }, [x, a, b, c, d])`.
     MethodCall(PathSegment, Vec<P<Expr>>),
-    /// A tuple (`(a, b, c ,d)`)
+    /// A tuple (e.g., `(a, b, c, d)`).
     Tup(Vec<P<Expr>>),
-    /// A binary operation (For example: `a + b`, `a * b`)
+    /// A binary operation (e.g., `a + b`, `a * b`).
     Binary(BinOp, P<Expr>, P<Expr>),
-    /// A unary operation (For example: `!x`, `*x`)
+    /// A unary operation (e.g., `!x`, `*x`).
     Unary(UnOp, P<Expr>),
-    /// A literal (For example: `1`, `"foo"`)
+    /// A literal (e.g., `1`, `"foo"`).
     Lit(Lit),
-    /// A cast (`foo as f64`)
+    /// A cast (e.g., `foo as f64`).
     Cast(P<Expr>, P<Ty>),
     Type(P<Expr>, P<Ty>),
-    /// An `if` block, with an optional else block
+    /// An `if` block, with an optional `else` block.
     ///
     /// `if expr { block } else { expr }`
     If(P<Expr>, P<Block>, Option<P<Expr>>),
@@ -1080,31 +1080,31 @@ pub enum ExprKind {
     ///
     /// `'label: while expr { block }`
     While(P<Expr>, P<Block>, Option<Label>),
-    /// A while-let loop, with an optional label
+    /// A `while let` loop, with an optional label.
     ///
     /// `'label: while let pat = expr { block }`
     ///
     /// This is desugared to a combination of `loop` and `match` expressions.
     WhileLet(Vec<P<Pat>>, P<Expr>, P<Block>, Option<Label>),
-    /// A for loop, with an optional label
+    /// A `for` loop, with an optional label.
     ///
     /// `'label: for pat in expr { block }`
     ///
     /// This is desugared to a combination of `loop` and `match` expressions.
     ForLoop(P<Pat>, P<Expr>, P<Block>, Option<Label>),
-    /// Conditionless loop (can be exited with break, continue, or return)
+    /// Conditionless loop (can be exited with `break`, `continue`, or `return`).
     ///
     /// `'label: loop { block }`
     Loop(P<Block>, Option<Label>),
     /// A `match` block.
     Match(P<Expr>, Vec<Arm>),
-    /// A closure (for example, `move |a, b, c| a + b + c`)
+    /// A closure (e.g., `move |a, b, c| a + b + c`).
     ///
-    /// The final span is the span of the argument block `|...|`
+    /// The final span is the span of the argument block `|...|`.
     Closure(CaptureBy, IsAsync, Movability, P<FnDecl>, P<Expr>, Span),
-    /// A block (`'label: { ... }`)
+    /// A block (`'label: { ... }`).
     Block(P<Block>, Option<Label>),
-    /// An async block (`async move { ... }`)
+    /// An async block (`async move { ... }`).
     ///
     /// The `NodeId` is the `NodeId` for the closure that results from
     /// desugaring an async block, just like the NodeId field in the
@@ -1113,70 +1113,69 @@ pub enum ExprKind {
     /// created during lowering cannot be made the parent of any other
     /// preexisting defs.
     Async(CaptureBy, NodeId, P<Block>),
-    /// A try block (`try { ... }`)
+    /// A try block (`try { ... }`).
     TryBlock(P<Block>),
 
-    /// An assignment (`a = foo()`)
+    /// An assignment (`a = foo()`).
     Assign(P<Expr>, P<Expr>),
-    /// An assignment with an operator
+    /// An assignment with an operator.
     ///
-    /// For example, `a += 1`.
+    /// E.g., `a += 1`.
     AssignOp(BinOp, P<Expr>, P<Expr>),
-    /// Access of a named (`obj.foo`) or unnamed (`obj.0`) struct field
+    /// Access of a named (e.g., `obj.foo`) or unnamed (e.g., `obj.0`) struct field.
     Field(P<Expr>, Ident),
-    /// An indexing operation (`foo[2]`)
+    /// An indexing operation (e.g., `foo[2]`).
     Index(P<Expr>, P<Expr>),
-    /// A range (`1..2`, `1..`, `..2`, `1...2`, `1...`, `...2`)
+    /// A range (e.g., `1..2`, `1..`, `..2`, `1...2`, `1...`, `...2`).
     Range(Option<P<Expr>>, Option<P<Expr>>, RangeLimits),
 
     /// Variable reference, possibly containing `::` and/or type
-    /// parameters, e.g. foo::bar::<baz>.
+    /// parameters (e.g., `foo::bar::<baz>`).
     ///
-    /// Optionally "qualified",
-    /// E.g. `<Vec<T> as SomeTrait>::SomeType`.
+    /// Optionally "qualified" (e.g., `<Vec<T> as SomeTrait>::SomeType`).
     Path(Option<QSelf>, Path),
 
-    /// A referencing operation (`&a` or `&mut a`)
+    /// A referencing operation (`&a` or `&mut a`).
     AddrOf(Mutability, P<Expr>),
-    /// A `break`, with an optional label to break, and an optional expression
+    /// A `break`, with an optional label to break, and an optional expression.
     Break(Option<Label>, Option<P<Expr>>),
-    /// A `continue`, with an optional label
+    /// A `continue`, with an optional label.
     Continue(Option<Label>),
-    /// A `return`, with an optional value to be returned
+    /// A `return`, with an optional value to be returned.
     Ret(Option<P<Expr>>),
 
-    /// Output of the `asm!()` macro
+    /// Output of the `asm!()` macro.
     InlineAsm(P<InlineAsm>),
 
-    /// A macro invocation; pre-expansion
+    /// A macro invocation; pre-expansion.
     Mac(Mac),
 
     /// A struct literal expression.
     ///
-    /// For example, `Foo {x: 1, y: 2}`, or
-    /// `Foo {x: 1, .. base}`, where `base` is the `Option<Expr>`.
+    /// E.g., `Foo {x: 1, y: 2}`, or `Foo {x: 1, .. base}`,
+    /// where `base` is the `Option<Expr>`.
     Struct(Path, Vec<Field>, Option<P<Expr>>),
 
     /// An array literal constructed from one repeated element.
     ///
-    /// For example, `[1; 5]`. The expression is the element to be
+    /// E.g., `[1; 5]`. The expression is the element to be
     /// repeated; the constant is the number of times to repeat it.
     Repeat(P<Expr>, AnonConst),
 
-    /// No-op: used solely so we can pretty-print faithfully
+    /// No-op: used solely so we can pretty-print faithfully.
     Paren(P<Expr>),
 
-    /// `expr?`
+    /// A try expression (`expr?`).
     Try(P<Expr>),
 
-    /// A `yield`, with an optional value to be yielded
+    /// A `yield`, with an optional value to be yielded.
     Yield(Option<P<Expr>>),
 }
 
-/// The explicit Self type in a "qualified path". The actual
+/// The explicit `Self` type in a "qualified path". The actual
 /// path, including the trait and the associated item, is stored
 /// separately. `position` represents the index of the associated
-/// item qualified with this Self type.
+/// item qualified with this `Self` type.
 ///
 /// ```ignore (only-for-syntax-highlight)
 /// <Vec<T> as a::b::Trait>::AssociatedItem
@@ -1198,14 +1197,14 @@ pub struct QSelf {
     pub position: usize,
 }
 
-/// A capture clause
+/// A capture clause.
 #[derive(Clone, Copy, PartialEq, RustcEncodable, RustcDecodable, Debug)]
 pub enum CaptureBy {
     Value,
     Ref,
 }
 
-/// The movability of a generator / closure literal
+/// The movability of a generator / closure literal.
 #[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)]
 pub enum Movability {
     Static,
@@ -1214,12 +1213,12 @@ pub enum Movability {
 
 pub type Mac = Spanned<Mac_>;
 
-/// Represents a macro invocation. The Path indicates which macro
+/// Represents a macro invocation. The `Path` indicates which macro
 /// is being invoked, and the vector of token-trees contains the source
 /// of the macro invocation.
 ///
-/// NB: the additional ident for a macro_rules-style macro is actually
-/// stored in the enclosing item. Oog.
+/// N.B., the additional ident for a `macro_rules`-style macro is actually
+/// stored in the enclosing item.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct Mac_ {
     pub path: Path,
@@ -1254,15 +1253,15 @@ impl MacroDef {
 
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy, Hash, PartialEq)]
 pub enum StrStyle {
-    /// A regular string, like `"foo"`
+    /// A regular string, like `"foo"`.
     Cooked,
-    /// A raw string, like `r##"foo"##`
+    /// A raw string, like `r##"foo"##`.
     ///
     /// The value is the number of `#` symbols used.
     Raw(u16),
 }
 
-/// A literal
+/// A literal.
 pub type Lit = Spanned<LitKind>;
 
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy, Hash, PartialEq)]
@@ -1274,29 +1273,29 @@ pub enum LitIntType {
 
 /// Literal kind.
 ///
-/// E.g. `"foo"`, `42`, `12.34` or `bool`
+/// E.g., `"foo"`, `42`, `12.34`, or `bool`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug, Hash, PartialEq)]
 pub enum LitKind {
-    /// A string literal (`"foo"`)
+    /// A string literal (`"foo"`).
     Str(Symbol, StrStyle),
-    /// A byte string (`b"foo"`)
+    /// A byte string (`b"foo"`).
     ByteStr(Lrc<Vec<u8>>),
-    /// A byte char (`b'f'`)
+    /// A byte char (`b'f'`).
     Byte(u8),
-    /// A character literal (`'a'`)
+    /// A character literal (`'a'`).
     Char(char),
-    /// An integer literal (`1`)
+    /// An integer literal (`1`).
     Int(u128, LitIntType),
-    /// A float literal (`1f64` or `1E10f64`)
+    /// A float literal (`1f64` or `1E10f64`).
     Float(Symbol, FloatTy),
-    /// A float literal without a suffix (`1.0 or 1.0E10`)
+    /// A float literal without a suffix (`1.0 or 1.0E10`).
     FloatUnsuffixed(Symbol),
-    /// A boolean literal
+    /// A boolean literal.
     Bool(bool),
 }
 
 impl LitKind {
-    /// Returns true if this literal is a string and false otherwise.
+    /// Returns `true` if this literal is a string.
     pub fn is_str(&self) -> bool {
         match *self {
             LitKind::Str(..) => true,
@@ -1304,7 +1303,7 @@ impl LitKind {
         }
     }
 
-    /// Returns true if this literal is byte literal string false otherwise.
+    /// Returns `true` if this literal is byte literal string.
     pub fn is_bytestr(&self) -> bool {
         match self {
             LitKind::ByteStr(_) => true,
@@ -1312,7 +1311,7 @@ impl LitKind {
         }
     }
 
-    /// Returns true if this is a numeric literal.
+    /// Returns `true` if this is a numeric literal.
     pub fn is_numeric(&self) -> bool {
         match *self {
             LitKind::Int(..) | LitKind::Float(..) | LitKind::FloatUnsuffixed(..) => true,
@@ -1320,8 +1319,8 @@ impl LitKind {
         }
     }
 
-    /// Returns true if this literal has no suffix. Note: this will return true
-    /// for literals with prefixes such as raw strings and byte strings.
+    /// Returns `true` if this literal has no suffix.
+    /// Note: this will return true for literals with prefixes such as raw strings and byte strings.
     pub fn is_unsuffixed(&self) -> bool {
         match *self {
             // unsuffixed variants
@@ -1339,14 +1338,14 @@ impl LitKind {
         }
     }
 
-    /// Returns true if this literal has a suffix.
+    /// Returns `true` if this literal has a suffix.
     pub fn is_suffixed(&self) -> bool {
         !self.is_unsuffixed()
     }
 }
 
-// NB: If you change this, you'll probably want to change the corresponding
-// type structure in middle/ty.rs as well.
+// N.B., If you change this, you'll probably want to change the corresponding
+// type structure in `middle/ty.rs` as well.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct MutTy {
     pub ty: P<Ty>,
@@ -1373,7 +1372,7 @@ pub struct TraitItem {
     pub generics: Generics,
     pub node: TraitItemKind,
     pub span: Span,
-    /// See `Item::tokens` for what this is
+    /// See `Item::tokens` for what this is.
     pub tokens: Option<TokenStream>,
 }
 
@@ -1395,7 +1394,7 @@ pub struct ImplItem {
     pub generics: Generics,
     pub node: ImplItemKind,
     pub span: Span,
-    /// See `Item::tokens` for what this is
+    /// See `Item::tokens` for what this is.
     pub tokens: Option<TokenStream>,
 }
 
@@ -1443,8 +1442,8 @@ impl IntTy {
     }
 
     pub fn val_to_string(&self, val: i128) -> String {
-        // cast to a u128 so we can correctly print INT128_MIN. All integral types
-        // are parsed as u128, so we wouldn't want to print an extra negative
+        // Cast to a `u128` so we can correctly print `INT128_MIN`. All integral types
+        // are parsed as `u128`, so we wouldn't want to print an extra negative
         // sign.
         format!("{}{}", val as u128, self.ty_to_string())
     }
@@ -1511,7 +1510,7 @@ impl fmt::Display for UintTy {
     }
 }
 
-// Bind a type to an associated type: `A=Foo`.
+// Bind a type to an associated type: `A = Foo`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct TypeBinding {
     pub id: NodeId,
@@ -1541,27 +1540,27 @@ pub struct BareFnTy {
     pub decl: P<FnDecl>,
 }
 
-/// The different kinds of types recognized by the compiler
+/// The different kinds of types recognized by the compiler.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub enum TyKind {
-    /// A variable-length slice (`[T]`)
+    /// A variable-length slice (`[T]`).
     Slice(P<Ty>),
-    /// A fixed length array (`[T; n]`)
+    /// A fixed length array (`[T; n]`).
     Array(P<Ty>, AnonConst),
-    /// A raw pointer (`*const T` or `*mut T`)
+    /// A raw pointer (`*const T` or `*mut T`).
     Ptr(MutTy),
-    /// A reference (`&'a T` or `&'a mut T`)
+    /// A reference (`&'a T` or `&'a mut T`).
     Rptr(Option<Lifetime>, MutTy),
-    /// A bare function (e.g. `fn(usize) -> bool`)
+    /// A bare function (e.g., `fn(usize) -> bool`).
     BareFn(P<BareFnTy>),
-    /// The never type (`!`)
+    /// The never type (`!`).
     Never,
-    /// A tuple (`(A, B, C, D,...)`)
+    /// A tuple (`(A, B, C, D,...)`).
     Tup(Vec<P<Ty>>),
     /// A path (`module::module::...::Type`), optionally
-    /// "qualified", e.g. `<Vec<T> as SomeTrait>::SomeType`.
+    /// "qualified", e.g., `<Vec<T> as SomeTrait>::SomeType`.
     ///
-    /// Type parameters are stored in the Path itself
+    /// Type parameters are stored in the `Path` itself.
     Path(Option<QSelf>, Path),
     /// A trait object type `Bound1 + Bound2 + Bound3`
     /// where `Bound` is a trait or a lifetime.
@@ -1571,18 +1570,18 @@ pub enum TyKind {
     ///
     /// The `NodeId` exists to prevent lowering from having to
     /// generate `NodeId`s on the fly, which would complicate
-    /// the generation of `existential type` items significantly
+    /// the generation of `existential type` items significantly.
     ImplTrait(NodeId, GenericBounds),
-    /// No-op; kept solely so that we can pretty-print faithfully
+    /// No-op; kept solely so that we can pretty-print faithfully.
     Paren(P<Ty>),
-    /// Unused for now
+    /// Unused for now.
     Typeof(AnonConst),
-    /// TyKind::Infer means the type should be inferred instead of it having been
+    /// This means the type should be inferred instead of it having been
     /// specified. This can appear anywhere in a type.
     Infer,
     /// Inferred type of a `self` or `&self` argument in a method.
     ImplicitSelf,
-    // A macro in the type position.
+    /// A macro in the type position.
     Mac(Mac),
     /// Placeholder for a kind that has failed to be defined.
     Err,
@@ -1615,7 +1614,7 @@ pub enum TraitObjectSyntax {
 
 /// Inline assembly dialect.
 ///
-/// E.g. `"intel"` as in `asm!("mov eax, 2" : "={eax}"(result) : : : "intel")`
+/// E.g., `"intel"` as in `asm!("mov eax, 2" : "={eax}"(result) : : : "intel")`.
 #[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)]
 pub enum AsmDialect {
     Att,
@@ -1624,7 +1623,7 @@ pub enum AsmDialect {
 
 /// Inline assembly.
 ///
-/// E.g. `"={eax}"(result)` as in `asm!("mov eax, 2" : "={eax}"(result) : : : "intel")`
+/// E.g., `"={eax}"(result)` as in `asm!("mov eax, 2" : "={eax}"(result) : : : "intel")`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct InlineAsmOutput {
     pub constraint: Symbol,
@@ -1635,7 +1634,7 @@ pub struct InlineAsmOutput {
 
 /// Inline assembly.
 ///
-/// E.g. `asm!("NOP");`
+/// E.g., `asm!("NOP");`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct InlineAsm {
     pub asm: Symbol,
@@ -1651,7 +1650,7 @@ pub struct InlineAsm {
 
 /// An argument in a function header.
 ///
-/// E.g. `bar: usize` as in `fn foo(bar: usize)`
+/// E.g., `bar: usize` as in `fn foo(bar: usize)`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct Arg {
     pub ty: P<Ty>,
@@ -1661,7 +1660,7 @@ pub struct Arg {
 
 /// Alternative representation for `Arg`s describing `self` parameter of methods.
 ///
-/// E.g. `&mut self` as in `fn foo(&mut self)`
+/// E.g., `&mut self` as in `fn foo(&mut self)`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub enum SelfKind {
     /// `self`, `mut self`
@@ -1740,7 +1739,7 @@ impl Arg {
 
 /// Header (not the body) of a function declaration.
 ///
-/// E.g. `fn foo(bar: baz)`
+/// E.g., `fn foo(bar: baz)`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct FnDecl {
     pub inputs: Vec<Arg>,
@@ -1787,7 +1786,8 @@ impl IsAsync {
             false
         }
     }
-    /// In case this is an `Async` return the `NodeId` for the generated impl Trait item
+
+    /// In ths case this is an `async` return, the `NodeId` for the generated `impl Trait` item.
     pub fn opt_return_id(self) -> Option<NodeId> {
         match self {
             IsAsync::Async {
@@ -1844,11 +1844,10 @@ impl fmt::Debug for ImplPolarity {
 pub enum FunctionRetTy {
     /// Return type is not specified.
     ///
-    /// Functions default to `()` and
-    /// closures default to inference. Span points to where return
-    /// type would be inserted.
+    /// Functions default to `()` and closures default to inference.
+    /// Span points to where return type would be inserted.
     Default(Span),
-    /// Everything else
+    /// Everything else.
     Ty(P<Ty>),
 }
 
@@ -1863,7 +1862,7 @@ impl FunctionRetTy {
 
 /// Module declaration.
 ///
-/// E.g. `mod foo;` or `mod foo { .. }`
+/// E.g., `mod foo;` or `mod foo { .. }`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct Mod {
     /// A span from the first token past `{` to the last token until `}`.
@@ -1871,22 +1870,22 @@ pub struct Mod {
     /// to the last token in the external file.
     pub inner: Span,
     pub items: Vec<P<Item>>,
-    /// For `mod foo;` inline is false, for `mod foo { .. }` it is true.
+    /// `true` for `mod foo { .. }`; `false` for `mod foo;`.
     pub inline: bool,
 }
 
 /// Foreign module declaration.
 ///
-/// E.g. `extern { .. }` or `extern C { .. }`
+/// E.g., `extern { .. }` or `extern C { .. }`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct ForeignMod {
     pub abi: Abi,
     pub items: Vec<ForeignItem>,
 }
 
-/// Global inline assembly
+/// Global inline assembly.
 ///
-/// aka module-level assembly or file-scoped assembly
+/// Also known as "module-level assembly" or "file-scoped assembly".
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug, Copy)]
 pub struct GlobalAsm {
     pub asm: Symbol,
@@ -1903,7 +1902,7 @@ pub struct Variant_ {
     pub ident: Ident,
     pub attrs: Vec<Attribute>,
     pub data: VariantData,
-    /// Explicit discriminant, e.g. `Foo = 1`
+    /// Explicit discriminant, e.g., `Foo = 1`.
     pub disr_expr: Option<AnonConst>,
 }
 
@@ -1948,7 +1947,7 @@ impl UseTree {
     }
 }
 
-/// Distinguishes between Attributes that decorate items and Attributes that
+/// Distinguishes between `Attribute`s that decorate items and Attributes that
 /// are contained as statements within items. These two cases need to be
 /// distinguished for pretty-printing.
 #[derive(Clone, PartialEq, RustcEncodable, RustcDecodable, Debug, Copy)]
@@ -1971,8 +1970,8 @@ impl Idx for AttrId {
     }
 }
 
-/// Meta-data associated with an item
-/// Doc-comments are promoted to attributes that have is_sugared_doc = true
+/// Metadata associated with an item.
+/// Doc-comments are promoted to attributes that have `is_sugared_doc = true`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct Attribute {
     pub id: AttrId,
@@ -1983,12 +1982,12 @@ pub struct Attribute {
     pub span: Span,
 }
 
-/// TraitRef's appear in impls.
+/// `TraitRef`s appear in impls.
 ///
-/// resolve maps each TraitRef's ref_id to its defining trait; that's all
-/// that the ref_id is for. The impl_id maps to the "self type" of this impl.
-/// If this impl is an ItemKind::Impl, the impl_id is redundant (it could be the
-/// same as the impl's node id).
+/// Resolve maps each `TraitRef`'s `ref_id` to its defining trait; that's all
+/// that the `ref_id` is for. The `impl_id` maps to the "self type" of this impl.
+/// If this impl is an `ItemKind::Impl`, the `impl_id` is redundant (it could be the
+/// same as the impl's node-id).
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct TraitRef {
     pub path: Path,
@@ -2021,10 +2020,10 @@ impl PolyTraitRef {
 
 #[derive(Copy, Clone, RustcEncodable, RustcDecodable, Debug)]
 pub enum CrateSugar {
-    /// Source is `pub(crate)`
+    /// Source is `pub(crate)`.
     PubCrate,
 
-    /// Source is (just) `crate`
+    /// Source is (just) `crate`.
     JustCrate,
 }
 
@@ -2050,7 +2049,7 @@ impl VisibilityKind {
 
 /// Field of a struct.
 ///
-/// E.g. `bar: usize` as in `struct Foo { bar: usize }`
+/// E.g., `bar: usize` as in `struct Foo { bar: usize }`.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct StructField {
     pub span: Span,
@@ -2076,15 +2075,15 @@ pub struct StructField {
 pub enum VariantData {
     /// Struct variant.
     ///
-    /// E.g. `Bar { .. }` as in `enum Foo { Bar { .. } }`
+    /// E.g., `Bar { .. }` as in `enum Foo { Bar { .. } }`.
     Struct(Vec<StructField>, NodeId),
     /// Tuple variant.
     ///
-    /// E.g. `Bar(..)` as in `enum Foo { Bar(..) }`
+    /// E.g., `Bar(..)` as in `enum Foo { Bar(..) }`.
     Tuple(Vec<StructField>, NodeId),
     /// Unit variant.
     ///
-    /// E.g. `Bar = ..` as in `enum Foo { Bar = .. }`
+    /// E.g., `Bar = ..` as in `enum Foo { Bar = .. }`.
     Unit(NodeId),
 }
 
@@ -2123,9 +2122,9 @@ impl VariantData {
     }
 }
 
-/// An item
+/// An item.
 ///
-/// The name might be a dummy name in case of anonymous items
+/// The name might be a dummy name in case of anonymous items.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub struct Item {
     pub ident: Ident,
@@ -2145,10 +2144,10 @@ pub struct Item {
     pub tokens: Option<TokenStream>,
 }
 
-/// A function header
+/// A function header.
 ///
-/// All the information between the visibility & the name of the function is
-/// included in this struct (e.g. `async unsafe fn` or `const extern "C" fn`)
+/// All the information between the visibility and the name of the function is
+/// included in this struct (e.g., `async unsafe fn` or `const extern "C" fn`).
 #[derive(Clone, Copy, RustcEncodable, RustcDecodable, Debug)]
 pub struct FnHeader {
     pub unsafety: Unsafety,
@@ -2172,65 +2171,65 @@ impl Default for FnHeader {
 pub enum ItemKind {
     /// An `extern crate` item, with optional *original* crate name if the crate was renamed.
     ///
-    /// E.g. `extern crate foo` or `extern crate foo_bar as foo`
+    /// E.g., `extern crate foo` or `extern crate foo_bar as foo`.
     ExternCrate(Option<Name>),
     /// A use declaration (`use` or `pub use`) item.
     ///
-    /// E.g. `use foo;`, `use foo::bar;` or `use foo::bar as FooBar;`
+    /// E.g., `use foo;`, `use foo::bar;` or `use foo::bar as FooBar;`.
     Use(P<UseTree>),
     /// A static item (`static` or `pub static`).
     ///
-    /// E.g. `static FOO: i32 = 42;` or `static FOO: &'static str = "bar";`
+    /// E.g., `static FOO: i32 = 42;` or `static FOO: &'static str = "bar";`.
     Static(P<Ty>, Mutability, P<Expr>),
     /// A constant item (`const` or `pub const`).
     ///
-    /// E.g. `const FOO: i32 = 42;`
+    /// E.g., `const FOO: i32 = 42;`.
     Const(P<Ty>, P<Expr>),
     /// A function declaration (`fn` or `pub fn`).
     ///
-    /// E.g. `fn foo(bar: usize) -> usize { .. }`
+    /// E.g., `fn foo(bar: usize) -> usize { .. }`.
     Fn(P<FnDecl>, FnHeader, Generics, P<Block>),
     /// A module declaration (`mod` or `pub mod`).
     ///
-    /// E.g. `mod foo;` or `mod foo { .. }`
+    /// E.g., `mod foo;` or `mod foo { .. }`.
     Mod(Mod),
     /// An external module (`extern` or `pub extern`).
     ///
-    /// E.g. `extern {}` or `extern "C" {}`
+    /// E.g., `extern {}` or `extern "C" {}`.
     ForeignMod(ForeignMod),
-    /// Module-level inline assembly (from `global_asm!()`)
+    /// Module-level inline assembly (from `global_asm!()`).
     GlobalAsm(P<GlobalAsm>),
     /// A type alias (`type` or `pub type`).
     ///
-    /// E.g. `type Foo = Bar<u8>;`
+    /// E.g., `type Foo = Bar<u8>;`.
     Ty(P<Ty>, Generics),
     /// An existential type declaration (`existential type`).
     ///
-    /// E.g. `existential type Foo: Bar + Boo;`
+    /// E.g., `existential type Foo: Bar + Boo;`.
     Existential(GenericBounds, Generics),
     /// An enum definition (`enum` or `pub enum`).
     ///
-    /// E.g. `enum Foo<A, B> { C<A>, D<B> }`
+    /// E.g., `enum Foo<A, B> { C<A>, D<B> }`.
     Enum(EnumDef, Generics),
     /// A struct definition (`struct` or `pub struct`).
     ///
-    /// E.g. `struct Foo<A> { x: A }`
+    /// E.g., `struct Foo<A> { x: A }`.
     Struct(VariantData, Generics),
     /// A union definition (`union` or `pub union`).
     ///
-    /// E.g. `union Foo<A, B> { x: A, y: B }`
+    /// E.g., `union Foo<A, B> { x: A, y: B }`.
     Union(VariantData, Generics),
     /// A Trait declaration (`trait` or `pub trait`).
     ///
-    /// E.g. `trait Foo { .. }`, `trait Foo<T> { .. }` or `auto trait Foo {}`
+    /// E.g., `trait Foo { .. }`, `trait Foo<T> { .. }` or `auto trait Foo {}`.
     Trait(IsAuto, Unsafety, Generics, GenericBounds, Vec<TraitItem>),
     /// Trait alias
     ///
-    /// E.g. `trait Foo = Bar + Quux;`
+    /// E.g., `trait Foo = Bar + Quux;`.
     TraitAlias(Generics, GenericBounds),
     /// An implementation.
     ///
-    /// E.g. `impl<A> Foo<A> { .. }` or `impl<A> Trait for Foo<A> { .. }`
+    /// E.g., `impl<A> Foo<A> { .. }` or `impl<A> Trait for Foo<A> { .. }`.
     Impl(
         Unsafety,
         ImplPolarity,
@@ -2242,7 +2241,7 @@ pub enum ItemKind {
     ),
     /// A macro invocation.
     ///
-    /// E.g. `macro_rules! foo { .. }` or `foo!(..)`
+    /// E.g., `macro_rules! foo { .. }` or `foo!(..)`.
     Mac(Mac),
 
     /// A macro definition.
@@ -2282,17 +2281,17 @@ pub struct ForeignItem {
     pub vis: Visibility,
 }
 
-/// An item within an `extern` block
+/// An item within an `extern` block.
 #[derive(Clone, RustcEncodable, RustcDecodable, Debug)]
 pub enum ForeignItemKind {
-    /// A foreign function
+    /// A foreign function.
     Fn(P<FnDecl>, Generics),
-    /// A foreign static item (`static ext: u8`), with optional mutability
-    /// (the boolean is true when mutable)
+    /// A foreign static item (`static ext: u8`), with optional mutability.
+    /// (The boolean is `true` for mutable items).
     Static(P<Ty>, bool),
-    /// A foreign type
+    /// A foreign type.
     Ty,
-    /// A macro invocation
+    /// A macro invocation.
     Macro(Mac),
 }
 
@@ -2312,7 +2311,7 @@ mod tests {
     use super::*;
     use serialize;
 
-    // are ASTs encodable?
+    // Are ASTs encodable?
     #[test]
     fn check_asts_encodable() {
         fn assert_encodable<T: serialize::Encodable>() {}
diff --git a/src/libsyntax/attr/mod.rs b/src/libsyntax/attr/mod.rs
index 518b34eefa8..7e8384bec68 100644
--- a/src/libsyntax/attr/mod.rs
+++ b/src/libsyntax/attr/mod.rs
@@ -96,7 +96,7 @@ impl NestedMetaItem {
         self.meta_item().map_or(false, |meta_item| meta_item.check_name(name))
     }
 
-    /// Returns the name of the meta item, e.g. `foo` in `#[foo]`,
+    /// Returns the name of the meta item, e.g., `foo` in `#[foo]`,
     /// `#[foo="bar"]` and `#[foo(bar)]`, if self is a MetaItem
     pub fn name(&self) -> Option<Name> {
         self.meta_item().and_then(|meta_item| Some(meta_item.name()))
@@ -180,7 +180,7 @@ impl Attribute {
     }
 
     /// Returns the **last** segment of the name of this attribute.
-    /// E.g. `foo` for `#[foo]`, `skip` for `#[rustfmt::skip]`.
+    /// e.g., `foo` for `#[foo]`, `skip` for `#[rustfmt::skip]`.
     pub fn name(&self) -> Name {
         name_from_path(&self.path)
     }
diff --git a/src/libsyntax/config.rs b/src/libsyntax/config.rs
index d8fb20d4250..41307175ade 100644
--- a/src/libsyntax/config.rs
+++ b/src/libsyntax/config.rs
@@ -328,7 +328,7 @@ impl<'a> StripUnconfigured<'a> {
         // Anything else is always required, and thus has to error out
         // in case of a cfg attr.
         //
-        // NB: This is intentionally not part of the fold_expr() function
+        // N.B., this is intentionally not part of the fold_expr() function
         //     in order for fold_opt_expr() to be able to avoid this check
         if let Some(attr) = expr.attrs().iter().find(|a| is_cfg(a)) {
             let msg = "removing an expression is not supported in this position";
@@ -421,7 +421,7 @@ impl<'a> fold::Folder for StripUnconfigured<'a> {
     }
 
     fn fold_mac(&mut self, mac: ast::Mac) -> ast::Mac {
-        // Don't configure interpolated AST (c.f. #34171).
+        // Don't configure interpolated AST (cf. issue #34171).
         // Interpolated AST will get configured once the surrounding tokens are parsed.
         mac
     }
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index b898696d349..310cf27689b 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -670,7 +670,7 @@ pub enum SyntaxExtension {
     /// An attribute-like procedural macro that derives a builtin trait.
     BuiltinDerive(BuiltinDeriveFn),
 
-    /// A declarative macro, e.g. `macro m() {}`.
+    /// A declarative macro, e.g., `macro m() {}`.
     DeclMacro {
         expander: Box<dyn TTMacroExpander + sync::Sync + sync::Send>,
         def_info: Option<(ast::NodeId, Span)>,
@@ -908,7 +908,7 @@ impl<'a> ExtCtxt<'a> {
     /// `span_err` should be strongly preferred where-ever possible:
     /// this should *only* be used when:
     ///
-    /// - continuing has a high risk of flow-on errors (e.g. errors in
+    /// - continuing has a high risk of flow-on errors (e.g., errors in
     ///   declaring a macro would cause all uses of that macro to
     ///   complain about "undefined macro"), or
     /// - there is literally nothing else that can be done (however,
@@ -995,7 +995,7 @@ pub fn expr_to_spanned_string<'a>(
         expr
     });
 
-    // we want to be able to handle e.g. `concat!("foo", "bar")`
+    // we want to be able to handle e.g., `concat!("foo", "bar")`
     let expr = cx.expander().fold_expr(expr);
     Err(match expr.node {
         ast::ExprKind::Lit(ref l) => match l.node {
diff --git a/src/libsyntax/ext/expand.rs b/src/libsyntax/ext/expand.rs
index bb5be7f5394..06e7b465784 100644
--- a/src/libsyntax/ext/expand.rs
+++ b/src/libsyntax/ext/expand.rs
@@ -1351,7 +1351,7 @@ impl<'a, 'b> Folder for InvocationCollector<'a, 'b> {
                 module.mod_path.push(item.ident);
 
                 // Detect if this is an inline module (`mod m { ... }` as opposed to `mod m;`).
-                // In the non-inline case, `inner` is never the dummy span (c.f. `parse_item_mod`).
+                // In the non-inline case, `inner` is never the dummy span (cf. `parse_item_mod`).
                 // Thus, if `inner` is the dummy span, we know the module is inline.
                 let inline_module = item.span.contains(inner) || inner.is_dummy();
 
diff --git a/src/libsyntax/ext/tt/macro_parser.rs b/src/libsyntax/ext/tt/macro_parser.rs
index 68d94b43dba..26348d5ec82 100644
--- a/src/libsyntax/ext/tt/macro_parser.rs
+++ b/src/libsyntax/ext/tt/macro_parser.rs
@@ -214,10 +214,10 @@ struct MatcherPos<'root, 'tt: 'root> {
     up: Option<MatcherPosHandle<'root, 'tt>>,
 
     /// Specifically used to "unzip" token trees. By "unzip", we mean to unwrap the delimiters from
-    /// a delimited token tree (e.g. something wrapped in `(` `)`) or to get the contents of a doc
+    /// a delimited token tree (e.g., something wrapped in `(` `)`) or to get the contents of a doc
     /// comment...
     ///
-    /// When matching against matchers with nested delimited submatchers (e.g. `pat ( pat ( .. )
+    /// When matching against matchers with nested delimited submatchers (e.g., `pat ( pat ( .. )
     /// pat ) pat`), we need to keep track of the matchers we are descending into. This stack does
     /// that where the bottom of the stack is the outermost matcher.
     /// Also, throughout the comments, this "descent" is often referred to as "unzipping"...
@@ -373,7 +373,7 @@ fn nameize<I: Iterator<Item = NamedMatch>>(
     ms: &[TokenTree],
     mut res: I,
 ) -> NamedParseResult {
-    // Recursively descend into each type of matcher (e.g. sequences, delimited, metavars) and make
+    // Recursively descend into each type of matcher (e.g., sequences, delimited, metavars) and make
     // sure that each metavar has _exactly one_ binding. If a metavar does not have exactly one
     // binding, then there is an error. If it does, then we insert the binding into the
     // `NamedParseResult`.
@@ -895,7 +895,7 @@ fn may_begin_with(name: &str, token: &Token) -> bool {
 ///
 /// - `p`: the "black-box" parser to use
 /// - `sp`: the `Span` we want to parse
-/// - `name`: the name of the metavar _matcher_ we want to match (e.g. `tt`, `ident`, `block`,
+/// - `name`: the name of the metavar _matcher_ we want to match (e.g., `tt`, `ident`, `block`,
 ///   etc...)
 ///
 /// # Returns
diff --git a/src/libsyntax/ext/tt/macro_rules.rs b/src/libsyntax/ext/tt/macro_rules.rs
index ff622b0c18f..30322ff523d 100644
--- a/src/libsyntax/ext/tt/macro_rules.rs
+++ b/src/libsyntax/ext/tt/macro_rules.rs
@@ -77,9 +77,9 @@ impl<'a> ParserAnyMacro<'a> {
             e
         }));
 
-        // We allow semicolons at the end of expressions -- e.g. the semicolon in
+        // We allow semicolons at the end of expressions -- e.g., the semicolon in
         // `macro_rules! m { () => { panic!(); } }` isn't parsed by `.parse_expr()`,
-        // but `m!()` is allowed in expression positions (c.f. issue #34706).
+        // but `m!()` is allowed in expression positions (cf. issue #34706).
         if kind == AstFragmentKind::Expr && parser.token == token::Semi {
             parser.bump();
         }
@@ -482,15 +482,15 @@ fn check_matcher(sess: &ParseSess,
     err == sess.span_diagnostic.err_count()
 }
 
-// The FirstSets for a matcher is a mapping from subsequences in the
+// `The FirstSets` for a matcher is a mapping from subsequences in the
 // matcher to the FIRST set for that subsequence.
 //
 // This mapping is partially precomputed via a backwards scan over the
 // token trees of the matcher, which provides a mapping from each
-// repetition sequence to its FIRST set.
+// repetition sequence to its *first* set.
 //
-// (Hypothetically sequences should be uniquely identifiable via their
-// spans, though perhaps that is false e.g. for macro-generated macros
+// (Hypothetically, sequences should be uniquely identifiable via their
+// spans, though perhaps that is false, e.g., for macro-generated macros
 // that do not try to inject artificial span information. My plan is
 // to try to catch such cases ahead of time and not include them in
 // the precomputed mapping.)
diff --git a/src/libsyntax/ext/tt/quoted.rs b/src/libsyntax/ext/tt/quoted.rs
index a7415e845ca..1dab0297854 100644
--- a/src/libsyntax/ext/tt/quoted.rs
+++ b/src/libsyntax/ext/tt/quoted.rs
@@ -93,9 +93,9 @@ pub enum TokenTree {
     Delimited(DelimSpan, Lrc<Delimited>),
     /// A kleene-style repetition sequence
     Sequence(DelimSpan, Lrc<SequenceRepetition>),
-    /// E.g. `$var`
+    /// e.g., `$var`
     MetaVar(Span, ast::Ident),
-    /// E.g. `$var:expr`. This is only used in the left hand side of MBE macros.
+    /// e.g., `$var:expr`. This is only used in the left hand side of MBE macros.
     MetaVarDecl(
         Span,
         ast::Ident, /* name to bind */
@@ -199,7 +199,7 @@ pub fn parse(
     let mut trees = input.trees().peekable();
     while let Some(tree) = trees.next() {
         // Given the parsed tree, if there is a metavar and we are expecting matchers, actually
-        // parse out the matcher (i.e. in `$id:ident` this would parse the `:` and `ident`).
+        // parse out the matcher (i.e., in `$id:ident` this would parse the `:` and `ident`).
         let tree = parse_tree(
             tree,
             &mut trees,
@@ -280,7 +280,7 @@ where
         // `tree` is a `$` token. Look at the next token in `trees`
         tokenstream::TokenTree::Token(span, token::Dollar) => match trees.next() {
             // `tree` is followed by a delimited set of token trees. This indicates the beginning
-            // of a repetition sequence in the macro (e.g. `$(pat)*`).
+            // of a repetition sequence in the macro (e.g., `$(pat)*`).
             Some(tokenstream::TokenTree::Delimited(span, delimited)) => {
                 // Must have `(` not `{` or `[`
                 if delimited.delim != token::Paren {
@@ -309,7 +309,7 @@ where
                         edition,
                         macro_node_id,
                     );
-                // Count the number of captured "names" (i.e. named metavars)
+                // Count the number of captured "names" (i.e., named metavars)
                 let name_captures = macro_parser::count_names(&sequence);
                 TokenTree::Sequence(
                     span,
@@ -352,7 +352,7 @@ where
         // `tree` is an arbitrary token. Keep it.
         tokenstream::TokenTree::Token(span, tok) => TokenTree::Token(span, tok),
 
-        // `tree` is the beginning of a delimited set of tokens (e.g. `(` or `{`). We need to
+        // `tree` is the beginning of a delimited set of tokens (e.g., `(` or `{`). We need to
         // descend into the delimited set and further parse it.
         tokenstream::TokenTree::Delimited(span, delimited) => TokenTree::Delimited(
             span,
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 1aea31348a7..1a4de59cce6 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Feature gating
+//! # Feature gating
 //!
 //! This module implements the gating necessary for preventing certain compiler
 //! features from being used by default. This module will crawl a pre-expanded
@@ -105,7 +105,7 @@ macro_rules! declare_features {
     }
 }
 
-// If you change this, please modify src/doc/unstable-book as well.
+// If you change this, please modify `src/doc/unstable-book` as well.
 //
 // Don't ever remove anything from this list; set them to 'Removed'.
 //
@@ -113,7 +113,7 @@ macro_rules! declare_features {
 // was set. This is most important for knowing when a particular feature became
 // stable (active).
 //
-// NB: tools/tidy/src/features.rs parses this information directly out of the
+// N.B., `tools/tidy/src/features.rs` parses this information directly out of the
 // source, so take care when modifying it.
 
 declare_features! (
@@ -152,62 +152,61 @@ declare_features! (
     (active, panic_runtime, "1.10.0", Some(32837), None),
     (active, needs_panic_runtime, "1.10.0", Some(32837), None),
 
-    // OIBIT specific features
+    // Features specific to OIBIT (auto traits)
     (active, optin_builtin_traits, "1.0.0", Some(13231), None),
 
-    // Allows use of #[staged_api]
+    // Allows `#[staged_api]`.
     //
     // rustc internal
     (active, staged_api, "1.0.0", None, None),
 
-    // Allows using #![no_core]
+    // Allows `#![no_core]`.
     (active, no_core, "1.3.0", Some(29639), None),
 
-    // Allows using `box` in patterns; RFC 469
+    // Allows the use of `box` in patterns (RFC 469).
     (active, box_patterns, "1.0.0", Some(29641), None),
 
-    // Allows using the unsafe_destructor_blind_to_params attribute;
-    // RFC 1238
+    // Allows the use of the `unsafe_destructor_blind_to_params` attribute (RFC 1238).
     (active, dropck_parametricity, "1.3.0", Some(28498), None),
 
-    // Allows using the may_dangle attribute; RFC 1327
+    // Allows using the `may_dangle` attribute (RFC 1327).
     (active, dropck_eyepatch, "1.10.0", Some(34761), None),
 
-    // Allows the use of custom attributes; RFC 572
+    // Allows the use of custom attributes (RFC 572).
     (active, custom_attribute, "1.0.0", Some(29642), None),
 
-    // Allows the use of rustc_* attributes; RFC 572
+    // Allows the use of `rustc_*` attributes (RFC 572).
     (active, rustc_attrs, "1.0.0", Some(29642), None),
 
-    // Allows the use of non lexical lifetimes; RFC 2094
+    // Allows the use of non lexical lifetimes (RFC 2094).
     (active, nll, "1.0.0", Some(43234), None),
 
-    // Allows the use of #[allow_internal_unstable]. This is an
-    // attribute on macro_rules! and can't use the attribute handling
+    // Allows the use of `#[allow_internal_unstable]`. This is an
+    // attribute on `macro_rules!` and can't use the attribute handling
     // below (it has to be checked before expansion possibly makes
     // macros disappear).
     //
     // rustc internal
     (active, allow_internal_unstable, "1.0.0", None, None),
 
-    // Allows the use of #[allow_internal_unsafe]. This is an
-    // attribute on macro_rules! and can't use the attribute handling
+    // Allows the use of `#[allow_internal_unsafe]`. This is an
+    // attribute on `macro_rules!` and can't use the attribute handling
     // below (it has to be checked before expansion possibly makes
     // macros disappear).
     //
     // rustc internal
     (active, allow_internal_unsafe, "1.0.0", None, None),
 
-    // #23121. Array patterns have some hazards yet.
+    // Allows the use of slice patterns (issue #23121).
     (active, slice_patterns, "1.0.0", Some(23121), None),
 
-    // Allows the definition of `const fn` functions with some advanced features.
+    // Allows the definition of `const` functions with some advanced features.
     (active, const_fn, "1.2.0", Some(24111), None),
 
-    // Allows let bindings and destructuring in `const fn` functions and constants.
+    // Allows let bindings and destructuring in `const` functions and constants.
     (active, const_let, "1.22.1", Some(48821), None),
 
-    // Allows accessing fields of unions inside const fn.
+    // Allows accessing fields of unions inside `const` functions.
     (active, const_fn_union, "1.27.0", Some(51909), None),
 
     // Allows casting raw pointers to `usize` during const eval.
@@ -222,10 +221,10 @@ declare_features! (
     // Allows comparing raw pointers during const eval.
     (active, const_compare_raw_pointers, "1.27.0", Some(53020), None),
 
-    // Allows panicking during const eval (produces compile-time errors)
+    // Allows panicking during const eval (producing compile-time errors).
     (active, const_panic, "1.30.0", Some(51999), None),
 
-    // Allows using #[prelude_import] on glob `use` items.
+    // Allows using `#[prelude_import]` on glob `use` items.
     //
     // rustc internal
     (active, prelude_import, "1.2.0", None, None),
@@ -233,117 +232,121 @@ declare_features! (
     // Allows default type parameters to influence type inference.
     (active, default_type_parameter_fallback, "1.3.0", Some(27336), None),
 
-    // Allows associated type defaults
+    // Allows associated type defaults.
     (active, associated_type_defaults, "1.2.0", Some(29661), None),
 
-    // Allows `repr(simd)`, and importing the various simd intrinsics
+    // Allows `repr(simd)` and importing the various simd intrinsics.
     (active, repr_simd, "1.4.0", Some(27731), None),
 
-    // Allows `extern "platform-intrinsic" { ... }`
+    // Allows `extern "platform-intrinsic" { ... }`.
     (active, platform_intrinsics, "1.4.0", Some(27731), None),
 
-    // Allows `#[unwind(..)]`
+    // Allows `#[unwind(..)]`.
+    //
     // rustc internal for rust runtime
     (active, unwind_attributes, "1.4.0", None, None),
 
     // Allows the use of `#[naked]` on functions.
     (active, naked_functions, "1.9.0", Some(32408), None),
 
-    // Allows `#[no_debug]`
+    // Allows `#[no_debug]`.
     (active, no_debug, "1.5.0", Some(29721), None),
 
-    // Allows `#[omit_gdb_pretty_printer_section]`
+    // Allows `#[omit_gdb_pretty_printer_section]`.
     //
     // rustc internal
     (active, omit_gdb_pretty_printer_section, "1.5.0", None, None),
 
-    // Allows cfg(target_vendor = "...").
+    // Allows `cfg(target_vendor = "...")`.
     (active, cfg_target_vendor, "1.5.0", Some(29718), None),
 
-    // Allow attributes on expressions and non-item statements
+    // Allows attributes on expressions and non-item statements.
     (active, stmt_expr_attributes, "1.6.0", Some(15701), None),
 
-    // allow using type ascription in expressions
+    // Allows the use of type ascription in expressions.
     (active, type_ascription, "1.6.0", Some(23416), None),
 
-    // Allows cfg(target_thread_local)
+    // Allows `cfg(target_thread_local)`.
     (active, cfg_target_thread_local, "1.7.0", Some(29594), None),
 
     // rustc internal
     (active, abi_vectorcall, "1.7.0", None, None),
 
-    // X..Y patterns
+    // Allows `X..Y` patterns.
     (active, exclusive_range_pattern, "1.11.0", Some(37854), None),
 
     // impl specialization (RFC 1210)
     (active, specialization, "1.7.0", Some(31844), None),
 
-    // Allows cfg(target_has_atomic = "...").
+    // Allows `cfg(target_has_atomic = "...")`.
     (active, cfg_target_has_atomic, "1.9.0", Some(32976), None),
 
-    // The `!` type. Does not imply exhaustive_patterns (below) any more.
+    // The `!` type. Does not imply 'exhaustive_patterns' (below) any more.
     (active, never_type, "1.13.0", Some(35121), None),
 
-    // Allows exhaustive pattern matching on types that contain uninhabited types
+    // Allows exhaustive pattern matching on types that contain uninhabited types.
     (active, exhaustive_patterns, "1.13.0", Some(51085), None),
 
-    // Allows untagged unions `union U { ... }`
+    // Allows untagged unions `union U { ... }`.
     (active, untagged_unions, "1.13.0", Some(32836), None),
 
-    // Used to identify the `compiler_builtins` crate
-    // rustc internal
+    // Used to identify the `compiler_builtins` crate.
+    //
+    // rustc internal.
     (active, compiler_builtins, "1.13.0", None, None),
 
-    // Allows #[link(..., cfg(..))]
+    // Allows `#[link(..., cfg(..))]`.
     (active, link_cfg, "1.14.0", Some(37406), None),
 
-    // `extern "ptx-*" fn()`
+    // Allows `extern "ptx-*" fn()`.
     (active, abi_ptx, "1.15.0", Some(38788), None),
 
-    // The `repr(i128)` annotation for enums
+    // The `repr(i128)` annotation for enums.
     (active, repr128, "1.16.0", Some(35118), None),
 
-    // The `unadjusted` ABI. Perma unstable.
+    // The `unadjusted` ABI; perma-unstable.
+    //
     // rustc internal
     (active, abi_unadjusted, "1.16.0", None, None),
 
     // Declarative macros 2.0 (`macro`).
     (active, decl_macro, "1.17.0", Some(39412), None),
 
-    // Allows #[link(kind="static-nobundle"...)]
+    // Allows `#[link(kind="static-nobundle"...)]`.
     (active, static_nobundle, "1.16.0", Some(37403), None),
 
-    // `extern "msp430-interrupt" fn()`
+    // Allows `extern "msp430-interrupt" fn()`.
     (active, abi_msp430_interrupt, "1.16.0", Some(38487), None),
 
-    // Used to identify crates that contain sanitizer runtimes
+    // Used to identify crates that contain sanitizer runtimes.
+    //
     // rustc internal
     (active, sanitizer_runtime, "1.17.0", None, None),
 
-    // Used to identify crates that contain the profiler runtime
+    // Used to identify crates that contain the profiler runtime.
     //
     // rustc internal
     (active, profiler_runtime, "1.18.0", None, None),
 
-    // `extern "x86-interrupt" fn()`
+    // Allows `extern "x86-interrupt" fn()`.
     (active, abi_x86_interrupt, "1.17.0", Some(40180), None),
 
-    // Allows the `try {...}` expression
+    // Allows the `try {...}` expression.
     (active, try_blocks, "1.29.0", Some(31436), None),
 
-    // Allows module-level inline assembly by way of global_asm!()
+    // Allows module-level inline assembly by way of `global_asm!()`.
     (active, global_asm, "1.18.0", Some(35119), None),
 
-    // Allows overlapping impls of marker traits
+    // Allows overlapping impls of marker traits.
     (active, overlapping_marker_traits, "1.18.0", Some(29864), None),
 
-    // Trait attribute to allow overlapping impls
+    // Trait attribute to allow overlapping impls.
     (active, marker_trait_attr, "1.30.0", Some(29864), None),
 
     // rustc internal
     (active, abi_thiscall, "1.19.0", None, None),
 
-    // Allows a test to fail without failing the whole suite
+    // Allows a test to fail without failing the whole suite.
     (active, allow_fail, "1.19.0", Some(46488), None),
 
     // Allows unsized tuple coercion.
@@ -358,28 +361,28 @@ declare_features! (
     // rustc internal
     (active, allocator_internals, "1.20.0", None, None),
 
-    // #[doc(cfg(...))]
+    // `#[doc(cfg(...))]`
     (active, doc_cfg, "1.21.0", Some(43781), None),
-    // #[doc(masked)]
+    // `#[doc(masked)]`
     (active, doc_masked, "1.21.0", Some(44027), None),
-    // #[doc(spotlight)]
+    // `#[doc(spotlight)]`
     (active, doc_spotlight, "1.22.0", Some(45040), None),
-    // #[doc(include="some-file")]
+    // `#[doc(include = "some-file")]`
     (active, external_doc, "1.22.0", Some(44732), None),
 
-    // Future-proofing enums/structs with #[non_exhaustive] attribute (RFC 2008)
+    // Future-proofing enums/structs with `#[non_exhaustive]` attribute (RFC 2008).
     (active, non_exhaustive, "1.22.0", Some(44109), None),
 
-    // `crate` as visibility modifier, synonymous to `pub(crate)`
+    // Adds `crate` as visibility modifier, synonymous with `pub(crate)`.
     (active, crate_visibility_modifier, "1.23.0", Some(53120), None),
 
     // extern types
     (active, extern_types, "1.23.0", Some(43467), None),
 
-    // Allows trait methods with arbitrary self types
+    // Allows trait methods with arbitrary self types.
     (active, arbitrary_self_types, "1.23.0", Some(44874), None),
 
-    // In-band lifetime bindings (e.g. `fn foo(x: &'a u8) -> &'a u8`)
+    // In-band lifetime bindings (e.g., `fn foo(x: &'a u8) -> &'a u8`).
     (active, in_band_lifetimes, "1.23.0", Some(44524), None),
 
     // Generic associated types (RFC 1598)
@@ -388,25 +391,25 @@ declare_features! (
     // `extern` in paths
     (active, extern_in_paths, "1.23.0", Some(55600), None),
 
-    // Infer static outlives requirements; RFC 2093
+    // Infer static outlives requirements (RFC 2093).
     (active, infer_static_outlives_requirements, "1.26.0", Some(54185), None),
 
-    // Multiple patterns with `|` in `if let` and `while let`
+    // Multiple patterns with `|` in `if let` and `while let`.
     (active, if_while_or_patterns, "1.26.0", Some(48215), None),
 
-    // Allows `#[repr(packed)]` attribute on structs
+    // Allows `#[repr(packed)]` attribute on structs.
     (active, repr_packed, "1.26.0", Some(33158), None),
 
-    // `use path as _;` and `extern crate c as _;`
+    // Allows `use path as _;` and `extern crate c as _;`.
     (active, underscore_imports, "1.26.0", Some(48216), None),
 
-    // Allows macro invocations in `extern {}` blocks
+    // Allows macro invocations in `extern {}` blocks.
     (active, macros_in_extern, "1.27.0", Some(49476), None),
 
     // `existential type`
     (active, existential_type, "1.28.0", Some(34511), None),
 
-    // unstable #[target_feature] directives
+    // unstable `#[target_feature]` directives
     (active, arm_target_feature, "1.27.0", Some(44839), None),
     (active, aarch64_target_feature, "1.27.0", Some(44839), None),
     (active, hexagon_target_feature, "1.27.0", Some(44839), None),
@@ -422,64 +425,64 @@ declare_features! (
     // procedural macros to expand to non-items.
     (active, proc_macro_hygiene, "1.30.0", Some(54727), None),
 
-    // #[doc(alias = "...")]
+    // `#[doc(alias = "...")]`
     (active, doc_alias, "1.27.0", Some(50146), None),
 
-    // Allows irrefutable patterns in if-let and while-let statements (RFC 2086)
+    // Allows irrefutable patterns in `if let` and `while let` statements (RFC 2086).
     (active, irrefutable_let_patterns, "1.27.0", Some(44495), None),
 
     // inconsistent bounds in where clauses
     (active, trivial_bounds, "1.28.0", Some(48214), None),
 
-    // 'a: { break 'a; }
+    // `'a: { break 'a; }`
     (active, label_break_value, "1.28.0", Some(48594), None),
 
     // Exhaustive pattern matching on `usize` and `isize`.
     (active, precise_pointer_size_matching, "1.32.0", Some(56354), None),
 
-    // #[doc(keyword = "...")]
+    // `#[doc(keyword = "...")]`
     (active, doc_keyword, "1.28.0", Some(51315), None),
 
-    // Allows async and await syntax
+    // Allows async and await syntax.
     (active, async_await, "1.28.0", Some(50547), None),
 
-    // #[alloc_error_handler]
+    // `#[alloc_error_handler]`
     (active, alloc_error_handler, "1.29.0", Some(51540), None),
 
     (active, abi_amdgpu_kernel, "1.29.0", Some(51575), None),
 
-    // Perma-unstable; added for testing E0705
+    // Added for testing E0705; perma-unstable.
     (active, test_2018_feature, "1.31.0", Some(0), Some(Edition::Edition2018)),
 
-    // Support for arbitrary delimited token streams in non-macro attributes
+    // support for arbitrary delimited token streams in non-macro attributes
     (active, unrestricted_attribute_tokens, "1.30.0", Some(55208), None),
 
-    // Allows `use x::y;` to resolve through `self::x`, not just `::x`
+    // Allows `use x::y;` to resolve through `self::x`, not just `::x`.
     (active, uniform_paths, "1.30.0", Some(53130), None),
 
-    // Allows unsized rvalues at arguments and parameters
+    // Allows unsized rvalues at arguments and parameters.
     (active, unsized_locals, "1.30.0", Some(48055), None),
 
-    // #![test_runner]
-    // #[test_case]
+    // `#![test_runner]`
+    // `#[test_case]`
     (active, custom_test_frameworks, "1.30.0", Some(50297), None),
 
-    // Non-builtin attributes in inner attribute position
+    // non-builtin attributes in inner attribute position
     (active, custom_inner_attributes, "1.30.0", Some(54726), None),
 
-    // allow mixing of bind-by-move in patterns and references to
+    // Allow mixing of bind-by-move in patterns and references to
     // those identifiers in guards, *if* we are using MIR-borrowck
-    // (aka NLL). Essentially this means you need to be on
-    // edition:2018 or later.
+    // (aka NLL). Essentially this means you need to be using the
+    // 2018 edition or later.
     (active, bind_by_move_pattern_guards, "1.30.0", Some(15287), None),
 
-    // Allows `impl Trait` in bindings (`let`, `const`, `static`)
+    // Allows `impl Trait` in bindings (`let`, `const`, `static`).
     (active, impl_trait_in_bindings, "1.30.0", Some(34511), None),
 
-    // #[cfg_attr(predicate, multiple, attributes, here)]
+    // `#[cfg_attr(predicate, multiple, attributes, here)]`
     (active, cfg_attr_multi, "1.31.0", Some(54881), None),
 
-    // Allows `const _: TYPE = VALUE`
+    // Allows `const _: TYPE = VALUE`.
     (active, underscore_const_names, "1.31.0", Some(54912), None),
 
     // `reason = ` in lint attributes and `expect` lint attribute
@@ -495,7 +498,7 @@ declare_features! (
 declare_features! (
     (removed, import_shadowing, "1.0.0", None, None, None),
     (removed, managed_boxes, "1.0.0", None, None, None),
-    // Allows use of unary negate on unsigned integers, e.g. -e for e: u8
+    // Allows use of unary negate on unsigned integers, e.g., -e for e: u8
     (removed, negate_unsigned, "1.0.0", Some(29645), None, None),
     (removed, reflect, "1.0.0", Some(27749), None, None),
     // A way to temporarily opt out of opt in copy. This will *never* be accepted.
@@ -537,9 +540,9 @@ declare_features! (
 
 declare_features! (
     (accepted, associated_types, "1.0.0", None, None),
-    // allow overloading augmented assignment operations like `a += b`
+    // Allows overloading augmented assignment operations like `a += b`.
     (accepted, augmented_assignments, "1.8.0", Some(28235), None),
-    // allow empty structs and enum variants with braces
+    // Allows empty structs and enum variants with braces.
     (accepted, braced_empty_structs, "1.8.0", Some(29720), None),
     // Allows indexing into constant arrays.
     (accepted, const_indexing, "1.26.0", Some(29947), None),
@@ -550,69 +553,68 @@ declare_features! (
     // to bootstrap fix for #5723.
     (accepted, issue_5723_bootstrap, "1.0.0", None, None),
     (accepted, macro_rules, "1.0.0", None, None),
-    // Allows using #![no_std]
+    // Allows using `#![no_std]`.
     (accepted, no_std, "1.6.0", None, None),
     (accepted, slicing_syntax, "1.0.0", None, None),
     (accepted, struct_variant, "1.0.0", None, None),
     // These are used to test this portion of the compiler, they don't actually
-    // mean anything
+    // mean anything.
     (accepted, test_accepted_feature, "1.0.0", None, None),
     (accepted, tuple_indexing, "1.0.0", None, None),
     // Allows macros to appear in the type position.
     (accepted, type_macros, "1.13.0", Some(27245), None),
     (accepted, while_let, "1.0.0", None, None),
-    // Allows `#[deprecated]` attribute
+    // Allows `#[deprecated]` attribute.
     (accepted, deprecated, "1.9.0", Some(29935), None),
     // `expr?`
     (accepted, question_mark, "1.13.0", Some(31436), None),
-    // Allows `..` in tuple (struct) patterns
+    // Allows `..` in tuple (struct) patterns.
     (accepted, dotdot_in_tuple_patterns, "1.14.0", Some(33627), None),
     (accepted, item_like_imports, "1.15.0", Some(35120), None),
     // Allows using `Self` and associated types in struct expressions and patterns.
     (accepted, more_struct_aliases, "1.16.0", Some(37544), None),
-    // elide `'static` lifetimes in `static`s and `const`s
+    // elide `'static` lifetimes in `static`s and `const`s.
     (accepted, static_in_const, "1.17.0", Some(35897), None),
     // Allows field shorthands (`x` meaning `x: x`) in struct literal expressions.
     (accepted, field_init_shorthand, "1.17.0", Some(37340), None),
     // Allows the definition recursive static items.
     (accepted, static_recursion, "1.17.0", Some(29719), None),
-    // pub(restricted) visibilities (RFC 1422)
+    // `pub(restricted)` visibilities (RFC 1422)
     (accepted, pub_restricted, "1.18.0", Some(32409), None),
-    // The #![windows_subsystem] attribute
+    // `#![windows_subsystem]`
     (accepted, windows_subsystem, "1.18.0", Some(37499), None),
     // Allows `break {expr}` with a value inside `loop`s.
     (accepted, loop_break_value, "1.19.0", Some(37339), None),
     // Permits numeric fields in struct expressions and patterns.
     (accepted, relaxed_adts, "1.19.0", Some(35626), None),
-    // Coerces non capturing closures to function pointers
+    // Coerces non capturing closures to function pointers.
     (accepted, closure_to_fn_coercion, "1.19.0", Some(39817), None),
     // Allows attributes on struct literal fields.
     (accepted, struct_field_attributes, "1.20.0", Some(38814), None),
-    // Allows the definition of associated constants in `trait` or `impl`
-    // blocks.
+    // Allows the definition of associated constants in `trait` or `impl` blocks.
     (accepted, associated_consts, "1.20.0", Some(29646), None),
-    // Usage of the `compile_error!` macro
+    // Usage of the `compile_error!` macro.
     (accepted, compile_error, "1.20.0", Some(40872), None),
     // See rust-lang/rfcs#1414. Allows code like `let x: &'static u32 = &42` to work.
     (accepted, rvalue_static_promotion, "1.21.0", Some(38865), None),
-    // Allow Drop types in constants (RFC 1440)
+    // Allows `Drop` types in constants (RFC 1440).
     (accepted, drop_types_in_const, "1.22.0", Some(33156), None),
     // Allows the sysV64 ABI to be specified on all platforms
-    // instead of just the platforms on which it is the C ABI
+    // instead of just the platforms on which it is the C ABI.
     (accepted, abi_sysv64, "1.24.0", Some(36167), None),
-    // Allows `repr(align(16))` struct attribute (RFC 1358)
+    // Allows `repr(align(16))` struct attribute (RFC 1358).
     (accepted, repr_align, "1.25.0", Some(33626), None),
-    // allow '|' at beginning of match arms (RFC 1925)
+    // Allows '|' at beginning of match arms (RFC 1925).
     (accepted, match_beginning_vert, "1.25.0", Some(44101), None),
     // Nested groups in `use` (RFC 2128)
     (accepted, use_nested_groups, "1.25.0", Some(44494), None),
-    // a..=b and ..=b
+    // `a..=b` and `..=b`
     (accepted, inclusive_range_syntax, "1.26.0", Some(28237), None),
-    // allow `..=` in patterns (RFC 1192)
+    // Allows `..=` in patterns (RFC 1192).
     (accepted, dotdoteq_in_patterns, "1.26.0", Some(28237), None),
     // Termination trait in main (RFC 1937)
     (accepted, termination_trait, "1.26.0", Some(43301), None),
-    // Copy/Clone closures (RFC 2132)
+    // `Copy`/`Clone` closures (RFC 2132).
     (accepted, clone_closures, "1.26.0", Some(44490), None),
     (accepted, copy_closures, "1.26.0", Some(44490), None),
     // Allows `impl Trait` in function arguments.
@@ -623,70 +625,70 @@ declare_features! (
     (accepted, i128_type, "1.26.0", Some(35118), None),
     // Default match binding modes (RFC 2005)
     (accepted, match_default_bindings, "1.26.0", Some(42640), None),
-    // allow `'_` placeholder lifetimes
+    // Allows `'_` placeholder lifetimes.
     (accepted, underscore_lifetimes, "1.26.0", Some(44524), None),
-    // Allows attributes on lifetime/type formal parameters in generics (RFC 1327)
+    // Allows attributes on lifetime/type formal parameters in generics (RFC 1327).
     (accepted, generic_param_attrs, "1.27.0", Some(48848), None),
-    // Allows cfg(target_feature = "...").
+    // Allows `cfg(target_feature = "...")`.
     (accepted, cfg_target_feature, "1.27.0", Some(29717), None),
-    // Allows #[target_feature(...)]
+    // Allows `#[target_feature(...)]`.
     (accepted, target_feature, "1.27.0", None, None),
     // Trait object syntax with `dyn` prefix
     (accepted, dyn_trait, "1.27.0", Some(44662), None),
-    // allow `#[must_use]` on functions; and, must-use operators (RFC 1940)
+    // Allows `#[must_use]` on functions, and introduces must-use operators (RFC 1940).
     (accepted, fn_must_use, "1.27.0", Some(43302), None),
-    // Allows use of the :lifetime macro fragment specifier
+    // Allows use of the `:lifetime` macro fragment specifier.
     (accepted, macro_lifetime_matcher, "1.27.0", Some(34303), None),
     // Termination trait in tests (RFC 1937)
     (accepted, termination_trait_test, "1.27.0", Some(48854), None),
-    // The #[global_allocator] attribute
+    // The `#[global_allocator]` attribute
     (accepted, global_allocator, "1.28.0", Some(27389), None),
-    // Allows `#[repr(transparent)]` attribute on newtype structs
+    // Allows `#[repr(transparent)]` attribute on newtype structs.
     (accepted, repr_transparent, "1.28.0", Some(43036), None),
-    // Defining procedural macros in `proc-macro` crates
+    // Procedural macros in `proc-macro` crates
     (accepted, proc_macro, "1.29.0", Some(38356), None),
     // `foo.rs` as an alternative to `foo/mod.rs`
     (accepted, non_modrs_mods, "1.30.0", Some(44660), None),
-    // Allows use of the :vis macro fragment specifier
+    // Allows use of the `:vis` macro fragment specifier
     (accepted, macro_vis_matcher, "1.30.0", Some(41022), None),
     // Allows importing and reexporting macros with `use`,
     // enables macro modularization in general.
     (accepted, use_extern_macros, "1.30.0", Some(35896), None),
-    // Allows keywords to be escaped for use as identifiers
+    // Allows keywords to be escaped for use as identifiers.
     (accepted, raw_identifiers, "1.30.0", Some(48589), None),
-    // Attributes scoped to tools
+    // Attributes scoped to tools.
     (accepted, tool_attributes, "1.30.0", Some(44690), None),
-    // Allows multi-segment paths in attributes and derives
+    // Allows multi-segment paths in attributes and derives.
     (accepted, proc_macro_path_invoc, "1.30.0", Some(38356), None),
     // Allows all literals in attribute lists and values of key-value pairs.
     (accepted, attr_literals, "1.30.0", Some(34981), None),
-    // Infer outlives requirements; RFC 2093
+    // Infer outlives requirements (RFC 2093).
     (accepted, infer_outlives_requirements, "1.30.0", Some(44493), None),
     (accepted, panic_handler, "1.30.0", Some(44489), None),
-    // Used to preserve symbols (see llvm.used)
+    // Used to preserve symbols (see llvm.used).
     (accepted, used, "1.30.0", Some(40289), None),
     // `crate` in paths
     (accepted, crate_in_paths, "1.30.0", Some(45477), None),
-    // Resolve absolute paths as paths from other crates
+    // Resolve absolute paths as paths from other crates.
     (accepted, extern_absolute_paths, "1.30.0", Some(44660), None),
-    // Access to crate names passed via `--extern` through prelude
+    // Access to crate names passed via `--extern` through prelude.
     (accepted, extern_prelude, "1.30.0", Some(44660), None),
     // Parentheses in patterns
     (accepted, pattern_parentheses, "1.31.0", Some(51087), None),
-    // Allows the definition of `const fn` functions
+    // Allows the definition of `const fn` functions.
     (accepted, min_const_fn, "1.31.0", Some(53555), None),
     // Scoped lints
     (accepted, tool_lints, "1.31.0", Some(44690), None),
-    // impl<I:Iterator> Iterator for &mut Iterator
-    // impl Debug for Foo<'_>
+    // `impl<I:Iterator> Iterator for &mut Iterator`
+    // `impl Debug for Foo<'_>`
     (accepted, impl_header_lifetime_elision, "1.31.0", Some(15872), None),
-    // `extern crate foo as bar;` puts `bar` into extern prelude
+    // `extern crate foo as bar;` puts `bar` into extern prelude.
     (accepted, extern_crate_item_prelude, "1.31.0", Some(55599), None),
-    // Allows use of the :literal macro fragment specifier (RFC 1576)
+    // Allows use of the `:literal` macro fragment specifier (RFC 1576).
     (accepted, macro_literal_matcher, "1.31.0", Some(35625), None),
     // Integer match exhaustiveness checking (RFC 2591)
     (accepted, exhaustive_integer_patterns, "1.32.0", Some(50907), None),
-    // Use `?` as the Kleene "at most one" operator
+    // Use `?` as the Kleene "at most one" operator.
     (accepted, macro_at_most_once_rep, "1.32.0", Some(48075), None),
     // `Self` struct constructor (RFC 2302)
     (accepted, self_struct_ctor, "1.32.0", Some(51994), None),
@@ -1276,7 +1278,7 @@ impl<'a> Context<'a> {
             if attr.path == &**n {
                 // Plugins can't gate attributes, so we don't check for it
                 // unlike the code above; we only use this loop to
-                // short-circuit to avoid the checks below
+                // short-circuit to avoid the checks below.
                 debug!("check_attribute: {:?} is registered by a plugin, {:?}", attr.path, ty);
                 return;
             }
@@ -1287,10 +1289,9 @@ impl<'a> Context<'a> {
                            with the prefix `rustc_` \
                            are reserved for internal compiler diagnostics");
         } else if !attr::is_known(attr) {
-            // Only run the custom attribute lint during regular
-            // feature gate checking. Macro gating runs
-            // before the plugin attributes are registered
-            // so we skip this then
+            // Only run the custom attribute lint during regular feature gate
+            // checking. Macro gating runs before the plugin attributes are
+            // registered, so we skip this in that case.
             if !is_macro {
                 let msg = format!("The attribute `{}` is currently unknown to the compiler and \
                                    may have meaning added to it in the future", attr.path);
@@ -1788,14 +1789,13 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
                 _node_id: NodeId) {
         match fn_kind {
             FnKind::ItemFn(_, header, _, _) => {
-                // check for const fn and async fn declarations
+                // Check for const fn and async fn declarations.
                 if header.asyncness.is_async() {
                     gate_feature_post!(&self, async_await, span, "async fn is unstable");
                 }
-                // stability of const fn methods are covered in
-                // visit_trait_item and visit_impl_item below; this is
-                // because default methods don't pass through this
-                // point.
+                // Stability of const fn methods are covered in
+                // `visit_trait_item` and `visit_impl_item` below; this is
+                // because default methods don't pass through this point.
 
                 self.check_abi(header.abi, span);
             }
@@ -1872,7 +1872,7 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
 
     fn visit_path(&mut self, path: &'a ast::Path, _id: NodeId) {
         for segment in &path.segments {
-            // Identifiers we are going to check could come from a legacy macro (e.g. `#[test]`).
+            // Identifiers we are going to check could come from a legacy macro (e.g., `#[test]`).
             // For such macros identifiers must have empty context, because this context is
             // used during name resolution and produced names must be unhygienic for compatibility.
             // On the other hand, we need the actual non-empty context for feature gate checking
@@ -1919,7 +1919,7 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute],
     for &edition in ALL_EDITIONS {
         if edition <= crate_edition {
             // The `crate_edition` implies its respective umbrella feature-gate
-            // (i.e. `#![feature(rust_20XX_preview)]` isn't needed on edition 20XX).
+            // (i.e., `#![feature(rust_20XX_preview)]` isn't needed on edition 20XX).
             edition_enabled_features.insert(Symbol::intern(edition.feature_name()), edition);
         }
     }
@@ -2079,7 +2079,7 @@ pub enum UnstableFeatures {
 
 impl UnstableFeatures {
     pub fn from_environment() -> UnstableFeatures {
-        // Whether this is a feature-staged build, i.e. on the beta or stable channel
+        // Whether this is a feature-staged build, i.e., on the beta or stable channel
         let disable_unstable_features = option_env!("CFG_DISABLE_UNSTABLE_FEATURES").is_some();
         // Whether we should enable unstable features for bootstrapping
         let bootstrap = env::var("RUSTC_BOOTSTRAP").is_ok();
diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs
index 0e6e2f90693..82f52931cad 100644
--- a/src/libsyntax/fold.rs
+++ b/src/libsyntax/fold.rs
@@ -229,7 +229,7 @@ pub trait Folder : Sized {
 
     fn fold_mac(&mut self, _mac: Mac) -> Mac {
         panic!("fold_mac disabled by default");
-        // NB: see note about macros above.
+        // N.B., see note about macros above.
         // if you really want a folder that
         // works on macros, use this
         // definition in your trait impl:
@@ -637,7 +637,7 @@ pub fn noop_fold_token<T: Folder>(t: token::Token, fld: &mut T) -> token::Token
 
 /// apply folder to elements of interpolated nodes
 //
-// NB: this can occur only when applying a fold to partially expanded code, where
+// N.B., this can occur only when applying a fold to partially expanded code, where
 // parsed pieces have gotten implanted ito *other* macro invocations. This is relevant
 // for macro hygiene, but possibly not elsewhere.
 //
diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs
index 3c66db082cc..0c24c20554a 100644
--- a/src/libsyntax/lib.rs
+++ b/src/libsyntax/lib.rs
@@ -134,7 +134,7 @@ pub mod diagnostics {
     pub mod metadata;
 }
 
-// NB: This module needs to be declared first so diagnostics are
+// N.B., this module needs to be declared first so diagnostics are
 // registered before they are used.
 pub mod diagnostic_list;
 
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs
index 80227fdf82d..4be54e5bacc 100644
--- a/src/libsyntax/parse/lexer/mod.rs
+++ b/src/libsyntax/parse/lexer/mod.rs
@@ -1127,7 +1127,7 @@ impl<'a> StringReader<'a> {
                     "expected at least one digit in exponent"
                 );
                 if let Some(ch) = self.ch {
-                    // check for e.g. Unicode minus '−' (Issue #49746)
+                    // check for e.g., Unicode minus '−' (Issue #49746)
                     if unicode_chars::check_for_substitution(self, ch, &mut err) {
                         self.bump();
                         self.scan_digits(10, 10);
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index c7eaf4d1eee..9a9b615233b 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -92,12 +92,12 @@ pub enum PathStyle {
     /// `x<y>` - comparisons, `x::<y>` - unambiguously a path.
     Expr,
     /// In other contexts, notably in types, no ambiguity exists and paths can be written
-    /// without the disambiguator, e.g. `x<y>` - unambiguously a path.
+    /// without the disambiguator, e.g., `x<y>` - unambiguously a path.
     /// Paths with disambiguators are still accepted, `x::<Y>` - unambiguously a path too.
     Type,
-    /// A path with generic arguments disallowed, e.g. `foo::bar::Baz`, used in imports,
+    /// A path with generic arguments disallowed, e.g., `foo::bar::Baz`, used in imports,
     /// visibilities or attributes.
-    /// Technically, this variant is unnecessary and e.g. `Expr` can be used instead
+    /// Technically, this variant is unnecessary and e.g., `Expr` can be used instead
     /// (paths in "mod" contexts have to be checked later for absence of generic arguments
     /// anyway, due to macros), but it is used to avoid weird suggestions about expected
     /// tokens when something goes wrong.
@@ -1917,7 +1917,7 @@ impl<'a> Parser<'a> {
         self.parse_arg_general(true)
     }
 
-    /// Parse an argument in a lambda header e.g. |arg, arg|
+    /// Parse an argument in a lambda header e.g., |arg, arg|
     fn parse_fn_block_arg(&mut self) -> PResult<'a, Arg> {
         let pat = self.parse_pat(Some("argument name"))?;
         let t = if self.eat(&token::Colon) {
@@ -2334,7 +2334,7 @@ impl<'a> Parser<'a> {
     /// parse things like parenthesized exprs,
     /// macros, return, etc.
     ///
-    /// NB: This does not parse outer attributes,
+    /// N.B., this does not parse outer attributes,
     ///     and is private because it only works
     ///     correctly if called from parse_dot_or_call_expr().
     fn parse_bottom_expr(&mut self) -> PResult<'a, P<Expr>> {
@@ -3732,7 +3732,7 @@ impl<'a> Parser<'a> {
         self.with_res(r, |this| this.parse_assoc_expr(already_parsed_attrs))
     }
 
-    /// Parse the RHS of a local variable declaration (e.g. '= 14;')
+    /// Parse the RHS of a local variable declaration (e.g., '= 14;')
     fn parse_initializer(&mut self, skip_eq: bool) -> PResult<'a, Option<P<Expr>>> {
         if self.eat(&token::Eq) {
             Ok(Some(self.parse_expr()?))
@@ -4114,7 +4114,7 @@ impl<'a> Parser<'a> {
         self.parse_pat_with_range_pat(true, expected)
     }
 
-    /// Parse a pattern, with a setting whether modern range patterns e.g. `a..=b`, `a..b` are
+    /// Parse a pattern, with a setting whether modern range patterns e.g., `a..=b`, `a..b` are
     /// allowed.
     fn parse_pat_with_range_pat(
         &mut self,
@@ -4456,7 +4456,7 @@ impl<'a> Parser<'a> {
     }
 
     /// Parse a statement. This stops just before trailing semicolons on everything but items.
-    /// e.g. a `StmtKind::Semi` parses to a `StmtKind::Expr`, leaving the trailing `;` unconsumed.
+    /// e.g., a `StmtKind::Semi` parses to a `StmtKind::Expr`, leaving the trailing `;` unconsumed.
     pub fn parse_stmt(&mut self) -> PResult<'a, Option<Stmt>> {
         Ok(self.parse_stmt_(true))
     }
@@ -5053,9 +5053,9 @@ impl<'a> Parser<'a> {
 
     // Parse bounds of a type parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
     // BOUND = TY_BOUND | LT_BOUND
-    // LT_BOUND = LIFETIME (e.g. `'a`)
+    // LT_BOUND = LIFETIME (e.g., `'a`)
     // TY_BOUND = TY_BOUND_NOPAREN | (TY_BOUND_NOPAREN)
-    // TY_BOUND_NOPAREN = [?] [for<LT_PARAM_DEFS>] SIMPLE_PATH (e.g. `?for<'a: 'b> m::Trait<'a>`)
+    // TY_BOUND_NOPAREN = [?] [for<LT_PARAM_DEFS>] SIMPLE_PATH (e.g., `?for<'a: 'b> m::Trait<'a>`)
     fn parse_generic_bounds_common(&mut self, allow_plus: bool) -> PResult<'a, GenericBounds> {
         let mut bounds = Vec::new();
         loop {
@@ -5110,7 +5110,7 @@ impl<'a> Parser<'a> {
     }
 
     // Parse bounds of a lifetime parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`.
-    // BOUND = LT_BOUND (e.g. `'a`)
+    // BOUND = LT_BOUND (e.g., `'a`)
     fn parse_lt_param_bounds(&mut self) -> GenericBounds {
         let mut lifetimes = Vec::new();
         while self.check_lifetime() {
@@ -6293,7 +6293,7 @@ impl<'a> Parser<'a> {
 
     /// Parse `pub`, `pub(crate)` and `pub(in path)` plus shortcuts `crate` for `pub(crate)`,
     /// `pub(self)` for `pub(in self)` and `pub(super)` for `pub(in super)`.
-    /// If the following element can't be a tuple (i.e. it's a function definition,
+    /// If the following element can't be a tuple (i.e., it's a function definition,
     /// it's not a tuple struct field) and the contents within the parens
     /// isn't valid, emit a proper diagnostic.
     pub fn parse_visibility(&mut self, can_take_tuple: bool) -> PResult<'a, Visibility> {
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 04a791fbcb9..6b9cc2f9792 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -550,7 +550,7 @@ impl Token {
         });
 
         // During early phases of the compiler the AST could get modified
-        // directly (e.g. attributes added or removed) and the internal cache
+        // directly (e.g., attributes added or removed) and the internal cache
         // of tokens my not be invalidated or updated. Consequently if the
         // "lossless" token stream disagrees with our actual stringification
         // (which has historically been much more battle-tested) then we go
diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs
index aaed56da29d..0890be728f3 100644
--- a/src/libsyntax/print/pp.rs
+++ b/src/libsyntax/print/pp.rs
@@ -109,7 +109,7 @@
 //! The buffered tokens go through a ring-buffer, 'tokens'. The 'left' and
 //! 'right' indices denote the active portion of the ring buffer as well as
 //! describing hypothetical points-in-the-infinite-stream at most 3N tokens
-//! apart (i.e. "not wrapped to ring-buffer boundaries"). The paper will switch
+//! apart (i.e., "not wrapped to ring-buffer boundaries"). The paper will switch
 //! between using 'left' and 'right' terms to denote the wrapped-to-ring-buffer
 //! and point-in-infinite-stream senses freely.
 //!
diff --git a/src/libsyntax/ptr.rs b/src/libsyntax/ptr.rs
index 9fbc64758da..17e7730120f 100644
--- a/src/libsyntax/ptr.rs
+++ b/src/libsyntax/ptr.rs
@@ -16,11 +16,11 @@
 //! # Motivations and benefits
 //!
 //! * **Identity**: sharing AST nodes is problematic for the various analysis
-//!   passes (e.g. one may be able to bypass the borrow checker with a shared
+//!   passes (e.g., one may be able to bypass the borrow checker with a shared
 //!   `ExprKind::AddrOf` node taking a mutable borrow). The only reason `@T` in the
 //!   AST hasn't caused issues is because of inefficient folding passes which
 //!   would always deduplicate any such shared nodes. Even if the AST were to
-//!   switch to an arena, this would still hold, i.e. it couldn't use `&'a T`,
+//!   switch to an arena, this would still hold, i.e., it couldn't use `&'a T`,
 //!   but rather a wrapper like `P<'a, T>`.
 //!
 //! * **Immutability**: `P<T>` disallows mutating its inner `T`, unlike `Box<T>`
@@ -34,7 +34,7 @@
 //! * **Maintainability**: `P<T>` provides a fixed interface - `Deref`,
 //!   `and_then` and `map` - which can remain fully functional even if the
 //!   implementation changes (using a special thread-local heap, for example).
-//!   Moreover, a switch to, e.g. `P<'a, T>` would be easy and mostly automated.
+//!   Moreover, a switch to, e.g., `P<'a, T>` would be easy and mostly automated.
 
 use std::fmt::{self, Display, Debug};
 use std::iter::FromIterator;
diff --git a/src/libsyntax/test.rs b/src/libsyntax/test.rs
index 8ff4b0d025c..436a167e6a0 100644
--- a/src/libsyntax/test.rs
+++ b/src/libsyntax/test.rs
@@ -281,7 +281,7 @@ fn generate_test_harness(sess: &ParseSess,
         path: Vec::new(),
         test_cases: Vec::new(),
         reexport_test_harness_main,
-        // NB: doesn't consider the value of `--crate-name` passed on the command line.
+        // N.B., doesn't consider the value of `--crate-name` passed on the command line.
         is_libtest: attr::find_crate_name(&krate.attrs).map(|s| s == "test").unwrap_or(false),
         toplevel_reexport: None,
         ctxt: SyntaxContext::empty().apply_mark(mark),
diff --git a/src/libsyntax/util/parser.rs b/src/libsyntax/util/parser.rs
index 6866806cd7c..b7cd2acf8a5 100644
--- a/src/libsyntax/util/parser.rs
+++ b/src/libsyntax/util/parser.rs
@@ -340,8 +340,8 @@ impl ExprPrecedence {
 }
 
 
-/// Expressions that syntactically contain an "exterior" struct literal i.e. not surrounded by any
-/// parens or other delimiters, e.g. `X { y: 1 }`, `X { y: 1 }.method()`, `foo == X { y: 1 }` and
+/// Expressions that syntactically contain an "exterior" struct literal i.e., not surrounded by any
+/// parens or other delimiters, e.g., `X { y: 1 }`, `X { y: 1 }.method()`, `foo == X { y: 1 }` and
 /// `X { y: 1 } == foo` all do, but `(X { y: 1 }) == foo` does not.
 pub fn contains_exterior_struct_lit(value: &ast::Expr) -> bool {
     match value.node {
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index 77311bf53fd..4be831a0b3f 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -43,7 +43,7 @@ pub enum FnKind<'a> {
 /// Each method of the Visitor trait is a hook to be potentially
 /// overridden.  Each method's default implementation recursively visits
 /// the substructure of the input via the corresponding `walk` method;
-/// e.g. the `visit_mod` method by default calls `visit::walk_mod`.
+/// e.g., the `visit_mod` method by default calls `visit::walk_mod`.
 ///
 /// If you want to ensure that your code handles every variant
 /// explicitly, you need to override each method.  (And you also need
@@ -110,7 +110,7 @@ pub trait Visitor<'ast>: Sized {
     }
     fn visit_mac(&mut self, _mac: &'ast Mac) {
         panic!("visit_mac disabled by default");
-        // NB: see note about macros above.
+        // N.B., see note about macros above.
         // if you really want a visitor that
         // works on macros, use this
         // definition in your trait impl: