Skip to content

Commit

Permalink
Don't implicitly talk about free constant CTFE timing
Browse files Browse the repository at this point in the history
@RalfJung pointed out in a [comment] that the previous phrasing of the
sentence can read like it is giving guarantees about free constant
definitions always undergoing CTFE, even when unused. That seems to be
how the compiler behaves right now, but it's unclear whether it's
intentional.

Be more precise and don't talk about free constants at all.

[comment]: rust-lang#1120 (comment)
  • Loading branch information
XrXr committed Jan 27, 2022
1 parent 2aec62f commit cf06f4a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/items/associated-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ type that the definition has to implement.
An *associated constant definition* defines a constant associated with a
type. It is written the same as a [constant item].

Unlike [free] constants, associated constant definitions undergo
[constant evaluation] only when referenced.
Associated constant definitions undergo [constant evaluation] only when
referenced.

```rust
struct Struct;
Expand Down Expand Up @@ -381,5 +381,4 @@ fn main() {
[regular function parameters]: functions.md#attributes-on-function-parameters
[generic parameters]: generics.md
[where clauses]: generics.md#where-clauses
[free]: ../glossary.md#free-item
[constant evaluation]: ../const_eval.md

0 comments on commit cf06f4a

Please sign in to comment.