Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal: Prepare parser interface for editions #16450

Merged
merged 6 commits into from Apr 14, 2024

Conversation

Urhengulas
Copy link
Contributor

@Urhengulas Urhengulas commented Jan 30, 2024

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
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
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
Copy link
Member

Veykril commented Jan 30, 2024

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
Copy link
Member

Veykril commented Jan 30, 2024

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
Copy link
Collaborator

bors commented Feb 5, 2024

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

@Veykril
Copy link
Member

Veykril commented Apr 14, 2024

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
Copy link
Member

Veykril commented Apr 14, 2024

Thanks!
@bors r+

@bors
Copy link
Collaborator

bors commented Apr 14, 2024

📌 Commit 83370fe has been approved by Veykril

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented Apr 14, 2024

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

@bors
Copy link
Collaborator

bors commented Apr 14, 2024

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

@bors bors merged commit 74cef6d into rust-lang:master Apr 14, 2024
11 checks passed
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
@@ -1157,7 +1157,7 @@ fn iterate_trait_method_candidates(
{
// 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
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
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
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.

None yet

5 participants