Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Edition differences #41

Open
Open
@ehuss

Description

@ehuss

I think it would be good if the grammar tracked edition differences. I'm not sure how this should be done on a technical level (maybe some preprocessing step?), this issue is mainly to record the differences until it is decided how to encode them.

Trait functions cannot have anonymous parameters in 2018

trait T {
    fn f(u8);
}

parse_trait_item_

dyn weak keyword support

In 2015, dyn is a weak keyword. It is context sensitive, so there are a variety of differences.

// Type expressions allowed in 2015, not 2018.
dyn +

// Type expressions allowed in both.
dyn   // I don't know why this is allowed in 2018.

// Interpreted differently.
dyn ::foo

New reserved keywords

The following keywords were added to 2018

  • async
  • await
  • try

async fn not allowed in 2015

The following fails to parse in 2015:

async fn f() {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    editionsEdition issuesgrammarIssues with the definition of the rust grammarlexerIssues with the lexer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions