From da910b725a59ba9bb32c6954074f377589a2a689 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Mon, 3 Aug 2020 10:37:52 -0700 Subject: [PATCH] Update from review comments. --- src/const_eval.md | 2 +- src/items/constant-items.md | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/const_eval.md b/src/const_eval.md index 3f6604d0c..2c4fbe9ba 100644 --- a/src/const_eval.md +++ b/src/const_eval.md @@ -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] diff --git a/src/items/constant-items.md b/src/items/constant-items.md index b6cf2bb7e..3d8834fe8 100644 --- a/src/items/constant-items.md +++ b/src/items/constant-items.md @@ -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. @@ -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