about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthew Jasper <mjjasper1@gmail.com>2020-07-01 21:56:35 +0100
committerMatthew Jasper <mjjasper1@gmail.com>2020-10-06 11:19:30 +0100
commit21eccbb587d7e9cff6fc6ebbd2a8844e8993fee4 (patch)
tree79d3021d360b90e5fc1ea0ef86583b37da689d8a
parent0dda4154bd254b629567739085471b8e50676c83 (diff)
downloadrust-21eccbb587d7e9cff6fc6ebbd2a8844e8993fee4.tar.gz
rust-21eccbb587d7e9cff6fc6ebbd2a8844e8993fee4.zip
Fix ICE
-rw-r--r--compiler/rustc_trait_selection/src/traits/select/confirmation.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
index 1ed4cca107e..319217e8fdc 100644
--- a/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
+++ b/compiler/rustc_trait_selection/src/traits/select/confirmation.rs
@@ -342,7 +342,8 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
     ) -> ImplSourceObjectData<'tcx, PredicateObligation<'tcx>> {
         debug!("confirm_object_candidate({:?})", obligation);
 
-        let self_ty = self.infcx.replace_bound_vars_with_placeholders(&obligation.self_ty());
+        let self_ty = self.infcx.shallow_resolve(obligation.self_ty());
+        let self_ty = self.infcx.replace_bound_vars_with_placeholders(&self_ty);
         let data = match self_ty.kind() {
             ty::Dynamic(data, ..) => data,
             _ => span_bug!(obligation.cause.span, "object candidate with non-object"),
@@ -448,7 +449,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
         )
         .map_bound(|(trait_ref, _)| trait_ref);
 
-        let Normalized { value: trait_ref, obligations } = ensure_sufficient_stack(|| {
+        let Normalized { value: trait_ref, mut obligations } = ensure_sufficient_stack(|| {
             project::normalize_with_depth(
                 self,
                 obligation.param_env,
@@ -458,12 +459,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
             )
         });
 
-        self.confirm_poly_trait_refs(
+        obligations.extend(self.confirm_poly_trait_refs(
             obligation.cause.clone(),
             obligation.param_env,
             obligation.predicate.to_poly_trait_ref(),
             trait_ref,
-        )?;
+        )?);
         Ok(ImplSourceFnPointerData { fn_ty: self_ty, nested: obligations })
     }