11error: use of a def path to a diagnostic item
2- <<<<<<< HEAD
3- --> tests/ui-internal/unnecessary_def_path.rs:36:13
4- =======
5- --> $DIR/unnecessary_def_path.rs:37:13
6- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
2+ --> tests/ui-internal/unnecessary_def_path.rs:37:13
73 |
84LL | let _ = match_type(cx, ty, &OPTION);
95 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Option)`
@@ -16,143 +12,87 @@ LL | #![deny(clippy::internal)]
1612 = note: `#[deny(clippy::unnecessary_def_path)]` implied by `#[deny(clippy::internal)]`
1713
1814error: use of a def path to a diagnostic item
19- <<<<<<< HEAD
20- --> tests/ui-internal/unnecessary_def_path.rs:37:13
21- =======
22- --> $DIR/unnecessary_def_path.rs:38:13
23- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
15+ --> tests/ui-internal/unnecessary_def_path.rs:38:13
2416 |
2517LL | let _ = match_type(cx, ty, RESULT);
2618 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
2719
2820error: use of a def path to a diagnostic item
29- <<<<<<< HEAD
30- --> tests/ui-internal/unnecessary_def_path.rs:38:13
31- =======
32- --> $DIR/unnecessary_def_path.rs:39:13
33- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
21+ --> tests/ui-internal/unnecessary_def_path.rs:39:13
3422 |
3523LL | let _ = match_type(cx, ty, &["core", "result", "Result"]);
3624 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
3725
3826error: use of a def path to a diagnostic item
39- <<<<<<< HEAD
40- --> tests/ui-internal/unnecessary_def_path.rs:42:13
41- =======
42- --> $DIR/unnecessary_def_path.rs:43:13
43- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
27+ --> tests/ui-internal/unnecessary_def_path.rs:43:13
4428 |
4529LL | let _ = clippy_utils::ty::match_type(cx, ty, rc_path);
4630 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Rc)`
4731
4832error: use of a def path to a diagnostic item
49- <<<<<<< HEAD
50- --> tests/ui-internal/unnecessary_def_path.rs:44:13
51- =======
52- --> $DIR/unnecessary_def_path.rs:45:13
53- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
33+ --> tests/ui-internal/unnecessary_def_path.rs:45:13
5434 |
5535LL | let _ = match_type(cx, ty, &paths::OPTION);
5636 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Option)`
5737
5838error: use of a def path to a diagnostic item
59- <<<<<<< HEAD
60- --> tests/ui-internal/unnecessary_def_path.rs:45:13
61- =======
62- --> $DIR/unnecessary_def_path.rs:46:13
63- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
39+ --> tests/ui-internal/unnecessary_def_path.rs:46:13
6440 |
6541LL | let _ = match_type(cx, ty, paths::RESULT);
6642 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
6743
6844error: use of a def path to a `LangItem`
69- <<<<<<< HEAD
70- --> tests/ui-internal/unnecessary_def_path.rs:47:13
71- =======
72- --> $DIR/unnecessary_def_path.rs:48:13
73- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
45+ --> tests/ui-internal/unnecessary_def_path.rs:48:13
7446 |
7547LL | let _ = match_type(cx, ty, &["alloc", "boxed", "Box"]);
7648 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_lang_item(cx, ty, LangItem::OwnedBox)`
7749
7850error: use of a def path to a diagnostic item
79- <<<<<<< HEAD
80- --> tests/ui-internal/unnecessary_def_path.rs:48:13
81- =======
82- --> $DIR/unnecessary_def_path.rs:49:13
83- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
51+ --> tests/ui-internal/unnecessary_def_path.rs:49:13
8452 |
8553LL | let _ = match_type(cx, ty, &["core", "mem", "maybe_uninit", "MaybeUninit", "uninit"]);
8654 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::maybe_uninit_uninit)`
8755
8856error: use of a def path to a `LangItem`
89- <<<<<<< HEAD
90- --> tests/ui-internal/unnecessary_def_path.rs:50:13
91- =======
92- --> $DIR/unnecessary_def_path.rs:51:13
93- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
57+ --> tests/ui-internal/unnecessary_def_path.rs:51:13
9458 |
9559LL | let _ = match_def_path(cx, did, &["alloc", "boxed", "Box"]);
9660 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.lang_items().get(LangItem::OwnedBox) == Some(did)`
9761
9862error: use of a def path to a diagnostic item
99- <<<<<<< HEAD
100- --> tests/ui-internal/unnecessary_def_path.rs:51:13
101- =======
102- --> $DIR/unnecessary_def_path.rs:52:13
103- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
63+ --> tests/ui-internal/unnecessary_def_path.rs:52:13
10464 |
10565LL | let _ = match_def_path(cx, did, &["core", "option", "Option"]);
10666 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.is_diagnostic_item(sym::Option, did)`
10767
10868error: use of a def path to a `LangItem`
109- <<<<<<< HEAD
110- --> tests/ui-internal/unnecessary_def_path.rs:52:13
111- =======
112- --> $DIR/unnecessary_def_path.rs:53:13
113- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
69+ --> tests/ui-internal/unnecessary_def_path.rs:53:13
11470 |
11571LL | let _ = match_def_path(cx, did, &["core", "option", "Option", "Some"]);
11672 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.lang_items().get(LangItem::OptionSome) == Some(did)`
11773 |
11874 = help: if this `DefId` came from a constructor expression or pattern then the parent `DefId` should be used instead
11975
12076error: use of a def path to a diagnostic item
121- <<<<<<< HEAD
122- --> tests/ui-internal/unnecessary_def_path.rs:54:13
123- =======
124- --> $DIR/unnecessary_def_path.rs:55:13
125- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
77+ --> tests/ui-internal/unnecessary_def_path.rs:55:13
12678 |
12779LL | let _ = match_trait_method(cx, expr, &["core", "convert", "AsRef"]);
12880 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_trait_method(cx, expr, sym::AsRef)`
12981
13082error: use of a def path to a diagnostic item
131- <<<<<<< HEAD
132- --> tests/ui-internal/unnecessary_def_path.rs:56:13
133- =======
134- --> $DIR/unnecessary_def_path.rs:57:13
135- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
83+ --> tests/ui-internal/unnecessary_def_path.rs:57:13
13684 |
13785LL | let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option"]);
13886 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_path_diagnostic_item(cx, expr, sym::Option)`
13987
14088error: use of a def path to a `LangItem`
141- <<<<<<< HEAD
142- --> tests/ui-internal/unnecessary_def_path.rs:57:13
143- =======
144- --> $DIR/unnecessary_def_path.rs:58:13
145- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
89+ --> tests/ui-internal/unnecessary_def_path.rs:58:13
14690 |
14791LL | let _ = is_expr_path_def_path(cx, expr, &["core", "iter", "traits", "Iterator", "next"]);
14892 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `path_res(cx, expr).opt_def_id().map_or(false, |id| cx.tcx.lang_items().get(LangItem::IteratorNext) == Some(id))`
14993
15094error: use of a def path to a `LangItem`
151- <<<<<<< HEAD
152- --> tests/ui-internal/unnecessary_def_path.rs:58:13
153- =======
154- --> $DIR/unnecessary_def_path.rs:59:13
155- >>>>>>> c1f4d04ab (new lint `unnecessary_map_or`)
95+ --> tests/ui-internal/unnecessary_def_path.rs:59:13
15696 |
15797LL | let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option", "Some"]);
15898 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_res_lang_ctor(cx, path_res(cx, expr), LangItem::OptionSome)`
0 commit comments