Skip to content

ICE when building compiler plugin with nll #49250

Closed
@real-felix

Description

@real-felix

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.htmlA-NLLArea: Non-lexical lifetimes (NLL)A-pluginsArea: compiler plugins, doc.rust-lang.org/nightly/unstable-book/language-features/plugin.htmlC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️NLL-completeWorking towards the "valid code works" goalT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions