@@ -65,8 +65,8 @@ A _const context_ is one of the following:
65
65
66
66
A _ const fn_ is a function that one is permitted to call from a const context. Declaring a function
67
67
` 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.
70
70
71
71
When called from a const context, the function is interpreted by the
72
72
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
84
84
discriminants depend on floating point computations.
85
85
86
86
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 :
88
88
89
89
* floating point operations
90
90
* floating point values are treated just like generic parameters without trait bounds beyond
91
91
` 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
96
92
97
93
Conversely, the following are possible in a const function, but not in a const context:
98
94
0 commit comments