Skip to content

debug assertion ice: bad spans: -Wunused-lifetimes #108248

Open
@matthiaskrgr

Description

@matthiaskrgr

Code

fn main() {
    let _: extern fn<'a: 'static>();
}

The problem is this first garbage span:

warning: lifetime parameter `'a` never used
 --> recover-fn-ptr-with-generics.rs:2:22
  |
2 |     let _: extern fn<'a: 'static>();
  |            -         ^^
  |            |
  |            help: elide the unused lifetime
  |
  = note: requested on the command line with `-W unused-lifetimes`

Meta

rustc --version --verbose:

eebdfb55fce148676c24555505aebf648123b2de

Error output

<output>

unused_lifetime.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️L-unused_lifetimesLint: unused_lifetimesS-bug-has-testStatus: This bug is tracked inside the repo by a `known-bug` test.S-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-debug-assertionsThis issue requires a build of rustc or tooling with debug-assertions in some way

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions