Closed dwrensha closed 5 years ago
To catch these errors during type-checking we have to change how we do intrinsics and that's a bit tricky.
Is the tricky part the platform dependence? Some intrinsics for specific types work only on selected platforms?
Nah, it's about changing intrinsics from abusing FFI to annotating free functions and methods instead.
Consider the following program:
When I try to run
test.rs
withrustc
, I get a monomorphization error:However, when I run
test.rs
withmiri
, I expect to see a similar error, but instead the program finishes successfully:A possible solution might be to add some typechecking in intrinsic.rs to match the logic in rustc_trans::intrinsic.
It would be even better if rustc could somehow catch these errors during typechecking, so that miri could inherit the error handling.