Skip to content

if foo {}.bar() parses successfully, but if foo {} + bar and foo! {}.bar() do not #21222

@ftxqxd

Description

@ftxqxd

It seems a tiny bit inconsistent that if foo {}.bar() parses successfully, but if foo {} + bar does not, given that . and + are both binary operators. The former isn’t ambiguous (whereas the latter would be if we got a unary + operator), but I still think that it’d be best to either be consistent with + and reject it, or at least adjust macro invocations with curly braces to accept .s afterwards as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parserArea: The lexing & parsing of Rust source code to an ASTP-lowLow priorityT-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions