diff options
| author | Michael Goulet <michael@errs.io> | 2024-09-25 19:19:22 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-09-26 22:26:29 -0400 |
| commit | d4ee408afc59b36ff59b6fd12d47c1beeba8e985 (patch) | |
| tree | 60206518d97d23b8b2da5dd6f7992b5c30f99db5 /compiler/rustc_next_trait_solver | |
| parent | 58420a065b68ecb3eec03b942740c761cdadd5c4 (diff) | |
| download | rust-d4ee408afc59b36ff59b6fd12d47c1beeba8e985.tar.gz rust-d4ee408afc59b36ff59b6fd12d47c1beeba8e985.zip | |
Check allow instantiating object trait binder when upcasting and in new solver
Diffstat (limited to 'compiler/rustc_next_trait_solver')
| -rw-r--r-- | compiler/rustc_next_trait_solver/src/solve/trait_goals.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs index 781ca127e15..0befe7f5e8a 100644 --- a/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs +++ b/compiler/rustc_next_trait_solver/src/solve/trait_goals.rs @@ -896,7 +896,7 @@ where && ecx .probe(|_| ProbeKind::UpcastProjectionCompatibility) .enter(|ecx| -> Result<(), NoSolution> { - ecx.eq(param_env, source_projection, target_projection)?; + ecx.sub(param_env, source_projection, target_projection)?; let _ = ecx.try_evaluate_added_goals()?; Ok(()) }) @@ -909,7 +909,7 @@ where // Check that a's supertrait (upcast_principal) is compatible // with the target (b_ty). ty::ExistentialPredicate::Trait(target_principal) => { - ecx.eq( + ecx.sub( param_env, upcast_principal.unwrap(), bound.rebind(target_principal), @@ -934,7 +934,7 @@ where Certainty::AMBIGUOUS, ); } - ecx.eq(param_env, source_projection, target_projection)?; + ecx.sub(param_env, source_projection, target_projection)?; } // Check that b_ty's auto traits are present in a_ty's bounds. ty::ExistentialPredicate::AutoTrait(def_id) => { |
