| @@ -2,9 +2,9 @@ use clippy_utils::diagnostics::{span_lint_and_sugg, span_lint_and_then}; |
|
|
| 2 |
2 |
use clippy_utils::is_inside_always_const_context; |
| 3 |
3 |
use clippy_utils::msrvs::{self, Msrv}; |
| 4 |
4 |
use clippy_utils::source::snippet_with_applicability; |
| 5 |
|
-use clippy_utils::ty::is_type_diagnostic_item; |
|
5 |
+use clippy_utils::ty::is_type_lang_item; |
| 6 |
6 |
use rustc_errors::Applicability; |
| 7 |
|
-use rustc_hir::{Block, BlockCheckMode, Expr, ExprKind, Node, QPath, UnsafeSource}; |
|
7 |
+use rustc_hir::{Block, BlockCheckMode, Expr, ExprKind, LangItem, Node, QPath, UnsafeSource}; |
| 8 |
8 |
use rustc_lint::LateContext; |
| 9 |
9 |
use rustc_span::sym; |
| 10 |
10 |
|
| @@ -15,7 +15,7 @@ pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, func: &Expr<' |
|
|
| 15 |
15 |
&& segment.ident.name == sym::new_unchecked |
| 16 |
16 |
&& let [init_arg] = args |
| 17 |
17 |
&& is_inside_always_const_context(cx.tcx, expr.hir_id) |
| 18 |
|
- && is_type_diagnostic_item(cx, cx.typeck_results().node_type(ty.hir_id), sym::NonZero) |
|
18 |
+ && is_type_lang_item(cx, cx.typeck_results().node_type(ty.hir_id), LangItem::NonZero) |
| 19 |
19 |
&& msrv.meets(cx, msrvs::CONST_UNWRAP) |
| 20 |
20 |
{ |
| 21 |
21 |
let mut app = Applicability::MachineApplicable; |