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

Edition differences #41

Open
ehuss opened this issue Jun 28, 2019 · 1 comment
Open

Edition differences #41

ehuss opened this issue Jun 28, 2019 · 1 comment
Labels
editions Edition issues grammar Issues with the definition of the rust grammar lexer Issues with the lexer

Comments

@ehuss
Copy link
Contributor

ehuss commented Jun 28, 2019

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() {}
@ehuss ehuss added lexer Issues with the lexer grammar Issues with the definition of the rust grammar editions Edition issues labels Jun 28, 2019
@eddyb
Copy link
Member

eddyb commented Mar 28, 2020

Wasn't sure where to leave a comment about this so I did on the older issue: #6 (comment).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editions Edition issues grammar Issues with the definition of the rust grammar lexer Issues with the lexer
Projects
None yet
Development

No branches or pull requests

2 participants