Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Centril opened this issue Dec 8, 2019 · 1 comment · Fixed by #67148
Closed

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

Centril opened this issue Dec 8, 2019 · 1 comment · Fixed by #67148
Assignees
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) A-parser Area: The parsing of Rust source code to an AST C-bug Category: This is a bug. P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@Centril
Copy link
Contributor

Centril commented Dec 8, 2019

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.

@Centril Centril added A-frontend Area: Compiler frontend (errors, parsing and HIR) A-parser Area: The parsing of Rust source code to an AST P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Dec 8, 2019
@Centril Centril self-assigned this Dec 8, 2019
@Centril
Copy link
Contributor Author

Centril commented Dec 8, 2019

Fixed in #67148.

Centril added a commit to Centril/rust that referenced this issue Dec 21, 2019
 Refactor type & bounds parsing thoroughly

PR is based on rust-lang#67131 with first one from this PR being ` extract parse_ty_tuple_or_parens`.

Also fixes rust-lang#67146.

r? @estebank
Centril added a commit to Centril/rust that referenced this issue Dec 22, 2019
 Refactor type & bounds parsing thoroughly

PR is based on rust-lang#67131 with first one from this PR being ` extract parse_ty_tuple_or_parens`.

Also fixes rust-lang#67146.

r? @estebank
@bors bors closed this as completed in 616373e Dec 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) A-parser Area: The parsing of Rust source code to an AST C-bug Category: This is a bug. P-high High priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant