Skip to content

Commit 48ff6a9

Browse files
committed
Use ty::List instead of InternalSubsts
1 parent 250dcf4 commit 48ff6a9

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

compiler/rustc_lint/src/non_fmt_panic.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use rustc_hir as hir;
55
use rustc_infer::infer::TyCtxtInferExt;
66
use rustc_middle::lint::in_external_macro;
77
use rustc_middle::ty;
8-
use rustc_middle::ty::subst::InternalSubsts;
98
use rustc_parse_format::{ParseMode, Parser, Piece};
109
use rustc_session::lint::FutureIncompatibilityReason;
1110
use rustc_span::edition::Edition;
@@ -154,15 +153,11 @@ fn check_panic<'tcx>(cx: &LateContext<'tcx>, f: &'tcx hir::Expr<'tcx>, arg: &'tc
154153
let infcx = cx.tcx.infer_ctxt().build();
155154
let suggest_display = is_str
156155
|| cx.tcx.get_diagnostic_item(sym::Display).map(|t| {
157-
infcx
158-
.type_implements_trait(t, ty, InternalSubsts::empty(), cx.param_env)
159-
.may_apply()
156+
infcx.type_implements_trait(t, ty, ty::List::empty(), cx.param_env).may_apply()
160157
}) == Some(true);
161158
let suggest_debug = !suggest_display
162159
&& cx.tcx.get_diagnostic_item(sym::Debug).map(|t| {
163-
infcx
164-
.type_implements_trait(t, ty, InternalSubsts::empty(), cx.param_env)
165-
.may_apply()
160+
infcx.type_implements_trait(t, ty, ty::List::empty(), cx.param_env).may_apply()
166161
}) == Some(true);
167162

168163
let suggest_panic_any = !is_str && panic == sym::std_panic_macro;

0 commit comments

Comments
 (0)