about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection/src/infer.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-17 20:02:22 +0000
committerbors <bors@rust-lang.org>2025-07-17 20:02:22 +0000
commite4662966273ed58b51f9ff8d682accc202aa1210 (patch)
tree560236eb5364c796927d944154fa6aa5a3837717 /compiler/rustc_trait_selection/src/infer.rs
parent9cd918bcbbc26deb005eb4e1bd9a445380195e56 (diff)
parent216cdb7b22b637cef75b7225c642cb7587192643 (diff)
downloadrust-e4662966273ed58b51f9ff8d682accc202aa1210.tar.gz
rust-e4662966273ed58b51f9ff8d682accc202aa1210.zip
Auto merge of #141762 - compiler-errors:witnesser, r=lcnr
Unify `CoroutineWitness` sooner in typeck, and stall coroutine obligations based off of `TypingEnv`

* Stall coroutine obligations based off of `TypingMode` in the old solver.
* Eagerly assign `TyKind::CoroutineWitness` to the witness arg of coroutines during typeck, rather than deferring them to the end of typeck.

r? lcnr

This is part of https://github.com/rust-lang/rust/issues/143017.
Diffstat (limited to 'compiler/rustc_trait_selection/src/infer.rs')
-rw-r--r--compiler/rustc_trait_selection/src/infer.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_trait_selection/src/infer.rs b/compiler/rustc_trait_selection/src/infer.rs
index 0118321befb..7c6b7b14ecb 100644
--- a/compiler/rustc_trait_selection/src/infer.rs
+++ b/compiler/rustc_trait_selection/src/infer.rs
@@ -33,8 +33,8 @@ impl<'tcx> InferCtxt<'tcx> {
         let ty = self.resolve_vars_if_possible(ty);
 
         // FIXME(#132279): This should be removed as it causes us to incorrectly
-        // handle opaques in their defining scope.
-        if !self.next_trait_solver() && !(param_env, ty).has_infer() {
+        // handle opaques in their defining scope, and stalled coroutines.
+        if !self.next_trait_solver() && !(param_env, ty).has_infer() && !ty.has_coroutines() {
             return self.tcx.type_is_copy_modulo_regions(self.typing_env(param_env), ty);
         }