Skip to content

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

@Centril

Description

@Centril
Contributor

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

added
A-frontendArea: Compiler frontend (errors, parsing and HIR)
A-parserArea: The lexing & parsing of Rust source code to an AST
P-highHigh priority
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
C-bugCategory: This is a bug.
on Dec 8, 2019
self-assigned this
on Dec 8, 2019
Centril

Centril commented on Dec 8, 2019

@Centril
ContributorAuthor

Fixed in #67148.

added 3 commits that reference this issue on Dec 21, 2019
2e44898
af9901f
616373e
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

    Participants

    @Centril

    Issue actions

      Parser accepts negative lifetime bounds and interprets as positive bound · Issue #67146 · rust-lang/rust