-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTI-needs-decisionIssue: In need of a decision.Issue: In need of a decision.P-mediumMedium priorityMedium priorityT-langRelevant to the language teamRelevant to the language teamregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Description
// Accepted while it should not.
type A = Box<(Trait1) + Trait2 + 'lifetime>;
// Correct syntax.
type A = Box<Trait1 + Trait2 + 'lifetime>;
The syntax for object types is the same as for other bounds - Bound + Bound + Bound + ....
and parentheses are not a part of bound syntax.
This is a stable-stable regression, introduced in Rust 1.6 by #29870.
cc #39169 #39179
Current status
- Refactor parsing of trait object types #40043 -
(Bound) + Bound + ....
is still parsed, but with a warning. This is a "hardcoded" warning and not a lint, lints cannot be reported from.libsyntax
- PR ? turns this syntax into a hard error
Metadata
Metadata
Assignees
Labels
A-parserArea: The lexing & parsing of Rust source code to an ASTArea: The lexing & parsing of Rust source code to an ASTI-needs-decisionIssue: In need of a decision.Issue: In need of a decision.P-mediumMedium priorityMedium priorityT-langRelevant to the language teamRelevant to the language teamregression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.