Skip to content

Define promotion contexts and promotability #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Oct 22, 2019
Prev Previous commit
Next Next commit
Fix typos
  • Loading branch information
ecstatic-morse authored Oct 11, 2019
commit 3d2f41a77cccc7a7638c87793384db74abef7314
4 changes: 2 additions & 2 deletions promotion.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ non-`Copy` types to be initialized idiomatically, for example

### `#[rustc_args_required_const(...)]`

Additionally, some platform intrinsics require certain operations to be
Additionally, some platform intrinsics require certain parameters to be
immediates (known at compile-time). We use the `#[rustc_args_required_const]`
attribute, introduced in
[rust-lang/rust#48018](https://github.com/rust-lang/rust/pull/48018), to
Expand Down Expand Up @@ -76,7 +76,7 @@ implicit context are a superset of the ones in an explicit context.

We defined above that promotion guarantees that code in a non-const context
will be executed at compile-time. However, lifetime extension and non-`Copy`
array initialziation are useful features *inside* `const`s and `static`s as
array initialization are useful features *inside* `const`s and `static`s as
well. Strictly speaking, the transformation used to enable these features
inside a const-context is not promotion; no `promoted`s are created in the MIR.
However the same rules for promotability are used with one modification:
Expand Down