]> git.lizzy.rs Git - rust.git/commitdiff
Remove reference to Ty.
authorMark Simulacrum <mark.simulacrum@gmail.com>
Sun, 5 Mar 2017 17:36:31 +0000 (10:36 -0700)
committerMark Simulacrum <mark.simulacrum@gmail.com>
Mon, 6 Mar 2017 14:04:04 +0000 (07:04 -0700)
src/librustc_typeck/check/mod.rs

index ae4cb48b7c60e8018200573984cf1d1c63b4b443..2b9ccf6d3e246c666e0eabf9c9d812638324313f 100644 (file)
@@ -1935,10 +1935,10 @@ fn new_select_all_obligations_and_apply_defaults(&self) {
             // We must collect the defaults *before* we do any unification. Because we have
             // directly attached defaults to the type variables any unification that occurs
             // will erase defaults causing conflicting defaults to be completely ignored.
-            let default_map: FxHashMap<_, _> =
+            let default_map: FxHashMap<Ty<'tcx>, _> =
                 unsolved_variables
                     .iter()
-                    .filter_map(|t| self.default(t).map(|d| (t, d)))
+                    .filter_map(|t| self.default(t).map(|d| (*t, d)))
                     .collect();
 
             let mut unbound_tyvars = FxHashSet();
@@ -2068,7 +2068,7 @@ fn new_select_all_obligations_and_apply_defaults(&self) {
     fn apply_defaults_and_return_conflicts<'b>(
         &'b self,
         unbound_vars: &'b FxHashSet<Ty<'tcx>>,
-        default_map: &'b FxHashMap<&'b Ty<'tcx>, type_variable::Default<'tcx>>,
+        default_map: &'b FxHashMap<Ty<'tcx>, type_variable::Default<'tcx>>,
         conflict: Option<Ty<'tcx>>,
     ) -> impl Iterator<Item=(Ty<'tcx>, type_variable::Default<'tcx>)> + 'b {
         use rustc::ty::error::UnconstrainedNumeric::Neither;
@@ -2087,7 +2087,7 @@ fn apply_defaults_and_return_conflicts<'b>(
                         self.demand_eqtype(syntax_pos::DUMMY_SP, ty, self.tcx.types.f64)
                     },
                     Neither => {
-                        if let Some(default) = default_map.get(&ty) {
+                        if let Some(default) = default_map.get(ty) {
                             let default = default.clone();
                             let default_ty = self.normalize_associated_types_in(
                                 default.origin_span, &default.ty);