Skip to content

Commit

Permalink
Documentation should have proper grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Apr 10, 2019
1 parent ae4717d commit f10394a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/librustc_mir/transform/qualify_consts.rs
Expand Up @@ -509,10 +509,13 @@ impl Qualif for IsNotPromotable {
} }


/// Refers to temporaries which cannot be promoted *implicitly*. /// Refers to temporaries which cannot be promoted *implicitly*.
/// Explicit promotion e.g. for constant arguments declared via `rustc_args_required_const` or by /// Explicit promotion happens e.g. for constant arguments declared via `rustc_args_required_const`.
/// happening inside a constant, static or const fn. Inside a const context all constness rules /// Inside a const context all constness rules
/// apply, so implicit promotion simply has to follow the regular constant rules (modulo interior /// apply, so implicit promotion simply has to follow the regular constant rules (modulo interior
/// mutability or `Drop` rules which are handled `HasMutInterior` and `NeedsDrop` respectively) /// mutability or `Drop` rules which are handled `HasMutInterior` and `NeedsDrop` respectively).
/// Implicit promotion inside regular functions does not happen if `const fn` calls are involved,
/// as the call may be perfectly alright at runtime, but fail at compile time e.g. due to addresses
/// being compared inside the function.
struct IsNotImplicitlyPromotable; struct IsNotImplicitlyPromotable;


impl Qualif for IsNotImplicitlyPromotable { impl Qualif for IsNotImplicitlyPromotable {
Expand Down

0 comments on commit f10394a

Please sign in to comment.