Skip to content

internal: Prepare parser interface for editions#16450

Merged
bors merged 6 commits into
rust-lang:masterfrom
Urhengulas:edition-aware-parser
Apr 14, 2024
Merged

internal: Prepare parser interface for editions#16450
bors merged 6 commits into
rust-lang:masterfrom
Urhengulas:edition-aware-parser

Conversation

@Urhengulas

@Urhengulas Urhengulas commented Jan 30, 2024

Copy link
Copy Markdown
Contributor

No description provided.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 30, 2024
@Urhengulas

Copy link
Copy Markdown
Contributor Author

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 30, 2024
@Urhengulas

Copy link
Copy Markdown
Contributor Author

I've noticed that (including this PR) there are three enum Edition, which are largely the same. The crates are base-db, parser and project-model. Maybe we can merge them.

@Veykril

Veykril commented Jan 30, 2024

Copy link
Copy Markdown
Member

The one in project-model exists for rust-project.json deserialization, base-db is the representation for crates and the parser one is separate because it does not depend on base-db (and shouldn't). On another note, the base-db one we might want to move to the span crate, I think that makes more sense there. The parser might depend on the span crate in the future in which case we can collapse them, but right now that makes little sense

@Veykril

Veykril commented Jan 30, 2024

Copy link
Copy Markdown
Member

Actually, the span crate depends on the parser through the syntax crate, so we can remove the base-db edition and have the span crate re-export the parser one.

@bors

bors commented Feb 5, 2024

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #16492) made this pull request unmergeable. Please resolve the merge conflicts.

@Veykril Veykril force-pushed the edition-aware-parser branch from f0bca43 to e785280 Compare April 14, 2024 13:11
@Veykril Veykril force-pushed the edition-aware-parser branch from f8f06d6 to 83370fe Compare April 14, 2024 13:30
@Veykril

Veykril commented Apr 14, 2024

Copy link
Copy Markdown
Member

Rebased and deduplicated the enum. The edition field doesn't do anything yet, but I'll merge this as is as a preparation step. Future work can be built on top as a separate PR

@Veykril Veykril changed the title Edition-aware parser internal: Prepare parser interface for editions Apr 14, 2024
@Veykril Veykril marked this pull request as ready for review April 14, 2024 13:32
@Veykril

Veykril commented Apr 14, 2024

Copy link
Copy Markdown
Member

Thanks!
@bors r+

@bors

bors commented Apr 14, 2024

Copy link
Copy Markdown
Contributor

📌 Commit 83370fe has been approved by Veykril

It is now in the queue for this repository.

@bors

bors commented Apr 14, 2024

Copy link
Copy Markdown
Contributor

⌛ Testing commit 83370fe with merge 74cef6d...

@bors

bors commented Apr 14, 2024

Copy link
Copy Markdown
Contributor

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing 74cef6d to master...

@bors bors merged commit 74cef6d into rust-lang:master Apr 14, 2024
bors added a commit that referenced this pull request Apr 14, 2024
internal: Thread edition through to parsing/tt-to-syntax-tree routines for macros

Follow up to #16450, cc #16324
// FIXME: this should really be using the edition of the method name's span, in case it
// comes from a macro
if db.crate_graph()[krate].edition < Edition::Edition2021 {
if db.crate_graph()[krate].edition < Edition::CURRENT {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this stay as Edition2021?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, I misread the comment

bors added a commit that referenced this pull request Apr 15, 2024
minor: Fix `rustc_skip_array_during_method_dispatch` edition check

CC #16450
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 20, 2024
internal: Thread edition through to parsing/tt-to-syntax-tree routines for macros

Follow up to rust-lang/rust-analyzer#16450, cc rust-lang/rust-analyzer#16324
@Urhengulas Urhengulas deleted the edition-aware-parser branch April 22, 2024 15:34
@Urhengulas

Copy link
Copy Markdown
Contributor Author

🙏🏾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants