You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -53,7 +53,7 @@ For instance, if we want to examine whether an expression `expr` implements
53
53
we can check that the `Ty` of the `expr` implements the trait:
54
54
55
55
```rust
56
-
useclippy_utils::implements_trait;
56
+
useclippy_utils::ty::implements_trait;
57
57
userustc_hir::Expr;
58
58
userustc_lint::{LateContext, LateLintPass};
59
59
@@ -79,7 +79,8 @@ If neither diagnostic item nor a language item is available, we can use
79
79
Below, we check if the given `expr` implements [`core::iter::Step`](https://doc.rust-lang.org/std/iter/trait.Step.html):
80
80
81
81
```rust
82
-
useclippy_utils::{implements_trait, paths};
82
+
useclippy_utils::paths;
83
+
useclippy_utils::ty::implements_trait;
83
84
userustc_hir::Expr;
84
85
userustc_lint::{LateContext, LateLintPass};
85
86
@@ -124,8 +125,8 @@ The following code demonstrates how to do this:
124
125
```rust
125
126
126
127
userustc_middle::ty::Ty;
128
+
useclippy_utils::sym;
127
129
useclippy_utils::ty::implements_trait;
128
-
userustc_span::symbol::sym;
129
130
130
131
letty=todo!("Get the `Foo` type to check for a trait implementation");
131
132
letborrow_id=cx.tcx.get_diagnostic_item(sym::Borrow).unwrap(); // avoid unwrap in real code
0 commit comments