Revert "Rollup merge of #97346 - JohnTitor:remove-back-compat-hacks, r=oli-obk"
This reverts commitc703d11dcc
, reversing changes made to64eb9ab869
.
This commit is contained in:
parent
05e678ccca
commit
a85eb3d9df
12 changed files with 69 additions and 67 deletions
|
@ -252,10 +252,20 @@ fn project_and_unify_type<'cx, 'tcx>(
|
|||
Err(InProgress) => return ProjectAndUnifyResult::Recursive,
|
||||
};
|
||||
debug!(?normalized, ?obligations, "project_and_unify_type result");
|
||||
match infcx
|
||||
.at(&obligation.cause, obligation.param_env)
|
||||
.eq(normalized, obligation.predicate.term)
|
||||
{
|
||||
let actual = obligation.predicate.term;
|
||||
// For an example where this is neccessary see src/test/ui/impl-trait/nested-return-type2.rs
|
||||
// This allows users to omit re-mentioning all bounds on an associated type and just use an
|
||||
// `impl Trait` for the assoc type to add more bounds.
|
||||
let InferOk { value: actual, obligations: new } =
|
||||
selcx.infcx().replace_opaque_types_with_inference_vars(
|
||||
actual,
|
||||
obligation.cause.body_id,
|
||||
obligation.cause.span,
|
||||
obligation.param_env,
|
||||
);
|
||||
obligations.extend(new);
|
||||
|
||||
match infcx.at(&obligation.cause, obligation.param_env).eq(normalized, actual) {
|
||||
Ok(InferOk { obligations: inferred_obligations, value: () }) => {
|
||||
obligations.extend(inferred_obligations);
|
||||
ProjectAndUnifyResult::Holds(obligations)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue