about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2020-04-20 09:41:54 +0000
committerNiko Matsakis <niko@alum.mit.edu>2020-04-20 09:42:14 +0000
commit4e53a9af4725222a617900aac0680f1a472255ec (patch)
tree911abdb209e195ea1572579890d1866890103a8b
parent365807f0576b719ba9af6b4f724bb5f133ea81ac (diff)
downloadrust-4e53a9af4725222a617900aac0680f1a472255ec.tar.gz
rust-4e53a9af4725222a617900aac0680f1a472255ec.zip
tweak comments
-rw-r--r--src/librustc_mir_build/build/expr/as_operand.rs15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/librustc_mir_build/build/expr/as_operand.rs b/src/librustc_mir_build/build/expr/as_operand.rs
index 5216d305ffb..9a75f3afe8f 100644
--- a/src/librustc_mir_build/build/expr/as_operand.rs
+++ b/src/librustc_mir_build/build/expr/as_operand.rs
@@ -10,9 +10,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
     /// Returns an operand suitable for use until the end of the current
     /// scope expression.
     ///
-    /// The operand returned from this function will *not be valid* after
-    /// an ExprKind::Scope is passed, so please do *not* return it from
-    /// functions to avoid bad miscompiles.
+    /// The operand returned from this function will *not be valid*
+    /// after the current enclosing `ExprKind::Scope` has ended, so
+    /// please do *not* return it from functions to avoid bad
+    /// miscompiles.
     crate fn as_local_operand<M>(&mut self, block: BasicBlock, expr: M) -> BlockAnd<Operand<'tcx>>
     where
         M: Mirror<'tcx, Output = Expr<'tcx>>,
@@ -30,8 +31,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
     /// `as_operand`, except for the particular case of passing values of (potentially) unsized
     /// types "by value" (see details below).
     ///
-    /// As with `as_operand`, the operand returned from this function will *not be valid* after an
-    /// `ExprKind::Scope` is passed, so do not return it from functions.
+    /// The operand returned from this function will *not be valid*
+    /// after the current enclosing `ExprKind::Scope` has ended, so
+    /// please do *not* return it from functions to avoid bad
+    /// miscompiles.
     ///
     /// # Parameters of unsized types
     ///
@@ -98,6 +101,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
         self.expr_as_operand(block, scope, expr)
     }
 
+    /// Like `as_local_call_operand`, except that the argument will
+    /// not be valid once `scope` ends.
     fn as_call_operand<M>(
         &mut self,
         block: BasicBlock,