Skip to content

syntax: + has incorrect priority in trait object types starting with for #39317

Closed
@petrochenkov

Description

@petrochenkov

&for<'a> Tr<'a> + Send is parsed as &(for<'a> Tr<'a> + Send) while RFC 438 tells that it should be parsed as (&for<'a> Tr<'a>) + Send and therefore be invalid.

Another example: Fn() -> for<'a> Tr<'a> + Send is parsed as Fn() -> (for<'a> Tr<'a> + Send) instead of (Fn() -> for<'a> Tr<'a>) + Send.

cc #39158 (comment)

Metadata

Metadata

Assignees

Labels

A-parserArea: The lexing & parsing of Rust source code to an AST

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions