Skip to content

ICE with weird macro lifetime syntax #33837

Closed
@diwic

Description

@diwic

This code is totally broken, but since it ICEs (on beta and nightly, but not on stable), it's a bug anyhow:

macro_rules! stupid { ($f0: ty, $f1: ty) => { for <'q> FnOnce(&'q $f0) -> $'q f1 }}
fn test<T: stupid(String, &str)>() {} 

Fails with:

<anon>:1:76: 1:78 error: expected identifier, found `'q`
<anon>:1 macro_rules! stupid { ($f0: ty, $f1: ty) => { for <'q> FnOnce(&'q $f0) -> $'q f1 }}
                                                                                    ^~
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'internal error: entered unreachable code', ../src/libsyntax/parse/parser.rs:2857

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions