Skip to content

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

Closed
@Centril

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.

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