Skip to content

Commit

Permalink
tweak comments
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Apr 20, 2020
1 parent 365807f commit 4e53a9a
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/librustc_mir_build/build/expr/as_operand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>>,
Expand All @@ -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
///
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 4e53a9a

Please sign in to comment.