Repository navigation
ICE when building compiler plugin with nll #49250
Copy link
Copy link
Closed
Labels
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)A-pluginsArea: compiler plugins (removed in https://github.com/rust-lang/rust/pull/116412)Area: compiler plugins (removed in https://github.com/rust-lang/rust/pull/116412)C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️NLL-completeWorking towards the "valid code works" goalWorking towards the "valid code works" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone
Description
I tried the example of compiler plugin and added only the nll feature.
The result is an ICE:
error: internal compiler error: broken MIR in NodeId(186) (Terminator { source_info: SourceInfo { span: src/lib.rs:60:5: 60:40, scope: scope[0] }, kind: _2 = const rustc_plugin::Registry::register_macro(move _3, move _4, move _6) -> [return: bb2, unwind: bb1] }): bad arg #2 (for<'cx, 'r, 's> fn(&'cx mut syntax::ext::base::ExtCtxt<'r>, syntax::codemap::Span, &'s [syntax::tokenstream::TokenTree]) -> std::boxed::Box<syntax::ext::base::MacResult + 'cx> <- for<'r, 's, 't0> fn(&'r mut syntax::ext::base::ExtCtxt<'s>, syntax::codemap::Span, &'t0 [syntax::tokenstream::TokenTree]) -> std::boxed::Box<syntax::ext::base::MacResult>): RegionsOverlyPolymorphic(BrNamed(crate11:DefIndex(1:1022), 'cx), '_#17r)
--> src/lib.rs:60:30
|
60 | reg.register_macro("rn", expand_rn);
| ^^^^^^^^^
error: internal compiler error: broken MIR in NodeId(186) (Terminator { source_info: SourceInfo { span: src/lib.rs:60:5: 60:40, scope: scope[0] }, kind: _2 = const rustc_plugin::Registry::register_macro(move _3, move _4, move _6) -> [return: bb2, unwind: bb1] }): bad arg #2 (for<'cx, 'r, 's> fn(&'cx mut syntax::ext::base::ExtCtxt<'r>, syntax::codemap::Span, &'s [syntax::tokenstream::TokenTree]) -> std::boxed::Box<syntax::ext::base::MacResult + 'cx> <- for<'r, 's, 't0> fn(&'r mut syntax::ext::base::ExtCtxt<'s>, syntax::codemap::Span, &'t0 [syntax::tokenstream::TokenTree]) -> std::boxed::Box<syntax::ext::base::MacResult>): RegionsOverlyPolymorphic(BrNamed(crate11:DefIndex(1:1022), 'cx), '_#17r)
--> src/lib.rs:60:30
|
60 | reg.register_macro("rn", expand_rn);
| ^^^^^^^^^
Metadata
Metadata
Assignees
Labels
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)A-pluginsArea: compiler plugins (removed in https://github.com/rust-lang/rust/pull/116412)Area: compiler plugins (removed in https://github.com/rust-lang/rust/pull/116412)C-bugCategory: This is a bug.Category: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️NLL-completeWorking towards the "valid code works" goalWorking towards the "valid code works" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Activity
emilyalbini commentedon Mar 21, 2018
cc @rust-lang/wg-compiler-nll
matthewjasper commentedon Apr 14, 2018
Ran into this when trying to bootstrap with NLL. Small repro case:
nikomatsakis commentedon Apr 24, 2018
This might, like #48071, be due to #33684
nikomatsakis commentedon Jul 3, 2018
I think we have to fix this -- it's blocking bootstrap and it's a serious ICE. But I'm not sure what's the best fix. I have an idea but it's a bit aggressive -- still, I think I might give it a spin. The basic idea is to rerite the subtyping code to use universes, which should solve #48071 and help pave the way for chalkification. I don't think I have the bandwidth to mentor this, though, and will instead just try and do it. Assigning myself.
nikomatsakis commentedon Jul 6, 2018
In-progress branch nll-issue-48071-universe-and-sub -- basically works but I have to re-enable user-given type annotations and also I'd like to tweak the performance.
pnkfelix commentedon Jul 24, 2018
visited for triage. this should be fixed via PR #52488 (which is WIP but hopefully will be ready soon).
nikomatsakis commentedon Jul 28, 2018
OK, #52488 has landed. This should be fixed.
Mark-Simulacrum commentedon Jul 31, 2018
@rust-lang/wg-compiler-nll Can someone take a look and confirm this is fixed?
nikomatsakis commentedon Aug 6, 2018
I can confirm this is fixed.