Skip to content

Commit c7d5771

Browse files
committed
re-bless internal and update_lints
1 parent e128c6a commit c7d5771

File tree

2 files changed

+16
-75
lines changed

2 files changed

+16
-75
lines changed

clippy_lints/src/declared_lints.rs

+1
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
474474
crate::methods::UNNECESSARY_MIN_OR_MAX_INFO,
475475
crate::methods::UNNECESSARY_RESULT_MAP_OR_ELSE_INFO,
476476
crate::methods::UNNECESSARY_MAP_OR_INFO,
477+
crate::methods::UNNECESSARY_RESULT_MAP_OR_ELSE_INFO,
477478
crate::methods::UNNECESSARY_SORT_BY_INFO,
478479
crate::methods::UNNECESSARY_TO_OWNED_INFO,
479480
crate::methods::UNWRAP_OR_DEFAULT_INFO,

tests/ui-internal/unnecessary_def_path.stderr

+15-75
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
error: 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
|
84
LL | 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

1814
error: 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
|
2517
LL | let _ = match_type(cx, ty, RESULT);
2618
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
2719

2820
error: 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
|
3523
LL | let _ = match_type(cx, ty, &["core", "result", "Result"]);
3624
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
3725

3826
error: 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
|
4529
LL | let _ = clippy_utils::ty::match_type(cx, ty, rc_path);
4630
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Rc)`
4731

4832
error: 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
|
5535
LL | let _ = match_type(cx, ty, &paths::OPTION);
5636
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Option)`
5737

5838
error: 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
|
6541
LL | let _ = match_type(cx, ty, paths::RESULT);
6642
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
6743

6844
error: 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
|
7547
LL | let _ = match_type(cx, ty, &["alloc", "boxed", "Box"]);
7648
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_lang_item(cx, ty, LangItem::OwnedBox)`
7749

7850
error: 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
|
8553
LL | 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

8856
error: 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
|
9559
LL | let _ = match_def_path(cx, did, &["alloc", "boxed", "Box"]);
9660
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.lang_items().get(LangItem::OwnedBox) == Some(did)`
9761

9862
error: 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
|
10565
LL | let _ = match_def_path(cx, did, &["core", "option", "Option"]);
10666
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.is_diagnostic_item(sym::Option, did)`
10767

10868
error: 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
|
11571
LL | 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

12076
error: 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
|
12779
LL | let _ = match_trait_method(cx, expr, &["core", "convert", "AsRef"]);
12880
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_trait_method(cx, expr, sym::AsRef)`
12981

13082
error: 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
|
13785
LL | let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option"]);
13886
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_path_diagnostic_item(cx, expr, sym::Option)`
13987

14088
error: 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
|
14791
LL | 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

15094
error: 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
|
15797
LL | 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

Comments
 (0)