diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-11-17 10:24:55 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2022-11-21 20:31:11 +0000 |
| commit | 48ff6a95b559e0c293f4c118145964332994dcc0 (patch) | |
| tree | e93b4f0c5583f9d5b95bc43a0e58a7549f48ae7b | |
| parent | 250dcf421a6db36f85f69c481eab27a0b45887af (diff) | |
| download | rust-48ff6a95b559e0c293f4c118145964332994dcc0.tar.gz rust-48ff6a95b559e0c293f4c118145964332994dcc0.zip | |
Use ty::List instead of InternalSubsts
| -rw-r--r-- | compiler/rustc_lint/src/non_fmt_panic.rs | 9 |
1 files 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; |
