Skip to content

Commit

Permalink
Update from review comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Aug 3, 2020
1 parent 2f459e2 commit da910b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/const_eval.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ to be run.
A _const context_ is one of the following:

* [Array type length expressions]
* [Array repeat expressions][array expressions]
* [Array repeat length expressions][array expressions]
* The initializer of
* [constants]
* [statics]
Expand Down
7 changes: 4 additions & 3 deletions src/items/constant-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
A *constant item* is an optionally named _[constant value]_ which is not associated
with a specific memory location in the program. Constants are essentially inlined
wherever they are used, meaning that they are copied directly into the relevant
context when used. This includes usage of constants from external crates.
References to the same constant are not necessarily guaranteed to refer to the
same memory address.
context when used. This includes usage of constants from external crates, and
non-[`Copy`] types. References to the same constant are not necessarily
guaranteed to refer to the same memory address.

Constants must be explicitly typed. The type must have a `'static` lifetime: any
references in the initializer must have `'static` lifetimes.
Expand Down Expand Up @@ -95,3 +95,4 @@ m!(const _: () = (););
[underscore imports]: use-declarations.md#underscore-imports
[_Type_]: ../types.md#type-expressions
[_Expression_]: ../expressions.md
[`Copy`]: ../special-types-and-traits.md#copy

0 comments on commit da910b7

Please sign in to comment.