@@ -10,9 +10,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
10
10
/// Returns an operand suitable for use until the end of the current
11
11
/// scope expression.
12
12
///
13
- /// The operand returned from this function will *not be valid* after
14
- /// an ExprKind::Scope is passed, so please do *not* return it from
15
- /// functions to avoid bad miscompiles.
13
+ /// The operand returned from this function will *not be valid*
14
+ /// after the current enclosing `ExprKind::Scope` has ended, so
15
+ /// please do *not* return it from functions to avoid bad
16
+ /// miscompiles.
16
17
crate fn as_local_operand < M > ( & mut self , block : BasicBlock , expr : M ) -> BlockAnd < Operand < ' tcx > >
17
18
where
18
19
M : Mirror < ' tcx , Output = Expr < ' tcx > > ,
@@ -30,8 +31,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
30
31
/// `as_operand`, except for the particular case of passing values of (potentially) unsized
31
32
/// types "by value" (see details below).
32
33
///
33
- /// As with `as_operand`, the operand returned from this function will *not be valid* after an
34
- /// `ExprKind::Scope` is passed, so do not return it from functions.
34
+ /// The operand returned from this function will *not be valid*
35
+ /// after the current enclosing `ExprKind::Scope` has ended, so
36
+ /// please do *not* return it from functions to avoid bad
37
+ /// miscompiles.
35
38
///
36
39
/// # Parameters of unsized types
37
40
///
@@ -98,6 +101,8 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
98
101
self . expr_as_operand ( block, scope, expr)
99
102
}
100
103
104
+ /// Like `as_local_call_operand`, except that the argument will
105
+ /// not be valid once `scope` ends.
101
106
fn as_call_operand < M > (
102
107
& mut self ,
103
108
block : BasicBlock ,
0 commit comments