File tree 1 file changed +6
-3
lines changed
src/librustc_mir/transform
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -509,10 +509,13 @@ impl Qualif for IsNotPromotable {
509
509
}
510
510
511
511
/// Refers to temporaries which cannot be promoted *implicitly*.
512
- /// Explicit promotion e.g. for constant arguments declared via `rustc_args_required_const` or by
513
- /// happening inside a constant, static or const fn. Inside a const context all constness rules
512
+ /// Explicit promotion happens e.g. for constant arguments declared via `rustc_args_required_const`.
513
+ /// Inside a const context all constness rules
514
514
/// apply, so implicit promotion simply has to follow the regular constant rules (modulo interior
515
- /// mutability or `Drop` rules which are handled `HasMutInterior` and `NeedsDrop` respectively)
515
+ /// mutability or `Drop` rules which are handled `HasMutInterior` and `NeedsDrop` respectively).
516
+ /// Implicit promotion inside regular functions does not happen if `const fn` calls are involved,
517
+ /// as the call may be perfectly alright at runtime, but fail at compile time e.g. due to addresses
518
+ /// being compared inside the function.
516
519
struct IsNotImplicitlyPromotable ;
517
520
518
521
impl Qualif for IsNotImplicitlyPromotable {
You can’t perform that action at this time.
0 commit comments