r/rust • miri • Jul 19 '18

Thoughts on Compile-Time Function Evaluation and Type Systems

https://www.ralfj.de/blog/2018/07/19/const.html
73 Upvotes

63 comments sorted by

View all comments

3

u/Shnatsel Jul 19 '18

Could anyone link me some reading on the use cases for CTFE and why const propagation alone is insufficient for them?

2

u/eddyb Jul 20 '18

Anything where the constant is used in the typesystem, e.g. [u8; size_of::<String>()] (try it, it works today!).

1

u/Shnatsel Jul 20 '18

HELL YEAH AT LAST

I can dehardcode some magic bitfield-related constants now! Yay!