This repository was archived by the owner on Oct 31, 2025. It is now read-only.
Conversation
While working on other patches that ended up not being applicable, I've gathered these changes unrelated to the irrelevant patch. So, submitting them as a seperate change, since the bigger change isn't going in.
eddyb
suggested changes
Aug 20, 2021
Comment on lines
623
to
637
| pub fn __rustc_codegen_backend() -> Box<dyn CodegenBackend> { | ||
| // Override rustc's panic hook with our own to override the ICE error | ||
| // message, and direct people to `rust-gpu`. | ||
| std::panic::set_hook(Box::new(|panic_info| { | ||
| rustc_driver::report_ice( | ||
| panic_info, | ||
| "https://github.com/EmbarkStudios/rust-gpu/issues/new", | ||
| ); | ||
| eprintln!("note: `rust-gpu` version {}\n", env!("CARGO_PKG_VERSION")); | ||
| })); | ||
| // Setting the hook nukes the backtrace, so give developers an escape hatch to see the crash, | ||
| // even if the message is wrong. | ||
| // TODO: Figure out a way to print both the backtrace and override the bug report URL. | ||
| if env::var_os("NO_PANIC_HOOK").is_none() { | ||
| // Override rustc's panic hook with our own to override the ICE error | ||
| // message, and direct people to `rust-gpu`. | ||
| std::panic::set_hook(Box::new(|panic_info| { | ||
| rustc_driver::report_ice( | ||
| panic_info, | ||
| "https://github.com/EmbarkStudios/rust-gpu/issues/new", | ||
| ); | ||
| eprintln!("note: `rust-gpu` version {}\n", env!("CARGO_PKG_VERSION")); | ||
| })); | ||
| } |
Contributor
There was a problem hiding this comment.
I think this can be dropped now, or at least after #732 lands.
eddyb
approved these changes
Aug 20, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While working on other patches that ended up not being applicable, I've gathered these changes unrelated to the irrelevant patch. So, submitting them as a seperate change, since the bigger change isn't going in.