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

Add GlobalAsm as a valid ItemKind to StableMIR #138025

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

celinval
Copy link
Contributor

@celinval celinval commented Mar 5, 2025

This fixes StableMIR crash when iterating over the items of a crate that contains global assembly.

Fixes rust-lang/project-stable-mir#95

This fixes StableMIR crash when iterating over the items of a crate
that contains global assembly.
@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2025

r? @scottmcm

rustbot has assigned @scottmcm.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Mar 5, 2025

This PR changes Stable MIR

cc @oli-obk, @celinval, @ouz-a

@compiler-errors
Copy link
Member

compiler-errors commented Mar 5, 2025

This actually technically conflicts with #137502, which removes global_asm from the mir_keys, and which indirectly fixes the ICE in rust-lang/project-stable-mir#95.

They shouldn't have been there in the first place, but also the fn all_local_items() function is a bit unclear; it should probably be listing global asm items too, and possibly items without bodies like structs. I think it shouldn't be piggybacking off of the mir_keys query at all, but iterating over some other set of local def ids and filtering those out based off of their DefKind.

Could you please wait until #137502 is landed? Then please adjust the fn all_local_items() to be more clear about what kinds of items it's returning 🤔 happy to chat about that if you want to work that design part out.

@rustbot blocked

@rustbot rustbot added S-blocked Status: Blocked on something else such as an RFC or other implementation work. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 5, 2025
@celinval
Copy link
Contributor Author

celinval commented Mar 8, 2025

@compiler-errors let's chat about the kinds of items you think we should return here, and the best way to implement that. This is today one of the main entry points to StableMir.

I'm also considering adding a stable API to get the results from rustc's collector, likely without the cgu part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-blocked Status: Blocked on something else such as an RFC or other implementation work. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic in item.kind() when the underlying item kind is GlobalAsm
4 participants