1 error: use of a def path to a diagnostic item
2 --> $DIR/unnecessary_def_path.rs:37:13
4 LL | let _ = match_type(cx, ty, &OPTION);
5 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Option)`
7 note: the lint level is defined here
8 --> $DIR/unnecessary_def_path.rs:3:9
10 LL | #![deny(clippy::internal)]
12 = note: `#[deny(clippy::unnecessary_def_path)]` implied by `#[deny(clippy::internal)]`
14 error: use of a def path to a diagnostic item
15 --> $DIR/unnecessary_def_path.rs:38:13
17 LL | let _ = match_type(cx, ty, RESULT);
18 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
20 error: use of a def path to a diagnostic item
21 --> $DIR/unnecessary_def_path.rs:39:13
23 LL | let _ = match_type(cx, ty, &["core", "result", "Result"]);
24 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
26 error: use of a def path to a diagnostic item
27 --> $DIR/unnecessary_def_path.rs:43:13
29 LL | let _ = clippy_utils::ty::match_type(cx, ty, rc_path);
30 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Rc)`
32 error: use of a def path to a diagnostic item
33 --> $DIR/unnecessary_def_path.rs:45:13
35 LL | let _ = match_type(cx, ty, &paths::OPTION);
36 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Option)`
38 error: use of a def path to a diagnostic item
39 --> $DIR/unnecessary_def_path.rs:46:13
41 LL | let _ = match_type(cx, ty, paths::RESULT);
42 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
44 error: use of a def path to a `LangItem`
45 --> $DIR/unnecessary_def_path.rs:48:13
47 LL | let _ = match_type(cx, ty, &["alloc", "boxed", "Box"]);
48 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_lang_item(cx, ty, LangItem::OwnedBox)`
50 error: use of a def path to a diagnostic item
51 --> $DIR/unnecessary_def_path.rs:49:13
53 LL | let _ = match_type(cx, ty, &["core", "mem", "maybe_uninit", "MaybeUninit", "uninit"]);
54 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::maybe_uninit_uninit)`
56 error: use of a def path to a `LangItem`
57 --> $DIR/unnecessary_def_path.rs:51:13
59 LL | let _ = match_def_path(cx, did, &["alloc", "boxed", "Box"]);
60 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.lang_items().get(LangItem::OwnedBox) == Some(did)`
62 error: use of a def path to a diagnostic item
63 --> $DIR/unnecessary_def_path.rs:52:13
65 LL | let _ = match_def_path(cx, did, &["core", "option", "Option"]);
66 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.is_diagnostic_item(sym::Option, did)`
68 error: use of a def path to a `LangItem`
69 --> $DIR/unnecessary_def_path.rs:53:13
71 LL | let _ = match_def_path(cx, did, &["core", "option", "Option", "Some"]);
72 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.lang_items().get(LangItem::OptionSome) == Some(did)`
74 = help: if this `DefId` came from a constructor expression or pattern then the parent `DefId` should be used instead
76 error: use of a def path to a diagnostic item
77 --> $DIR/unnecessary_def_path.rs:55:13
79 LL | let _ = match_trait_method(cx, expr, &["core", "convert", "AsRef"]);
80 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_trait_method(cx, expr, sym::AsRef)`
82 error: use of a def path to a diagnostic item
83 --> $DIR/unnecessary_def_path.rs:57:13
85 LL | let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option"]);
86 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_path_diagnostic_item(cx, expr, sym::Option)`
88 error: use of a def path to a `LangItem`
89 --> $DIR/unnecessary_def_path.rs:58:13
91 LL | let _ = is_expr_path_def_path(cx, expr, &["core", "iter", "traits", "Iterator", "next"]);
92 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `path_res(cx, expr).opt_def_id().map_or(false, |id| cx.tcx.lang_items().get(LangItem::IteratorNext) == Some(id))`
94 error: use of a def path to a `LangItem`
95 --> $DIR/unnecessary_def_path.rs:59:13
97 LL | let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option", "Some"]);
98 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_res_lang_ctor(cx, path_res(cx, expr), LangItem::OptionSome)`
100 error: aborting due to 15 previous errors