1
1
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
7
3
|
8
4
LL | let _ = match_type(cx, ty, &OPTION);
9
5
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Option)`
@@ -16,143 +12,87 @@ LL | #![deny(clippy::internal)]
16
12
= note: `#[deny(clippy::unnecessary_def_path)]` implied by `#[deny(clippy::internal)]`
17
13
18
14
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
24
16
|
25
17
LL | let _ = match_type(cx, ty, RESULT);
26
18
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
27
19
28
20
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
34
22
|
35
23
LL | let _ = match_type(cx, ty, &["core", "result", "Result"]);
36
24
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
37
25
38
26
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
44
28
|
45
29
LL | let _ = clippy_utils::ty::match_type(cx, ty, rc_path);
46
30
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Rc)`
47
31
48
32
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
54
34
|
55
35
LL | let _ = match_type(cx, ty, &paths::OPTION);
56
36
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Option)`
57
37
58
38
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
64
40
|
65
41
LL | let _ = match_type(cx, ty, paths::RESULT);
66
42
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::Result)`
67
43
68
44
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
74
46
|
75
47
LL | let _ = match_type(cx, ty, &["alloc", "boxed", "Box"]);
76
48
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_lang_item(cx, ty, LangItem::OwnedBox)`
77
49
78
50
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
84
52
|
85
53
LL | let _ = match_type(cx, ty, &["core", "mem", "maybe_uninit", "MaybeUninit", "uninit"]);
86
54
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_type_diagnostic_item(cx, ty, sym::maybe_uninit_uninit)`
87
55
88
56
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
94
58
|
95
59
LL | let _ = match_def_path(cx, did, &["alloc", "boxed", "Box"]);
96
60
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.lang_items().get(LangItem::OwnedBox) == Some(did)`
97
61
98
62
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
104
64
|
105
65
LL | let _ = match_def_path(cx, did, &["core", "option", "Option"]);
106
66
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.is_diagnostic_item(sym::Option, did)`
107
67
108
68
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
114
70
|
115
71
LL | let _ = match_def_path(cx, did, &["core", "option", "Option", "Some"]);
116
72
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `cx.tcx.lang_items().get(LangItem::OptionSome) == Some(did)`
117
73
|
118
74
= help: if this `DefId` came from a constructor expression or pattern then the parent `DefId` should be used instead
119
75
120
76
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
126
78
|
127
79
LL | let _ = match_trait_method(cx, expr, &["core", "convert", "AsRef"]);
128
80
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_trait_method(cx, expr, sym::AsRef)`
129
81
130
82
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
136
84
|
137
85
LL | let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option"]);
138
86
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_path_diagnostic_item(cx, expr, sym::Option)`
139
87
140
88
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
146
90
|
147
91
LL | let _ = is_expr_path_def_path(cx, expr, &["core", "iter", "traits", "Iterator", "next"]);
148
92
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `path_res(cx, expr).opt_def_id().map_or(false, |id| cx.tcx.lang_items().get(LangItem::IteratorNext) == Some(id))`
149
93
150
94
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
156
96
|
157
97
LL | let _ = is_expr_path_def_path(cx, expr, &["core", "option", "Option", "Some"]);
158
98
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `is_res_lang_ctor(cx, path_res(cx, expr), LangItem::OptionSome)`
0 commit comments