-
Notifications
You must be signed in to change notification settings - Fork 13.4k
librustc: Add bug!(), bug_span!() macros as unified entry points for internal compiler errors #32562
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
Seems good to me! I like that you get the file/line-number for free. r=me. |
692af22
to
f87aaa0
Compare
@@ -302,14 +302,11 @@ impl<'a> Context<'a> { | |||
pub fn load_library_crate(&mut self) -> Library { | |||
match self.find_library_crate() { |
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.
Nit: This could become self.find_library_crate().unwrap_or_else(|| self.report_load_errs())
.
a6234f0
to
4379c7c
Compare
@bors r+ |
📌 Commit 4379c7c has been approved by |
☔ The latest upstream changes (presumably #32628) made this pull request unmergeable. Please resolve the merge conflicts. |
7aa9b6e
to
98e5c22
Compare
☔ The latest upstream changes (presumably #31938) made this pull request unmergeable. Please resolve the merge conflicts. |
... as single "internal compiler error" entry point. The macros pass `file!()`, `line!()` and `format_args!(...)` on to a cold, never-inlined function, ultimately calling `bug()` or `span_bug()` on the `Handler` from `session::diagnostic()` via the tcx in tls or, failing that, panicking directly.
@bors r=nikomatsakis |
📌 Commit 33cc0ed has been approved by |
librustc: Add bug!(), bug_span!() macros as unified entry points for internal compiler errors The macros pass `file!()`, `line!()` and `format_args!(...)` on to a cold, never-inlined function, ultimately calling `session::{span_,}bug_fmt` via the tcx in tls or, failing that, panicking directly. cc @eddyb r? @nikomatsakis
The macros pass
file!()
,line!()
andformat_args!(...)
on to a cold, never-inlined function, ultimately callingsession::{span_,}bug_fmt
via the tcx in tls or, failing that, panicking directly.cc @eddyb
r? @nikomatsakis