Crowdsourcing request: What syntax changes that will affect the AST are currently in flight?

During RustWeek I had a chance to catch up with dtolnay about moving default_field_values forward towards stabilization. One of the (mild) blockers is incorporating support for it in syn. To minimize strife, the idea will be to release syn 3.0 with this change, but before we can commit fully to that release, it would be very useful to have a full list of all potential AST changes in the pipeline, so that we're not stuck with a syn 3.0 that doesn't support a feature a mere month after release.

We have an idea about making AST nodes non-exhaustive to better support evolution in the future, but the point still stands.

I am asking for help to compile this list. If there are any syntax visible changes that will likely require AST changes (lean towards assuming they will, if you're unsure), I would love to hear about them.

8 Likes

Field projections (Tracking Issue for Field Projections · Issue #145383 · rust-lang/rust · GitHub) are likely to need new syntax, although I don't think the specific new syntax has been decided on yet.

Pattern types (Tracking Issue for pattern types · Issue #123646 · rust-lang/rust · GitHub) are a new sort of type which will need some syntax. For the time being (while the feature is being developed), they're using a macro-like syntax, but the macro will need to expand to something and it's plausible that a more built-in syntax will need to be adopted.

3 Likes

These are also still experimental, but potentially:

2 Likes

don't forget const trait impls and const trait bounds

1 Like

one other thing that would be really nice would to have better parser error recovery so using a proc-macro on some large section of code doesn't just replace everything with compile_error!() whenever the code is incomplete while you're editing it in an IDE.

6 Likes

looking through recent commits to rustc_parse:

6 Likes

Mut restrictions got mentioned. Another half is impl restrictions. Both are part of a gsoc project to implement the rfc, see Google Summer of Code

3 Likes

Lets open another thread for that conversation. I'd like to hear more.

1 Like

created a new thread as requested: Parser error recovery in `syn` for better IDE support with proc-macros

1 Like