Skip to content

Commit f5c4238

Browse files
committed
update
1 parent fa978e8 commit f5c4238

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

draft-rfcs/const-evaluatable-checked.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ TODO: All of this :)
44

55
## Requirements
66

7-
For this to work, const operations have to be both pure and deterministic, at least when they are used in the type system.
7+
For this to work, const operations have to be both pure and deterministic,
8+
at least when they are used in the type system.
89

9-
FIXME: const allocations?
10-
FIXME: non-det floats, are they are problem? We use `ap_float` which is hopefully deterministic.
11-
FIXME: looking at pointers.
12-
TODO: let `const-eval` figure this out.
10+
Using floats during CTFE is fully determinstic. So using
11+
them inside of the type system is fine. CTFE can however
12+
produce different results than what would happen on real hardware,
13+
but this is not a concern for const generics.
14+
15+
Other sources of non-determinism are allocations. This non-determinism
16+
must however not be observed during const-evaluation (TODO: link to const-eval)
17+
and is only an issue if allocations leaked into the result. This
18+
will be prevented by using [val-trees](https://github.com/rust-lang/rust/issues/72396).

0 commit comments

Comments
 (0)