do not overwrite obligations
This commit is contained in:
parent
a673ad6b57
commit
3e4ed61c09
@ -530,19 +530,18 @@ impl<'tcx> InferCtxt<'tcx> {
|
|||||||
// these are the same span, but not in cases like `-> (impl
|
// these are the same span, but not in cases like `-> (impl
|
||||||
// Foo, impl Bar)`.
|
// Foo, impl Bar)`.
|
||||||
let span = cause.span;
|
let span = cause.span;
|
||||||
|
|
||||||
let mut obligations = vec![];
|
|
||||||
let prev = self.inner.borrow_mut().opaque_types().register(
|
let prev = self.inner.borrow_mut().opaque_types().register(
|
||||||
OpaqueTypeKey { def_id, substs },
|
OpaqueTypeKey { def_id, substs },
|
||||||
OpaqueHiddenType { ty: hidden_ty, span },
|
OpaqueHiddenType { ty: hidden_ty, span },
|
||||||
origin,
|
origin,
|
||||||
);
|
);
|
||||||
if let Some(prev) = prev {
|
let mut obligations = if let Some(prev) = prev {
|
||||||
obligations = self
|
self.at(&cause, param_env)
|
||||||
.at(&cause, param_env)
|
|
||||||
.eq_exp(DefineOpaqueTypes::Yes, a_is_expected, prev, hidden_ty)?
|
.eq_exp(DefineOpaqueTypes::Yes, a_is_expected, prev, hidden_ty)?
|
||||||
.obligations;
|
.obligations
|
||||||
}
|
} else {
|
||||||
|
Vec::new()
|
||||||
|
};
|
||||||
|
|
||||||
let item_bounds = tcx.explicit_item_bounds(def_id);
|
let item_bounds = tcx.explicit_item_bounds(def_id);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user