Skip to content

Commit 4641e23

Browse files
committed
adjust the document to the sad reality
1 parent 91e223c commit 4641e23

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

promotion.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ promotion.
9898
Currently, the following are considered explicit promotion contexts:
9999
* `#[rustc_args_required_const]` arguments
100100
* lifetime extension in the bodies of `const` and `static` items and array lengths
101+
* the bodies of `const fn` -- but this is not justified by the above discussion; since `const fn` can be runtime-evaluated, the concerns about introducing hard errors where there would be none apply for `const fn` in exactly the same way as for `fn`, but this was overlooked when implementing the checks
101102

102-
Everything else is an implicit promotion context, including `const fn` bodies and non-`Copy` array initializers.
103+
Everything else is an implicit promotion context, in particular non-`Copy` array initializers.
103104

104105
In an explicit promotion context, we consider almost everything promotable,
105106
subject to the usual restrictions of [consts](const.md). This means that

0 commit comments

Comments
 (0)