Skip to content

Parser accepts negative lifetime bounds and interprets as positive bound #67146

Description

@Centril

The following is accepted by the parser:

fn foo<T: !'static>() {}

and the ! is just silently dropped thus interpreting the constraint as T: 'static.

Regression introduced in #57364 on Feb 24.
cc @estebank @hdhoang

I discovered this while working on a refactoring of parser/ty.rs.
I will fix the issue as part of that refactoring.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-frontendArea: Compiler frontend (errors, parsing and HIR)A-parserArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.P-highHigh priorityT-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