-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compiler: die immediately instead of handling unknown target codegen #136833
compiler: die immediately instead of handling unknown target codegen #136833
Conversation
We cannot produce anything useful if asked to compile unknown targets. We should handle the error immediately at the point of discovery instead of propagating it upward, and preferably in the simplest way: Die. This allows cleaning up our "error-handling" spread across 5 crates.
Some changes occurred to the CTFE machinery cc @rust-lang/wg-const-eval Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri Some changes occurred to the CTFE / Miri interpreter cc @rust-lang/miri, @rust-lang/wg-const-eval |
For more on why we should do this, I defer to https://burntsushi.net/unwrap/ as it is essentially the same problem. |
also so far I haven't found a test that is diffed by this which suggests it never happens in our test suite, which means we just had a pile of untested code anyways. |
This comment has been minimized.
This comment has been minimized.
Some changes occurred in compiler/rustc_codegen_gcc |
/// An error occurred during FnAbi computation: the passed --target lacks FFI support | ||
/// (which unfortunately typeck does not reject). | ||
/// Not using `FnAbiError` as that contains a nested `LayoutError`. | ||
FnAbiAdjustForForeignAbi(rustc_target::callconv::AdjustForForeignAbiError), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Definitely happy to see this one go :)
I'm happy with turning this into a fatal or a delayed bug later on if we ever find a way to trigger this panic. |
r=me if CI ends up green |
@bors r=compiler-errors |
…be-impossible, r=compiler-errors compiler: die immediately instead of handling unknown target codegen We cannot produce anything useful if asked to compile unknown targets. We should handle the error immediately at the point of discovery instead of propagating it upward, and preferably in the simplest way: Die. This allows cleaning up our "error-handling" spread across 5 crates.
Rollup of 6 pull requests Successful merges: - rust-lang#134999 (Add cygwin target.) - rust-lang#135677 (Small `rustc_resolve` cleanups) - rust-lang#136699 (std: replace the `FromInner` implementation for addresses with private conversion functions) - rust-lang#136758 (tests: `-Copt-level=3` instead of `-O` in assembly tests) - rust-lang#136761 (tests: `-Copt-level=3` instead of `-O` in codegen tests) - rust-lang#136833 (compiler: die immediately instead of handling unknown target codegen) Failed merges: - rust-lang#136808 (Try to recover from path sep error in type parsing) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#135285 (it-self → itself, build-system → build system, type-alias → type alias) - rust-lang#135677 (Small `rustc_resolve` cleanups) - rust-lang#136239 (show supported register classes in error message) - rust-lang#136246 (include note on variance and example) - rust-lang#136354 (Update docs for impl keyword) - rust-lang#136786 (Remove the deduplicate_blocks pass) - rust-lang#136833 (compiler: die immediately instead of handling unknown target codegen) - rust-lang#136847 (Simplify intra-crate qualifiers.) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#135285 (it-self → itself, build-system → build system, type-alias → type alias) - rust-lang#135677 (Small `rustc_resolve` cleanups) - rust-lang#136239 (show supported register classes in error message) - rust-lang#136246 (include note on variance and example) - rust-lang#136354 (Update docs for impl keyword) - rust-lang#136786 (Remove the deduplicate_blocks pass) - rust-lang#136833 (compiler: die immediately instead of handling unknown target codegen) - rust-lang#136847 (Simplify intra-crate qualifiers.) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136833 - workingjubilee:let-the-impossible-be-impossible, r=compiler-errors compiler: die immediately instead of handling unknown target codegen We cannot produce anything useful if asked to compile unknown targets. We should handle the error immediately at the point of discovery instead of propagating it upward, and preferably in the simplest way: Die. This allows cleaning up our "error-handling" spread across 5 crates.
We cannot produce anything useful if asked to compile unknown targets. We should handle the error immediately at the point of discovery instead of propagating it upward, and preferably in the simplest way: Die.
This allows cleaning up our "error-handling" spread across 5 crates.