diff options
| author | Alexander Regueiro <alexreg@me.com> | 2019-02-08 14:53:55 +0100 |
|---|---|---|
| committer | Alexander Regueiro <alexreg@me.com> | 2019-02-10 23:42:32 +0000 |
| commit | c3e182cf43aea2c010a1915eb37293a458df2228 (patch) | |
| tree | 225aa2dfceff56d10c0b31f6966fbf7ec5da8180 /src/libsyntax_ext | |
| parent | 0b7af2668a80fb2fa720a06ca44aff4dd1e9de38 (diff) | |
| download | rust-c3e182cf43aea2c010a1915eb37293a458df2228.tar.gz rust-c3e182cf43aea2c010a1915eb37293a458df2228.zip | |
rustc: doc comments
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/deriving/decodable.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax_ext/deriving/encodable.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax_ext/deriving/generic/mod.rs | 16 | ||||
| -rw-r--r-- | src/libsyntax_ext/format.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax_ext/format_foreign.rs | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/src/libsyntax_ext/deriving/decodable.rs b/src/libsyntax_ext/deriving/decodable.rs index b082351d5f6..d773f3ff7bc 100644 --- a/src/libsyntax_ext/deriving/decodable.rs +++ b/src/libsyntax_ext/deriving/decodable.rs @@ -165,7 +165,7 @@ fn decodable_substructure(cx: &mut ExtCtxt<'_>, }; } -/// Create a decoder for a single enum variant/struct: +/// Creates a decoder for a single enum variant/struct: /// - `outer_pat_path` is the path to this enum variant/struct /// - `getarg` should retrieve the `usize`-th field with name `@str`. fn decode_static_fields<F>(cx: &mut ExtCtxt<'_>, diff --git a/src/libsyntax_ext/deriving/encodable.rs b/src/libsyntax_ext/deriving/encodable.rs index dd5646342b3..faaedba3e77 100644 --- a/src/libsyntax_ext/deriving/encodable.rs +++ b/src/libsyntax_ext/deriving/encodable.rs @@ -1,5 +1,5 @@ //! The compiler code necessary to implement the `#[derive(Encodable)]` -//! (and `Decodable`, in decodable.rs) extension. The idea here is that +//! (and `Decodable`, in `decodable.rs`) extension. The idea here is that //! type-defining items may be tagged with `#[derive(Encodable, Decodable)]`. //! //! For example, a type like: @@ -37,7 +37,7 @@ //! ``` //! //! Other interesting scenarios are when the item has type parameters or -//! references other non-built-in types. A type definition like: +//! references other non-built-in types. A type definition like: //! //! ``` //! # #[derive(Encodable, Decodable)] struct Span; diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs index 4678c752045..b8f96c5bc0e 100644 --- a/src/libsyntax_ext/deriving/generic/mod.rs +++ b/src/libsyntax_ext/deriving/generic/mod.rs @@ -243,7 +243,7 @@ pub struct MethodDef<'a> { /// Arguments other than the self argument pub args: Vec<(Ty<'a>, &'a str)>, - /// Return type + /// Returns type pub ret_ty: Ty<'a>, pub attributes: Vec<ast::Attribute>, @@ -303,7 +303,7 @@ pub enum SubstructureFields<'a> { EnumMatching(usize, usize, &'a ast::Variant, Vec<FieldInfo<'a>>), /// Non-matching variants of the enum, but with all state hidden from - /// the consequent code. The first component holds `Ident`s for all of + /// the consequent code. The first component holds `Ident`s for all of /// the `Self` arguments; the second component is a slice of all of the /// variants for the enum itself, and the third component is a list of /// `Ident`s bound to the variant index values for each of the actual @@ -323,10 +323,10 @@ pub enum SubstructureFields<'a> { pub type CombineSubstructureFunc<'a> = Box<dyn FnMut(&mut ExtCtxt<'_>, Span, &Substructure<'_>) -> P<Expr> + 'a>; -/// Deal with non-matching enum variants. The tuple is a list of +/// Deal with non-matching enum variants. The tuple is a list of /// identifiers (one for each `Self` argument, which could be any of the /// variants since they have been collapsed together) and the identifiers -/// holding the variant index value for each of the `Self` arguments. The +/// holding the variant index value for each of the `Self` arguments. The /// last argument is all the non-`Self` args of the method being derived. pub type EnumNonMatchCollapsedFunc<'a> = Box<dyn FnMut(&mut ExtCtxt<'_>, Span, (&[Ident], &[Ident]), &[P<Expr>]) -> P<Expr> + 'a>; @@ -497,7 +497,7 @@ impl<'a> TraitDef<'a> { /// create an impl like: /// /// ```ignore (only-for-syntax-highlight) - /// impl<'a, ..., 'z, A, B: DeclaredTrait, C, ... Z> where + /// impl<'a, ..., 'z, A, B: DeclaredTrait, C, ... Z> where /// C: WhereTrait, /// A: DerivedTrait + B1 + ... + BN, /// B: DerivedTrait + B1 + ... + BN, @@ -1126,7 +1126,7 @@ impl<'a> MethodDef<'a> { /// /// (Of course `__self_vi` and `__arg_1_vi` are unused for /// `PartialEq`, and those subcomputations will hopefully be removed - /// as their results are unused. The point of `__self_vi` and + /// as their results are unused. The point of `__self_vi` and /// `__arg_1_vi` is for `PartialOrd`; see #15503.) fn expand_enum_method_body<'b>(&self, cx: &mut ExtCtxt<'_>, @@ -1724,7 +1724,7 @@ pub fn cs_fold<F>(use_foldl: bool, /// Function to fold over fields, with three cases, to generate more efficient and concise code. /// When the `substructure` has grouped fields, there are two cases: -/// Zero fields: call the base case function with None (like the usual base case of `cs_fold`). +/// Zero fields: call the base case function with `None` (like the usual base case of `cs_fold`). /// One or more fields: call the base case function on the first value (which depends on /// `use_fold`), and use that as the base case. Then perform `cs_fold` on the remainder of the /// fields. @@ -1815,7 +1815,7 @@ pub fn cs_same_method<F>(f: F, } } -/// Return true if the type has no value fields +/// Returns `true` if the type has no value fields /// (for an enum, no variant has any fields) pub fn is_type_without_fields(item: &Annotatable) -> bool { if let Annotatable::Item(ref item) = *item { diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index 6bb7ee1d5dd..798951406a5 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -424,7 +424,7 @@ impl<'a, 'b> Context<'a, 'b> { self.ecx.expr_str(sp, s) } - /// Build a static `rt::Argument` from a `parse::Piece` or append + /// Builds a static `rt::Argument` from a `parse::Piece` or append /// to the `literal` string. fn build_piece(&mut self, piece: &parse::Piece<'_>, @@ -545,7 +545,7 @@ impl<'a, 'b> Context<'a, 'b> { } /// Actually builds the expression which the format_args! block will be - /// expanded to + /// expanded to. fn into_expr(self) -> P<ast::Expr> { let mut locals = Vec::with_capacity( (0..self.args.len()).map(|i| self.arg_unique_types[i].len()).sum() @@ -788,7 +788,7 @@ pub fn expand_preparsed_format_args(ecx: &mut ExtCtxt<'_>, }, }; - /// Find the indices of all characters that have been processed and differ between the actual + /// Finds the indices of all characters that have been processed and differ between the actual /// written code (code snippet) and the `InternedString` that get's processed in the `Parser` /// in order to properly synthethise the intra-string `Span`s for error diagnostics. fn find_skips(snippet: &str, is_raw: bool) -> Vec<usize> { diff --git a/src/libsyntax_ext/format_foreign.rs b/src/libsyntax_ext/format_foreign.rs index 381325b2963..261b2f373ce 100644 --- a/src/libsyntax_ext/format_foreign.rs +++ b/src/libsyntax_ext/format_foreign.rs @@ -718,7 +718,7 @@ pub mod printf { ); } - /// Check that the translations are what we expect. + /// Checks that the translations are what we expect. #[test] fn test_translation() { assert_eq_pnsat!("%c", Some("{}")); |
