From 48ff6a95b559e0c293f4c118145964332994dcc0 Mon Sep 17 00:00:00 2001 From: Oli Scherer Date: Thu, 17 Nov 2022 10:24:55 +0000 Subject: [PATCH] Use ty::List instead of InternalSubsts --- compiler/rustc_lint/src/non_fmt_panic.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_lint/src/non_fmt_panic.rs b/compiler/rustc_lint/src/non_fmt_panic.rs index 83e6f4e33be..d733eebcad6 100644 --- a/compiler/rustc_lint/src/non_fmt_panic.rs +++ b/compiler/rustc_lint/src/non_fmt_panic.rs @@ -5,7 +5,6 @@ use rustc_hir as hir; use rustc_infer::infer::TyCtxtInferExt; use rustc_middle::lint::in_external_macro; use rustc_middle::ty; -use rustc_middle::ty::subst::InternalSubsts; use rustc_parse_format::{ParseMode, Parser, Piece}; use rustc_session::lint::FutureIncompatibilityReason; use rustc_span::edition::Edition; @@ -154,15 +153,11 @@ fn check_panic<'tcx>(cx: &LateContext<'tcx>, f: &'tcx hir::Expr<'tcx>, arg: &'tc let infcx = cx.tcx.infer_ctxt().build(); let suggest_display = is_str || cx.tcx.get_diagnostic_item(sym::Display).map(|t| { - infcx - .type_implements_trait(t, ty, InternalSubsts::empty(), cx.param_env) - .may_apply() + infcx.type_implements_trait(t, ty, ty::List::empty(), cx.param_env).may_apply() }) == Some(true); let suggest_debug = !suggest_display && cx.tcx.get_diagnostic_item(sym::Debug).map(|t| { - infcx - .type_implements_trait(t, ty, InternalSubsts::empty(), cx.param_env) - .may_apply() + infcx.type_implements_trait(t, ty, ty::List::empty(), cx.param_env).may_apply() }) == Some(true); let suggest_panic_any = !is_str && panic == sym::std_panic_macro;