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

use the correct ParamEnv when checking future's output type #13863

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

Conversation

y21
Copy link
Member

@y21 y21 commented Dec 21, 2024

Fixes #13862

missing_headers::check is sometimes called from outside of a body (specifically, from check_attributes, where the LateContext's ParamEnv is not yet properly initialized for that item). Using that empty ParamEnv for trait solving things from within the body can then lead to various ICEs, like the linked issue where we have a const generic parameter DMA_INST without a ConstArgHasType bound in the ParamEnv so the const parameter has no type, which is normally not supposed to happen.

We have the item's DefId so we can just get its ParamEnv/TypingEnv from there, and using that one for trait solving should be safe.

changelog: none

@rustbot
Copy link
Collaborator

rustbot commented Dec 21, 2024

r? @dswij

rustbot has assigned @dswij.
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 the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 21, 2024
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.

ICE when evaluating trait selection obligation
3 participants