Skip to content

Known misparses #4

@fmease

Description

@fmease
  • fn main() { return x + .. .field }
    • wrong precedence
    • original source: dtolnay
  • while || Foo {} {};
    • rustc parses Foo as a unit-struct while we parse it as Foo {}
    • believed cause: we don't forward structpolicy diligently / aggressively enough
    • original source
  • our principled approach to parsing ranges using straightforward precedence levels doesn't reflect reality unfortunately since rustc seems to parse ranges in a gnarly(?) "ad hoc" way? still need to figure this out experimentally
  • we don't reject raw path segment keywords
  • we don't parse for _ in .. {} etc.
    • since { begins an expr, so we try to parse block and expect another block
    • rustc has a hack for this; we also need one (well, I hope looking at structpolicy will suffice which shouldn't be that hacky)
  • expr attr precedence

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions