Skip to content

Commit ae4717d

Browse files
committed
Elaborate on implicit promotability
1 parent c63b9ff commit ae4717d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc_mir/transform/qualify_consts.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,10 @@ 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`.
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
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)
513516
struct IsNotImplicitlyPromotable;
514517

515518
impl Qualif for IsNotImplicitlyPromotable {

0 commit comments

Comments
 (0)