diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-14 18:24:42 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-14 18:24:42 +0100 |
| commit | 7e0127b2aee220222c044aa55039e45a6be7be87 (patch) | |
| tree | 84a72cb5b07166820b1fe66ed733f827c85da2ea /compiler/rustc_lint/src | |
| parent | 74d018e3173d5d56a50cf366a42b740ec53c5c13 (diff) | |
| parent | 3504c408f0af5f9a81c55a2bd1de14c68b70a291 (diff) | |
| download | rust-7e0127b2aee220222c044aa55039e45a6be7be87.tar.gz rust-7e0127b2aee220222c044aa55039e45a6be7be87.zip | |
Rollup merge of #108007 - compiler-errors:str-less-kind, r=Nilstrieb
Use `is_str` instead of string kind comparison Split out from #107939
Diffstat (limited to 'compiler/rustc_lint/src')
| -rw-r--r-- | compiler/rustc_lint/src/non_fmt_panic.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_lint/src/non_fmt_panic.rs b/compiler/rustc_lint/src/non_fmt_panic.rs index 4a02c6cce47..548f30ec972 100644 --- a/compiler/rustc_lint/src/non_fmt_panic.rs +++ b/compiler/rustc_lint/src/non_fmt_panic.rs @@ -146,7 +146,7 @@ fn check_panic<'tcx>(cx: &LateContext<'tcx>, f: &'tcx hir::Expr<'tcx>, arg: &'tc // If this is a &str or String, we can confidently give the `"{}", ` suggestion. let is_str = matches!( ty.kind(), - ty::Ref(_, r, _) if *r.kind() == ty::Str, + ty::Ref(_, r, _) if r.is_str(), ) || matches!( ty.ty_adt_def(), Some(ty_def) if Some(ty_def.did()) == cx.tcx.lang_items().string(), |
