about summary refs log tree commit diff
path: root/src/libsyntax_ext
diff options
context:
space:
mode:
authorAlexander Regueiro <alexreg@me.com>2018-11-27 02:59:49 +0000
committerAlexander Regueiro <alexreg@me.com>2018-12-07 23:53:34 +0000
commitee89c088b057affb5bdb96195e107a218b64b1c5 (patch)
treee9e578d5bf6081b4ed47035e2793ad4c29b65e02 /src/libsyntax_ext
parent4a45578bc58ff262864f72680cc02e83f5d2f5b3 (diff)
downloadrust-ee89c088b057affb5bdb96195e107a218b64b1c5.tar.gz
rust-ee89c088b057affb5bdb96195e107a218b64b1c5.zip
Various minor/cosmetic improvements to code
Diffstat (limited to 'src/libsyntax_ext')
-rw-r--r--src/libsyntax_ext/deriving/cmp/partial_ord.rs2
-rw-r--r--src/libsyntax_ext/deriving/generic/mod.rs18
-rw-r--r--src/libsyntax_ext/deriving/generic/ty.rs2
-rw-r--r--src/libsyntax_ext/format.rs2
-rw-r--r--src/libsyntax_ext/test.rs2
5 files changed, 13 insertions, 13 deletions
diff --git a/src/libsyntax_ext/deriving/cmp/partial_ord.rs b/src/libsyntax_ext/deriving/cmp/partial_ord.rs
index 32a58de3529..196cfa5fe35 100644
--- a/src/libsyntax_ext/deriving/cmp/partial_ord.rs
+++ b/src/libsyntax_ext/deriving/cmp/partial_ord.rs
@@ -227,7 +227,7 @@ fn cs_op(less: bool,
     let fold = cs_fold1(false, // need foldr
         |cx, span, subexpr, self_f, other_fs| {
             // build up a series of `partial_cmp`s from the inside
-            // out (hence foldr) to get lexical ordering, i.e. for op ==
+            // out (hence foldr) to get lexical ordering, i.e., for op ==
             // `ast::lt`
             //
             // ```
diff --git a/src/libsyntax_ext/deriving/generic/mod.rs b/src/libsyntax_ext/deriving/generic/mod.rs
index c0c11f64bc3..443fd48120e 100644
--- a/src/libsyntax_ext/deriving/generic/mod.rs
+++ b/src/libsyntax_ext/deriving/generic/mod.rs
@@ -18,7 +18,7 @@
 //! - Methods taking any number of parameters of any type, and returning
 //!   any type, other than vectors, bottom and closures.
 //! - Generating `impl`s for types with type parameters and lifetimes
-//!   (e.g. `Option<T>`), the parameters are automatically given the
+//!   (e.g., `Option<T>`), the parameters are automatically given the
 //!   current trait as a bound. (This includes separate type parameters
 //!   and lifetimes for methods.)
 //! - Additional bounds on the type parameters (`TraitDef.additional_bounds`)
@@ -30,9 +30,9 @@
 //! - `Struct`, when `Self` is a struct (including tuple structs, e.g
 //!   `struct T(i32, char)`).
 //! - `EnumMatching`, when `Self` is an enum and all the arguments are the
-//!   same variant of the enum (e.g. `Some(1)`, `Some(3)` and `Some(4)`)
+//!   same variant of the enum (e.g., `Some(1)`, `Some(3)` and `Some(4)`)
 //! - `EnumNonMatchingCollapsed` when `Self` is an enum and the arguments
-//!   are not the same variant (e.g. `None`, `Some(1)` and `None`).
+//!   are not the same variant (e.g., `None`, `Some(1)` and `None`).
 //! - `StaticEnum` and `StaticStruct` for static methods, where the type
 //!   being derived upon is either an enum or struct respectively. (Any
 //!   argument with type Self is just grouped among the non-self
@@ -224,7 +224,7 @@ pub struct TraitDef<'a> {
     /// other than the current trait
     pub additional_bounds: Vec<Ty<'a>>,
 
-    /// Any extra lifetimes and/or bounds, e.g. `D: serialize::Decoder`
+    /// Any extra lifetimes and/or bounds, e.g., `D: serialize::Decoder`
     pub generics: LifetimeBounds<'a>,
 
     /// Is it an `unsafe` trait?
@@ -242,10 +242,10 @@ pub struct TraitDef<'a> {
 pub struct MethodDef<'a> {
     /// name of the method
     pub name: &'a str,
-    /// List of generics, e.g. `R: rand::Rng`
+    /// List of generics, e.g., `R: rand::Rng`
     pub generics: LifetimeBounds<'a>,
 
-    /// Whether there is a self argument (outer Option) i.e. whether
+    /// Whether there is a self argument (outer Option) i.e., whether
     /// this is a static function, and whether it is a pointer (inner
     /// Option)
     pub explicit_self: Option<Option<PtrTy<'a>>>,
@@ -1371,7 +1371,7 @@ impl<'a> MethodDef<'a> {
             // that type.  Otherwise casts to `i32` (the default repr
             // type).
             //
-            // i.e. for `enum E<T> { A, B(1), C(T, T) }`, and a deriving
+            // i.e., for `enum E<T> { A, B(1), C(T, T) }`, and a deriving
             // with three Self args, builds three statements:
             //
             // ```
@@ -1489,8 +1489,8 @@ impl<'a> MethodDef<'a> {
             //
             // (See also #4499 and #12609; note that some of the
             // discussions there influence what choice we make here;
-            // e.g. if we feature-gate `match x { ... }` when x refers
-            // to an uninhabited type (e.g. a zero-variant enum or a
+            // e.g., if we feature-gate `match x { ... }` when x refers
+            // to an uninhabited type (e.g., a zero-variant enum or a
             // type holding such an enum), but do not feature-gate
             // zero-variant enums themselves, then attempting to
             // derive Debug on such a type could here generate code
diff --git a/src/libsyntax_ext/deriving/generic/ty.rs b/src/libsyntax_ext/deriving/generic/ty.rs
index fa284f4ab0e..11689a98a79 100644
--- a/src/libsyntax_ext/deriving/generic/ty.rs
+++ b/src/libsyntax_ext/deriving/generic/ty.rs
@@ -32,7 +32,7 @@ pub enum PtrTy<'a> {
     Raw(ast::Mutability),
 }
 
-/// A path, e.g. `::std::option::Option::<i32>` (global). Has support
+/// A path, e.g., `::std::option::Option::<i32>` (global). Has support
 /// for type parameters and a lifetime.
 #[derive(Clone)]
 pub struct Path<'a> {
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs
index 31e608de1f8..24108a30fdc 100644
--- a/src/libsyntax_ext/format.rs
+++ b/src/libsyntax_ext/format.rs
@@ -209,7 +209,7 @@ fn parse_args(ecx: &mut ExtCtxt,
 impl<'a, 'b> Context<'a, 'b> {
     fn resolve_name_inplace(&self, p: &mut parse::Piece) {
         // NOTE: the `unwrap_or` branch is needed in case of invalid format
-        // arguments, e.g. `format_args!("{foo}")`.
+        // arguments, e.g., `format_args!("{foo}")`.
         let lookup = |s| *self.names.get(s).unwrap_or(&0);
 
         match *p {
diff --git a/src/libsyntax_ext/test.rs b/src/libsyntax_ext/test.rs
index b8a171b52ad..1f2e6fc81c8 100644
--- a/src/libsyntax_ext/test.rs
+++ b/src/libsyntax_ext/test.rs
@@ -318,7 +318,7 @@ fn has_test_signature(cx: &ExtCtxt, i: &ast::Item) -> bool {
 
 fn has_bench_signature(cx: &ExtCtxt, i: &ast::Item) -> bool {
     let has_sig = if let ast::ItemKind::Fn(ref decl, _, _, _) = i.node {
-        // NB: inadequate check, but we're running
+        // N.B., inadequate check, but we're running
         // well before resolve, can't get too deep.
         decl.inputs.len() == 1
     } else {