Closed
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