Skip to content

Commit f10394a

Browse files
committed
Documentation should have proper grammar
1 parent ae4717d commit f10394a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/librustc_mir/transform/qualify_consts.rs

+6-3
Original file line numberDiff line numberDiff 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.
516519
struct IsNotImplicitlyPromotable;
517520

518521
impl Qualif for IsNotImplicitlyPromotable {

0 commit comments

Comments
 (0)