diff options
| author | dswij <dharmasw@outlook.com> | 2024-12-29 09:31:57 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-29 09:31:57 +0000 |
| commit | c8ba3e1d7a92a591e01c13df79a868fff8876534 (patch) | |
| tree | d00887733ec1a9165ec3b5fdc6558fef891e7ec4 /compiler/rustc_pattern_analysis/tests/complexity.rs | |
| parent | aef47725a3d80a699a318185a90c45c23f399efa (diff) | |
| parent | 15ab2ff55adbacb263190f74aba8735c129db420 (diff) | |
| download | rust-c8ba3e1d7a92a591e01c13df79a868fff8876534.tar.gz rust-c8ba3e1d7a92a591e01c13df79a868fff8876534.zip | |
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
Diffstat (limited to 'compiler/rustc_pattern_analysis/tests/complexity.rs')
0 files changed, 0 insertions, 0 deletions
