@@ -123,7 +123,8 @@ There are three ways to do this, depending on if the target trait has a
123
123
diagnostic item, lang item or neither.
124
124
125
125
``` rust
126
- use clippy_utils :: {implements_trait, is_trait_method, match_trait_method, paths};
126
+ use clippy_utils :: ty :: implements_trait;
127
+ use clippy_utils :: is_trait_method;
127
128
use rustc_span :: symbol :: sym;
128
129
129
130
impl LateLintPass <'_ > for MyStructLint {
@@ -143,13 +144,6 @@ impl LateLintPass<'_> for MyStructLint {
143
144
. map_or (false , | id | implements_trait (cx , ty , id , & [])) {
144
145
// `expr` implements `Drop` trait
145
146
}
146
-
147
- // 3. Using the type path with the expression
148
- // we use `match_trait_method` function from Clippy's utils
149
- // (This method should be avoided if possible)
150
- if match_trait_method (cx , expr , & paths :: INTO ) {
151
- // `expr` implements `Into` trait
152
- }
153
147
}
154
148
}
155
149
```
@@ -233,8 +227,9 @@ functions to deal with macros:
233
227
crates
234
228
235
229
``` rust
236
- #[macro_use]
237
- extern crate a_crate_with_macros;
230
+ use rustc_middle :: lint :: in_external_macro;
231
+
232
+ use a_crate_with_macros :: foo;
238
233
239
234
// `foo` is defined in `a_crate_with_macros`
240
235
foo! (" bar" );
0 commit comments