Skip to content

Commit 27dabb2

Browse files
committed
Update const_eval.md for feature stabilization
We are in the process of stabilizing `const_fn_fn_ptr_basics` and `const_fn_trait_bound`. This edit updates const_eval.md to reflect the new capabilities after stabilizing these features.
1 parent 039e1a7 commit 27dabb2

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/const_eval.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ A _const context_ is one of the following:
6565

6666
A _const fn_ is a function that one is permitted to call from a const context. Declaring a function
6767
`const` has no effect on any existing uses, it only restricts the types that arguments and the
68-
return type may use, as well as prevent various expressions from being used within it. You can freely do anything with a const function that
69-
you can do with a regular function.
68+
return type may use, as well as prevent various expressions from being used within it. You can freely
69+
do anything with a const function that you can do with a regular function.
7070

7171
When called from a const context, the function is interpreted by the
7272
compiler at compile time. The interpretation happens in the
@@ -84,13 +84,12 @@ slightly) different results. It is advisable to not make array lengths and enum
8484
discriminants depend on floating point computations.
8585

8686

87-
Notable features that const contexts have, but const fn haven't are:
87+
Notable features that are allowed in const contexts but not in const functions include:
8888

8989
* floating point operations
9090
* floating point values are treated just like generic parameters without trait bounds beyond
9191
`Copy`. So you cannot do anything with them but copy/move them around.
9292
* `dyn Trait` types
93-
* generic bounds on generic parameters beyond `Sized`
9493
* comparing raw pointers
9594
* union field access
9695

0 commit comments

Comments
 (0)