about summary refs log tree commit diff
path: root/src/librustc_passes
diff options
context:
space:
mode:
authorAlexander Regueiro <alexreg@me.com>2019-02-08 14:53:55 +0100
committerAlexander Regueiro <alexreg@me.com>2019-02-10 23:42:32 +0000
commitc3e182cf43aea2c010a1915eb37293a458df2228 (patch)
tree225aa2dfceff56d10c0b31f6966fbf7ec5da8180 /src/librustc_passes
parent0b7af2668a80fb2fa720a06ca44aff4dd1e9de38 (diff)
downloadrust-c3e182cf43aea2c010a1915eb37293a458df2228.tar.gz
rust-c3e182cf43aea2c010a1915eb37293a458df2228.zip
rustc: doc comments
Diffstat (limited to 'src/librustc_passes')
-rw-r--r--src/librustc_passes/ast_validation.rs30
-rw-r--r--src/librustc_passes/rvalue_promotion.rs8
2 files changed, 19 insertions, 19 deletions
diff --git a/src/librustc_passes/ast_validation.rs b/src/librustc_passes/ast_validation.rs
index a391a316312..bf5514c5335 100644
--- a/src/librustc_passes/ast_validation.rs
+++ b/src/librustc_passes/ast_validation.rs
@@ -181,21 +181,21 @@ impl<'a> AstValidator<'a> {
         }
     }
 
-    /// matches '-' lit | lit (cf. parser::Parser::parse_literal_maybe_minus),
-    /// or path for ranges.
-    ///
-    /// FIXME: do we want to allow expr -> pattern conversion to create path expressions?
-    /// That means making this work:
-    ///
-    /// ```rust,ignore (FIXME)
-    ///     struct S;
-    ///     macro_rules! m {
-    ///         ($a:expr) => {
-    ///             let $a = S;
-    ///         }
-    ///     }
-    ///     m!(S);
-    /// ```
+    /// Matches `'-' lit | lit (cf. parser::Parser::parse_literal_maybe_minus)`,
+    /// or paths for ranges.
+    //
+    // FIXME: do we want to allow `expr -> pattern` conversion to create path expressions?
+    // That means making this work:
+    //
+    // ```rust,ignore (FIXME)
+    // struct S;
+    // macro_rules! m {
+    //     ($a:expr) => {
+    //         let $a = S;
+    //     }
+    // }
+    // m!(S);
+    // ```
     fn check_expr_within_pat(&self, expr: &Expr, allow_paths: bool) {
         match expr.node {
             ExprKind::Lit(..) => {}
diff --git a/src/librustc_passes/rvalue_promotion.rs b/src/librustc_passes/rvalue_promotion.rs
index 8d33fef5303..50e80eb5a29 100644
--- a/src/librustc_passes/rvalue_promotion.rs
+++ b/src/librustc_passes/rvalue_promotion.rs
@@ -160,11 +160,11 @@ impl<'a, 'gcx> CheckCrateVisitor<'a, 'gcx> {
     }
 
     /// While the `ExprUseVisitor` walks, we will identify which
-    /// expressions are borrowed, and insert their ids into this
+    /// expressions are borrowed, and insert their IDs into this
     /// table. Actually, we insert the "borrow-id", which is normally
-    /// the id of the expression being borrowed: but in the case of
+    /// the ID of the expression being borrowed: but in the case of
     /// `ref mut` borrows, the `id` of the pattern is
-    /// inserted. Therefore later we remove that entry from the table
+    /// inserted. Therefore, later we remove that entry from the table
     /// and transfer it over to the value being matched. This will
     /// then prevent said value from being promoted.
     fn remove_mut_rvalue_borrow(&mut self, pat: &hir::Pat) -> bool {
@@ -588,7 +588,7 @@ fn check_expr_kind<'a, 'tcx>(
     ty_result & node_result
 }
 
-/// Check the adjustments of an expression
+/// Checks the adjustments of an expression.
 fn check_adjustments<'a, 'tcx>(
     v: &mut CheckCrateVisitor<'a, 'tcx>,
     e: &hir::Expr) -> Promotability {