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

fix: remove always! check for file_id in runnables #18727

Merged
merged 2 commits into from
Dec 21, 2024

Conversation

roife
Copy link
Member

@roife roife commented Dec 20, 2024

fix #18704.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 20, 2024
.map(|it| runnable_mod_outline_definition(&sema, it))
.for_each(|it| add_opt(it, None));
.filter_map(|it| runnable_mod_outline_definition(&sema, it))
.filter(|it| it.nav.file_id == file_id)
Copy link
Member

Choose a reason for hiding this comment

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

I think we need to just discard the assert actually? The problem here is the upmapping of include yielding back a real file id isntead of the usual macro call, and so I think we can still hit this with some silly stuff like

impl Type {
    include!("path/of/a-runnable-assoc-thing)
}

The assert used to be right when it was written but since we've changed how token upmapping works for includes so thats no longer the case I think (we had a similar issue with diagnostics)

Copy link
Member Author

Choose a reason for hiding this comment

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

Agree. I also find the assertion here a bit strange.

Copy link
Member

Choose a reason for hiding this comment

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

The reason for it was mainly if we ended up generating a runnable for a differing file that indicates a bug, since we are supposed to generate them for a specific file, but with include this can happen either way so plain filtering is the way to go now

@roife roife changed the title fix: filter out runnable mods from other file fix: remove always! check for file_id in runnables Dec 20, 2024
@Veykril Veykril added this pull request to the merge queue Dec 21, 2024
Merged via the queue into rust-lang:master with commit fda8b48 Dec 21, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

codeLens panic when working on a include!(source)
3 participants