Skip to content

ICE: non-lifetime passed to :lifetime #50381

Closed
@durka

Description

@durka

This code crashes the compiler. However, the location of the error is pointed out, which is nice.

#![feature(macro_lifetime_matcher)]

macro_rules! m { ($x:lifetime) => { } }

m!(a);
error: internal compiler error: not a lifetime
 --> src/main.rs:5:8
  |
5 |     m!(a);
  |        ^

thread 'main' panicked at 'Box<Any>', librustc_errors/lib.rs:491:9
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: aborting due to previous error

cc #50380 @ricochet1k

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-parserArea: The lexing & parsing of Rust source code to an ASTE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions