Skip to content

Commit b12d31f

Browse files
authored
Rollup merge of rust-lang#104701 - compiler-errors:rpitit-remove-reempty-hack, r=TaKO8Ki
Remove a lifetime resolution hack from `compare_predicate_entailment` This is not needed anymore, probably due to rust-lang#102334 equating the function signatures fully in `collect_trait_impl_trait_tys`. Also, the assertion in in rust-lang#102903 makes sure that this is actually fixed, so I'm pretty confident this isn't needed.
2 parents d29491a + 1c1778d commit b12d31f

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

compiler/rustc_hir_analysis/src/check/compare_method.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -288,17 +288,7 @@ fn compare_predicate_entailment<'tcx>(
288288
// type would be more appropriate. In other places we have a `Vec<Span>`
289289
// corresponding to their `Vec<Predicate>`, but we don't have that here.
290290
// Fixing this would improve the output of test `issue-83765.rs`.
291-
let mut result = ocx.sup(&cause, param_env, trait_fty, impl_fty);
292-
293-
// HACK(RPITIT): #101614. When we are trying to infer the hidden types for
294-
// RPITITs, we need to equate the output tys instead of just subtyping. If
295-
// we just use `sup` above, we'll end up `&'static str <: _#1t`, which causes
296-
// us to infer `_#1t = #'_#2r str`, where `'_#2r` is unconstrained, which gets
297-
// fixed up to `ReEmpty`, and which is certainly not what we want.
298-
if trait_fty.has_infer_types() {
299-
result =
300-
result.and_then(|()| ocx.eq(&cause, param_env, trait_sig.output(), impl_sig.output()));
301-
}
291+
let result = ocx.sup(&cause, param_env, trait_fty, impl_fty);
302292

303293
if let Err(terr) = result {
304294
debug!(?terr, "sub_types failed: impl ty {:?}, trait ty {:?}", impl_fty, trait_fty);

0 commit comments

Comments
 (0)