]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_typeck/check/autoderef.rs
Auto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, r=Mark-Simulacrum
[rust.git] / src / librustc_typeck / check / autoderef.rs
index 92017465f7d7489171c6452d68ec27bf8ee8c3b9..e0e946a9c63fa7b367a5ef37c80da9ee7de024b0 100644 (file)
@@ -118,13 +118,16 @@ fn overloaded_deref_ty(&mut self, ty: Ty<'tcx>) -> Option<Ty<'tcx>> {
         let cause = traits::ObligationCause::misc(self.span, self.fcx.body_id);
 
         let mut selcx = traits::SelectionContext::new(self.fcx);
-        let obligation = traits::Obligation::new(cause.clone(), trait_ref.to_predicate());
+        let obligation = traits::Obligation::new(cause.clone(),
+                                                 self.fcx.param_env,
+                                                 trait_ref.to_predicate());
         if !selcx.evaluate_obligation(&obligation) {
             debug!("overloaded_deref_ty: cannot match obligation");
             return None;
         }
 
         let normalized = traits::normalize_projection_type(&mut selcx,
+                                                           self.fcx.param_env,
                                                            ty::ProjectionTy::from_ref_and_name(
                                                                tcx,
                                                                trait_ref,
@@ -214,7 +217,7 @@ pub fn autoderef(&'a self, span: Span, base_ty: Ty<'tcx>) -> Autoderef<'a, 'gcx,
             cur_ty: self.resolve_type_vars_if_possible(&base_ty),
             obligations: vec![],
             at_start: true,
-            span: span,
+            span,
         }
     }