Skip to content

Commit 3cf7b34

Browse files
authored
Unrolled build for #159936
Rollup merge of #159936 - mejrs:ast_docs, r=chenyukang Minor `rustc_ast::ast` doc cleanups `P` is an outdated reference. `CfgAttrTrace` was updated in #159722 Docs were formatted so that the entire paragraph doesn't show up on the module level docs (pet peeve of mine). r? @nnethercote
2 parents dc3f851 + b81e756 commit 3cf7b34

1 file changed

Lines changed: 17 additions & 8 deletions

File tree

compiler/rustc_ast/src/ast.rs

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pub struct PathSegment {
220220
/// `None` means that no parameter list is supplied (`Path`),
221221
/// `Some` means that parameter list is supplied (`Path<X, Y>`)
222222
/// but it can be empty (`Path<>`).
223-
/// `P` is used as a size optimization for the common case with no parameters.
223+
/// `Box` is used as a size optimization for the common case with no parameters.
224224
pub args: Option<Box<GenericArgs>>,
225225
}
226226

@@ -557,9 +557,10 @@ pub struct Crate {
557557
pub is_placeholder: bool,
558558
}
559559

560-
/// A semantic representation of a meta item. A meta item is a slightly
561-
/// restricted form of an attribute -- it can only contain expressions in
562-
/// certain leaf positions, rather than arbitrary token streams -- that is used
560+
/// A semantic representation of a meta item.
561+
///
562+
/// A meta item is a slightly restricted form of an attribute -- it can only contain
563+
/// expressions in certain leaf positions, rather than arbitrary token streams -- that is used
563564
/// for most built-in attributes.
564565
///
565566
/// E.g., `#[test]`, `#[derive(..)]`, `#[rustfmt::skip]` or `#[feature = "foo"]`.
@@ -806,6 +807,7 @@ impl ByRef {
806807
}
807808

808809
/// The mode of a binding (`mut`, `ref mut`, etc).
810+
///
809811
/// Used for both the explicit binding annotations given in the HIR for a binding
810812
/// and the final binding mode that we infer after type inference/match ergonomics.
811813
/// `.0` is the by-reference mode (`ref`, `ref mut`, or by value),
@@ -1184,7 +1186,9 @@ impl UnOp {
11841186
}
11851187
}
11861188

1187-
/// A statement. No `attrs` or `tokens` fields because each `StmtKind` variant
1189+
/// A statement.
1190+
///
1191+
/// No `attrs` or `tokens` fields because each `StmtKind` variant
11881192
/// contains an AST node with those fields. (Except for `StmtKind::Empty`,
11891193
/// which never has attrs or tokens)
11901194
#[derive(Clone, Encodable, Decodable, Debug)]
@@ -1375,6 +1379,8 @@ pub enum UnsafeSource {
13751379
UserProvided,
13761380
}
13771381

1382+
/// An anonymous constant.
1383+
///
13781384
/// A constant (expression) that's not an item or associated item,
13791385
/// but needs its own `DefId` for type-checking, const-eval, etc.
13801386
/// These are usually found nested inside types (e.g., array lengths)
@@ -1962,8 +1968,9 @@ pub enum UnsafeBinderCastKind {
19621968
Unwrap,
19631969
}
19641970

1965-
/// The explicit `Self` type in a "qualified path". The actual
1966-
/// path, including the trait and the associated item, is stored
1971+
/// The explicit `Self` type in a "qualified path".
1972+
///
1973+
/// The actual path, including the trait and the associated item, is stored
19671974
/// separately. `position` represents the index of the associated
19681975
/// item qualified with this `Self` type.
19691976
///
@@ -3503,6 +3510,8 @@ pub struct AttrItem {
35033510
pub span: Span,
35043511
}
35053512

3513+
/// A synthetic attribute.
3514+
///
35063515
/// Synthetic attributes are inserted by the compiler. They cannot be written in source code, and
35073516
/// so cannot be pretty-printed by the AST pretty printer (because its output should be valid Rust
35083517
/// code). They receive special treatment because they must not affect observable language
@@ -3525,7 +3534,7 @@ pub enum SyntheticAttr {
35253534
/// evaluated true or not (or even failed to parse). The `pred` and `attrs` are not recorded
35263535
/// because they are not needed.
35273536
///
3528-
/// The attribute is used by some clippy lints.
3537+
/// The attribute is used by rustdoc to display `doc_cfg` information and by some clippy lints.
35293538
CfgAttrTrace(CfgEntry),
35303539
}
35313540

0 commit comments

Comments
 (0)