]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_typeck/src/upvar.rs
Rollup merge of #104359 - Nilstrieb:plus-one, r=fee1-dead
[rust.git] / compiler / rustc_hir_typeck / src / upvar.rs
index 4dea40829f6221a2b4e4400789676b9bd5b8b4ce..68f119adc7a7cb6392a1164fcb7c087ed2dda8aa 100644 (file)
@@ -970,12 +970,7 @@ fn compute_2229_migrations_for_trait(
                 check_trait
                     .map(|check_trait| {
                         self.infcx
-                            .type_implements_trait(
-                                check_trait,
-                                ty,
-                                self.tcx.mk_substs_trait(ty, &[]),
-                                self.param_env,
-                            )
+                            .type_implements_trait(check_trait, [ty], self.param_env)
                             .must_apply_modulo_regions()
                     })
                     .unwrap_or(false),
@@ -999,12 +994,7 @@ fn compute_2229_migrations_for_trait(
                     check_trait
                         .map(|check_trait| {
                             self.infcx
-                                .type_implements_trait(
-                                    check_trait,
-                                    ty,
-                                    self.tcx.mk_substs_trait(ty, &[]),
-                                    self.param_env,
-                                )
+                                .type_implements_trait(check_trait, [ty], self.param_env)
                                 .must_apply_modulo_regions()
                         })
                         .unwrap_or(false),
@@ -1347,14 +1337,8 @@ fn has_significant_drop_outside_of_captures(
 
         let is_drop_defined_for_ty = |ty: Ty<'tcx>| {
             let drop_trait = self.tcx.require_lang_item(hir::LangItem::Drop, Some(closure_span));
-            let ty_params = self.tcx.mk_substs_trait(base_path_ty, &[]);
             self.infcx
-                .type_implements_trait(
-                    drop_trait,
-                    ty,
-                    ty_params,
-                    self.tcx.param_env(closure_def_id),
-                )
+                .type_implements_trait(drop_trait, [ty], self.tcx.param_env(closure_def_id))
                 .must_apply_modulo_regions()
         };