Skip to content

Commit 1c1778d

Browse files
Remove a hack from compare_predicate_entailment
1 parent 28a53cd commit 1c1778d

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

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

0 commit comments

Comments
 (0)