Skip to content

Commit 7744dfa

Browse files
authored
Merge pull request rust-lang#1166 from eholk/const-fn-stabilization
Update const_eval.md for feature stabilization
2 parents 785325f + 806370f commit 7744dfa

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/const_eval.md

+3-7
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,15 +84,11 @@ 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.
92-
* `dyn Trait` types
93-
* generic bounds on generic parameters beyond `Sized`
94-
* comparing raw pointers
95-
* union field access
9692

9793
Conversely, the following are possible in a const function, but not in a const context:
9894

0 commit comments

Comments
 (0)