Skip to content

Commit 08f28f9

Browse files
committed
Use List::empty() instead of mk_substs(&[]).
1 parent c09f5b6 commit 08f28f9

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

compiler/rustc_codegen_gcc/src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ impl<'gcc, 'tcx> MiscMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
383383
tcx,
384384
ty::ParamEnv::reveal_all(),
385385
def_id,
386-
tcx.mk_substs(&[]),
386+
ty::List::empty(),
387387
)
388388
.unwrap().unwrap(),
389389
),

compiler/rustc_codegen_llvm/src/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ impl<'ll, 'tcx> MiscMethods<'tcx> for CodegenCx<'ll, 'tcx> {
520520
let tcx = self.tcx;
521521
let llfn = match tcx.lang_items().eh_personality() {
522522
Some(def_id) if !wants_msvc_seh(self.sess()) => self.get_fn_addr(
523-
ty::Instance::resolve(tcx, ty::ParamEnv::reveal_all(), def_id, tcx.mk_substs(&[]))
523+
ty::Instance::resolve(tcx, ty::ParamEnv::reveal_all(), def_id, ty::List::empty())
524524
.unwrap()
525525
.unwrap(),
526526
),

compiler/rustc_lint/src/builtin.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -677,21 +677,21 @@ impl<'tcx> LateLintPass<'tcx> for MissingCopyImplementations {
677677
return;
678678
}
679679
let def = cx.tcx.adt_def(item.owner_id);
680-
(def, cx.tcx.mk_adt(def, cx.tcx.mk_substs(&[])))
680+
(def, cx.tcx.mk_adt(def, ty::List::empty()))
681681
}
682682
hir::ItemKind::Union(_, ref ast_generics) => {
683683
if !ast_generics.params.is_empty() {
684684
return;
685685
}
686686
let def = cx.tcx.adt_def(item.owner_id);
687-
(def, cx.tcx.mk_adt(def, cx.tcx.mk_substs(&[])))
687+
(def, cx.tcx.mk_adt(def, ty::List::empty()))
688688
}
689689
hir::ItemKind::Enum(_, ref ast_generics) => {
690690
if !ast_generics.params.is_empty() {
691691
return;
692692
}
693693
let def = cx.tcx.adt_def(item.owner_id);
694-
(def, cx.tcx.mk_adt(def, cx.tcx.mk_substs(&[])))
694+
(def, cx.tcx.mk_adt(def, ty::List::empty()))
695695
}
696696
_ => return,
697697
};

compiler/rustc_middle/src/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2530,7 +2530,7 @@ impl<'tcx> ConstantKind<'tcx> {
25302530
{
25312531
InternalSubsts::identity_for_item(tcx, parent_did.to_def_id())
25322532
} else {
2533-
tcx.mk_substs(&[])
2533+
List::empty()
25342534
};
25352535
debug!(?parent_substs);
25362536

src/tools/clippy/clippy_utils/src/consts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ pub fn constant<'tcx>(
237237
typeck_results,
238238
param_env: lcx.param_env,
239239
needed_resolution: false,
240-
substs: lcx.tcx.mk_substs(&[]),
240+
substs: ty::List::empty(),
241241
};
242242
cx.expr(e).map(|cst| (cst, cx.needed_resolution))
243243
}
@@ -306,7 +306,7 @@ pub fn constant_context<'a, 'tcx>(
306306
typeck_results,
307307
param_env: lcx.param_env,
308308
needed_resolution: false,
309-
substs: lcx.tcx.mk_substs(&[]),
309+
substs: ty::List::empty(),
310310
}
311311
}
312312

0 commit comments

Comments
 (0)