We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1d47cd commit 65694ccCopy full SHA for 65694cc
clippy_lints/src/utils/mod.rs
@@ -306,9 +306,15 @@ pub fn implements_trait<'a, 'tcx>(
306
/// Use this if you want to find the `TraitRef` of the `Point` trait in this example:
307
///
308
/// ```rust
309
-/// trait Point;
+/// struct Point(isize, isize);
310
311
-/// impl std::ops::Add for Point {}
+/// impl std::ops::Add for Point {
312
+/// type Output = Self;
313
+///
314
+/// fn add(self, other: Self) -> Self {
315
+/// Point(0, 0)
316
+/// }
317
318
/// ```
319
pub fn trait_ref_of_method(cx: &LateContext<'_, '_>, hir_id: HirId) -> Option<TraitRef> {
320
// Get the implemented trait for the current function
0 commit comments