Skip to content

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

Merged
merged 19 commits into from
Apr 2, 2016

Conversation

ben0x539
Copy link
Contributor

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

@nikomatsakis
Copy link
Contributor

Seems good to me! I like that you get the file/line-number for free. r=me.

@ben0x539 ben0x539 force-pushed the bug-macro branch 3 times, most recently from 692af22 to f87aaa0 Compare March 29, 2016 00:19
@@ -302,14 +302,11 @@ impl<'a> Context<'a> {
pub fn load_library_crate(&mut self) -> Library {
match self.find_library_crate() {
Copy link
Member

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()).

@ben0x539 ben0x539 force-pushed the bug-macro branch 3 times, most recently from a6234f0 to 4379c7c Compare March 29, 2016 19:29
@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Collaborator

bors commented Mar 30, 2016

📌 Commit 4379c7c has been approved by nikomatsakis

bors added a commit that referenced this pull request Mar 30, 2016
Rollup of 4 pull requests

- Successful merges: #32259, #32494, #32612, #32618
- Failed merges: #32562
@bors
Copy link
Collaborator

bors commented Mar 31, 2016

☔ The latest upstream changes (presumably #32628) made this pull request unmergeable. Please resolve the merge conflicts.

@ben0x539 ben0x539 force-pushed the bug-macro branch 3 times, most recently from 7aa9b6e to 98e5c22 Compare March 31, 2016 18:52
@bors
Copy link
Collaborator

bors commented Mar 31, 2016

☔ The latest upstream changes (presumably #31938) made this pull request unmergeable. Please resolve the merge conflicts.

@pnkfelix
Copy link
Member

pnkfelix commented Apr 1, 2016

@bors r=nikomatsakis

@bors
Copy link
Collaborator

bors commented Apr 1, 2016

📌 Commit 33cc0ed has been approved by nikomatsakis

@bors
Copy link
Collaborator

bors commented Apr 2, 2016

⌛ Testing commit 33cc0ed with merge 1af79cf...

bors added a commit that referenced this pull request Apr 2, 2016
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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants