Added dots at the sentence ends of rustc AST doc

This commit is contained in:
Yoh Deadfall 2024-07-05 18:10:05 +03:00
parent 9f877c9cd2
commit 291ed596f7

View File

@ -176,7 +176,7 @@ pub enum GenericArgs {
AngleBracketed(AngleBracketedArgs), AngleBracketed(AngleBracketedArgs),
/// The `(A, B)` and `C` in `Foo(A, B) -> C`. /// The `(A, B)` and `C` in `Foo(A, B) -> C`.
Parenthesized(ParenthesizedArgs), Parenthesized(ParenthesizedArgs),
/// `(..)` in return type notation /// `(..)` in return type notation.
ParenthesizedElided(Span), ParenthesizedElided(Span),
} }
@ -197,11 +197,11 @@ pub fn span(&self) -> Span {
/// Concrete argument in the sequence of generic args. /// Concrete argument in the sequence of generic args.
#[derive(Clone, Encodable, Decodable, Debug)] #[derive(Clone, Encodable, Decodable, Debug)]
pub enum GenericArg { pub enum GenericArg {
/// `'a` in `Foo<'a>` /// `'a` in `Foo<'a>`.
Lifetime(Lifetime), Lifetime(Lifetime),
/// `Bar` in `Foo<Bar>` /// `Bar` in `Foo<Bar>`.
Type(P<Ty>), Type(P<Ty>),
/// `1` in `Foo<1>` /// `1` in `Foo<1>`.
Const(AnonConst), Const(AnonConst),
} }
@ -355,7 +355,7 @@ pub enum GenericParamKind {
ty: P<Ty>, ty: P<Ty>,
/// Span of the `const` keyword. /// Span of the `const` keyword.
kw_span: Span, kw_span: Span,
/// Optional default value for the const generic param /// Optional default value for the const generic param.
default: Option<AnonConst>, default: Option<AnonConst>,
}, },
} }
@ -832,7 +832,7 @@ pub enum PatKind {
/// only one rest pattern may occur in the pattern sequences. /// only one rest pattern may occur in the pattern sequences.
Rest, Rest,
// A never pattern `!` // A never pattern `!`.
Never, Never,
/// Parentheses in patterns used for grouping (i.e., `(PAT)`). /// Parentheses in patterns used for grouping (i.e., `(PAT)`).
@ -1121,9 +1121,9 @@ pub fn init_else_opt(&self) -> Option<(&Expr, Option<&Block>)> {
#[derive(Clone, Encodable, Decodable, Debug)] #[derive(Clone, Encodable, Decodable, Debug)]
pub struct Arm { pub struct Arm {
pub attrs: AttrVec, pub attrs: AttrVec,
/// Match arm pattern, e.g. `10` in `match foo { 10 => {}, _ => {} }` /// Match arm pattern, e.g. `10` in `match foo { 10 => {}, _ => {} }`.
pub pat: P<Pat>, pub pat: P<Pat>,
/// Match arm guard, e.g. `n > 10` in `match foo { n if n > 10 => {}, _ => {} }` /// Match arm guard, e.g. `n > 10` in `match foo { n if n > 10 => {}, _ => {} }`.
pub guard: Option<P<Expr>>, pub guard: Option<P<Expr>>,
/// Match arm body. Omitted if the pattern is a never pattern. /// Match arm body. Omitted if the pattern is a never pattern.
pub body: Option<P<Expr>>, pub body: Option<P<Expr>>,
@ -1354,12 +1354,12 @@ pub struct Closure {
pub fn_arg_span: Span, pub fn_arg_span: Span,
} }
/// Limit types of a range (inclusive or exclusive) /// Limit types of a range (inclusive or exclusive).
#[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug)] #[derive(Copy, Clone, PartialEq, Encodable, Decodable, Debug)]
pub enum RangeLimits { pub enum RangeLimits {
/// Inclusive at the beginning, exclusive at the end /// Inclusive at the beginning, exclusive at the end.
HalfOpen, HalfOpen,
/// Inclusive at the beginning and end /// Inclusive at the beginning and end.
Closed, Closed,
} }
@ -1400,9 +1400,9 @@ pub struct StructExpr {
pub enum ExprKind { pub enum ExprKind {
/// An array (e.g, `[a, b, c, d]`). /// An array (e.g, `[a, b, c, d]`).
Array(ThinVec<P<Expr>>), Array(ThinVec<P<Expr>>),
/// Allow anonymous constants from an inline `const` block /// Allow anonymous constants from an inline `const` block.
ConstBlock(AnonConst), ConstBlock(AnonConst),
/// A function call /// A function call.
/// ///
/// The first field resolves to the function itself, /// The first field resolves to the function itself,
/// and the second field is the list of arguments. /// and the second field is the list of arguments.
@ -1456,7 +1456,7 @@ pub enum ExprKind {
/// A block (`'label: { ... }`). /// A block (`'label: { ... }`).
Block(P<Block>, Option<Label>), Block(P<Block>, Option<Label>),
/// An `async` block (`async move { ... }`), /// An `async` block (`async move { ... }`),
/// or a `gen` block (`gen move { ... }`) /// or a `gen` block (`gen move { ... }`).
/// ///
/// The span is the "decl", which is the header before the body `{ }` /// The span is the "decl", which is the header before the body `{ }`
/// including the `asyng`/`gen` keywords and possibly `move`. /// including the `asyng`/`gen` keywords and possibly `move`.
@ -2156,9 +2156,9 @@ pub enum TyKind {
Never, Never,
/// A tuple (`(A, B, C, D,...)`). /// A tuple (`(A, B, C, D,...)`).
Tup(ThinVec<P<Ty>>), Tup(ThinVec<P<Ty>>),
/// An anonymous struct type i.e. `struct { foo: Type }` /// An anonymous struct type i.e. `struct { foo: Type }`.
AnonStruct(NodeId, ThinVec<FieldDef>), AnonStruct(NodeId, ThinVec<FieldDef>),
/// An anonymous union type i.e. `union { bar: Type }` /// An anonymous union type i.e. `union { bar: Type }`.
AnonUnion(NodeId, ThinVec<FieldDef>), AnonUnion(NodeId, ThinVec<FieldDef>),
/// A path (`module::module::...::Type`), optionally /// A path (`module::module::...::Type`), optionally
/// "qualified", e.g., `<Vec<T> as SomeTrait>::SomeType`. /// "qualified", e.g., `<Vec<T> as SomeTrait>::SomeType`.
@ -2232,9 +2232,9 @@ pub enum TraitObjectSyntax {
#[derive(Clone, Encodable, Decodable, Debug)] #[derive(Clone, Encodable, Decodable, Debug)]
pub enum PreciseCapturingArg { pub enum PreciseCapturingArg {
/// Lifetime parameter /// Lifetime parameter.
Lifetime(Lifetime), Lifetime(Lifetime),
/// Type or const parameter /// Type or const parameter.
Arg(Path, NodeId), Arg(Path, NodeId),
} }
@ -2528,11 +2528,11 @@ pub enum Safety {
/// Iterator`. /// Iterator`.
#[derive(Copy, Clone, Encodable, Decodable, Debug)] #[derive(Copy, Clone, Encodable, Decodable, Debug)]
pub enum CoroutineKind { pub enum CoroutineKind {
/// `async`, which returns an `impl Future` /// `async`, which returns an `impl Future`.
Async { span: Span, closure_id: NodeId, return_impl_trait_id: NodeId }, Async { span: Span, closure_id: NodeId, return_impl_trait_id: NodeId },
/// `gen`, which returns an `impl Iterator` /// `gen`, which returns an `impl Iterator`.
Gen { span: Span, closure_id: NodeId, return_impl_trait_id: NodeId }, Gen { span: Span, closure_id: NodeId, return_impl_trait_id: NodeId },
/// `async gen`, which returns an `impl AsyncIterator` /// `async gen`, which returns an `impl AsyncIterator`.
AsyncGen { span: Span, closure_id: NodeId, return_impl_trait_id: NodeId }, AsyncGen { span: Span, closure_id: NodeId, return_impl_trait_id: NodeId },
} }
@ -2749,7 +2749,7 @@ pub struct Variant {
pub data: VariantData, pub data: VariantData,
/// Explicit discriminant, e.g., `Foo = 1`. /// Explicit discriminant, e.g., `Foo = 1`.
pub disr_expr: Option<AnonConst>, pub disr_expr: Option<AnonConst>,
/// Is a macro placeholder /// Is a macro placeholder.
pub is_placeholder: bool, pub is_placeholder: bool,
} }
@ -3023,19 +3023,19 @@ pub fn opt_generics(&self) -> Option<&Generics> {
/// `extern` qualifier on a function item or function type. /// `extern` qualifier on a function item or function type.
#[derive(Clone, Copy, Encodable, Decodable, Debug)] #[derive(Clone, Copy, Encodable, Decodable, Debug)]
pub enum Extern { pub enum Extern {
/// No explicit extern keyword was used /// No explicit extern keyword was used.
/// ///
/// E.g. `fn foo() {}` /// E.g. `fn foo() {}`.
None, None,
/// An explicit extern keyword was used, but with implicit ABI /// An explicit extern keyword was used, but with implicit ABI.
/// ///
/// E.g. `extern fn foo() {}` /// E.g. `extern fn foo() {}`.
/// ///
/// This is just `extern "C"` (see `rustc_target::spec::abi::Abi::FALLBACK`) /// This is just `extern "C"` (see `rustc_target::spec::abi::Abi::FALLBACK`).
Implicit(Span), Implicit(Span),
/// An explicit extern keyword was used with an explicit ABI /// An explicit extern keyword was used with an explicit ABI.
/// ///
/// E.g. `extern "C" fn foo() {}` /// E.g. `extern "C" fn foo() {}`.
Explicit(StrLit, Span), Explicit(StrLit, Span),
} }
@ -3054,13 +3054,13 @@ pub fn from_abi(abi: Option<StrLit>, span: Span) -> Extern {
/// included in this struct (e.g., `async unsafe fn` or `const extern "C" fn`). /// included in this struct (e.g., `async unsafe fn` or `const extern "C" fn`).
#[derive(Clone, Copy, Encodable, Decodable, Debug)] #[derive(Clone, Copy, Encodable, Decodable, Debug)]
pub struct FnHeader { pub struct FnHeader {
/// Whether this is `unsafe`, or has a default safety /// Whether this is `unsafe`, or has a default safety.
pub safety: Safety, pub safety: Safety,
/// Whether this is `async`, `gen`, or nothing. /// Whether this is `async`, `gen`, or nothing.
pub coroutine_kind: Option<CoroutineKind>, pub coroutine_kind: Option<CoroutineKind>,
/// The `const` keyword, if any /// The `const` keyword, if any
pub constness: Const, pub constness: Const,
/// The `extern` keyword and corresponding ABI string, if any /// The `extern` keyword and corresponding ABI string, if any.
pub ext: Extern, pub ext: Extern,
} }
@ -3254,7 +3254,7 @@ pub enum ItemKind {
/// ///
/// E.g., `trait Foo { .. }`, `trait Foo<T> { .. }` or `auto trait Foo {}`. /// E.g., `trait Foo { .. }`, `trait Foo<T> { .. }` or `auto trait Foo {}`.
Trait(Box<Trait>), Trait(Box<Trait>),
/// Trait alias /// Trait alias.
/// ///
/// E.g., `trait Foo = Bar + Quux;`. /// E.g., `trait Foo = Bar + Quux;`.
TraitAlias(Generics, GenericBounds), TraitAlias(Generics, GenericBounds),