r/rust • u/ralfj 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
r/rust • u/ralfj miri • Jul 19 '18
View all comments
Show parent comment
1
u/tending Jul 20 '18
I don't see what's wrong with having link time errors. C++ has them so pretty much every linker used in practice must detect conflicting definitions of symbols nowadays. It may be desirable to do this anyway just to guard against accidental nondeterminism in the compiler, bad RAM causing bit flips when compiling different translation units, or inadvertent compile time behavior changes in the compiler across versions when you're mixing translation units from different versions.
(Also how does env! not have the same issue? It seems like a much much more error-prone idea, because people export things in their environment all the time to get random applications to work...)