File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/librustc_mir/transform Expand file tree Collapse file tree 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 {
509509}
510510
511511/// 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
514514/// 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.
516519struct IsNotImplicitlyPromotable ;
517520
518521impl Qualif for IsNotImplicitlyPromotable {
You can’t perform that action at this time.
0 commit comments