Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use the correct
ParamEnv
when checking future's output type (#13863)
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
- Loading branch information