Skip to content

Commit 6591c80

Browse files
committed
use typeck root when checking closure oblig
1 parent 71d82c2 commit 6591c80

File tree

3 files changed

+4
-17
lines changed

3 files changed

+4
-17
lines changed

compiler/rustc_hir_analysis/src/check/check.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1554,14 +1554,16 @@ fn opaque_type_cycle_error(
15541554
err.emit()
15551555
}
15561556

1557+
// FIXME(@lcnr): This should not be computed per coroutine, but instead once for
1558+
// each typeck root.
15571559
pub(super) fn check_coroutine_obligations(
15581560
tcx: TyCtxt<'_>,
15591561
def_id: LocalDefId,
15601562
) -> Result<(), ErrorGuaranteed> {
15611563
debug_assert!(tcx.is_coroutine(def_id.to_def_id()));
15621564

15631565
let typeck = tcx.typeck(def_id);
1564-
let param_env = tcx.param_env(def_id);
1566+
let param_env = tcx.param_env(typeck.hir_owner.def_id);
15651567

15661568
let coroutine_interior_predicates = &typeck.coroutine_interior_predicates[&def_id];
15671569
debug!(?coroutine_interior_predicates);

tests/ui/traits/next-solver/normalize-async-closure-in-trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ compile-flags: -Znext-solver
2-
//@ known-bug: unknown
2+
//@ check-pass
33
//@ edition:2021
44

55
trait Foo {

tests/ui/traits/next-solver/normalize-async-closure-in-trait.stderr

-15
This file was deleted.

0 commit comments

Comments
 (0)