]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_hir_typeck/src/upvar.rs
Check that type_implements_trait actually is passed the right amount of generic params
[rust.git] / compiler / rustc_hir_typeck / src / upvar.rs
index 4dea40829f6221a2b4e4400789676b9bd5b8b4ce..090c73d1638a63114550e54ede53a2d4671aa772 100644 (file)
@@ -973,7 +973,7 @@ fn compute_2229_migrations_for_trait(
                             .type_implements_trait(
                                 check_trait,
                                 ty,
-                                self.tcx.mk_substs_trait(ty, &[]),
+                                ty::List::empty(),
                                 self.param_env,
                             )
                             .must_apply_modulo_regions()
@@ -1002,7 +1002,7 @@ fn compute_2229_migrations_for_trait(
                                 .type_implements_trait(
                                     check_trait,
                                     ty,
-                                    self.tcx.mk_substs_trait(ty, &[]),
+                                    ty::List::empty(),
                                     self.param_env,
                                 )
                                 .must_apply_modulo_regions()
@@ -1347,12 +1347,11 @@ 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,
+                    ty::List::empty(),
                     self.tcx.param_env(closure_def_id),
                 )
                 .must_apply_modulo_regions()