mrustc compatible with Rust 1.54
mrustc compatible with Rust 1.54
Posted Nov 24, 2024 15:43 UTC (Sun) by ralfj (subscriber, #172874)In reply to: mrustc compatible with Rust 1.54 by gmatht
Parent article: NonStop discussion around adding Rust to Git
I don't actually know what current Rust-to-C transpilers do in these cases. I assume they just generate C code with UB and hope for the best...
Posted Nov 26, 2024 5:18 UTC (Tue)
by NYKevin (subscriber, #129325)
[Link]
Yes, you lose provenance. No, that is not UB under any version of C that I've ever heard of. The standard explicitly provides that we are allowed to round-trip through at least char*, and intptr_t if it exists. If that breaks provenance, oh well, your implementation is just expected to deal with it anyway.
There probably is a performance cost to doing this. But IMHO it's acceptable if the alternative is "I can't run this code at all."
mrustc compatible with Rust 1.54