diff options
| author | Michael Goulet <michael@errs.io> | 2022-11-22 02:22:33 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2022-11-22 03:41:13 +0000 |
| commit | 1c1778da25fbbcf2c952d2c33fa63a5016559064 (patch) | |
| tree | a039b878db96d5adf57aa0105d8af14dbfe773fa | |
| parent | 28a53cdb4695b71cb9ee39959df88542056479cd (diff) | |
| download | rust-1c1778da25fbbcf2c952d2c33fa63a5016559064.tar.gz rust-1c1778da25fbbcf2c952d2c33fa63a5016559064.zip | |
Remove a hack from compare_predicate_entailment
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/compare_method.rs | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/compare_method.rs b/compiler/rustc_hir_analysis/src/check/compare_method.rs index e68df228c6b..07d1845f97e 100644 --- a/compiler/rustc_hir_analysis/src/check/compare_method.rs +++ b/compiler/rustc_hir_analysis/src/check/compare_method.rs @@ -291,17 +291,7 @@ fn compare_predicate_entailment<'tcx>( // type would be more appropriate. In other places we have a `Vec<Span>` // corresponding to their `Vec<Predicate>`, but we don't have that here. // Fixing this would improve the output of test `issue-83765.rs`. - let mut result = ocx.sup(&cause, param_env, trait_fty, impl_fty); - - // HACK(RPITIT): #101614. When we are trying to infer the hidden types for - // RPITITs, we need to equate the output tys instead of just subtyping. If - // we just use `sup` above, we'll end up `&'static str <: _#1t`, which causes - // us to infer `_#1t = #'_#2r str`, where `'_#2r` is unconstrained, which gets - // fixed up to `ReEmpty`, and which is certainly not what we want. - if trait_fty.has_infer_types() { - result = - result.and_then(|()| ocx.eq(&cause, param_env, trait_sig.output(), impl_sig.output())); - } + let result = ocx.sup(&cause, param_env, trait_fty, impl_fty); if let Err(terr) = result { debug!(?terr, "sub_types failed: impl ty {:?}, trait ty {:?}", impl_fty, trait_fty); |
