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