Skip to content

Commit 65694cc

Browse files
committed
Fix doctest
1 parent e1d47cd commit 65694cc

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

clippy_lints/src/utils/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,9 +306,15 @@ pub fn implements_trait<'a, 'tcx>(
306306
/// Use this if you want to find the `TraitRef` of the `Point` trait in this example:
307307
///
308308
/// ```rust
309-
/// trait Point;
309+
/// struct Point(isize, isize);
310310
///
311-
/// impl std::ops::Add for Point {}
311+
/// impl std::ops::Add for Point {
312+
/// type Output = Self;
313+
///
314+
/// fn add(self, other: Self) -> Self {
315+
/// Point(0, 0)
316+
/// }
317+
/// }
312318
/// ```
313319
pub fn trait_ref_of_method(cx: &LateContext<'_, '_>, hir_id: HirId) -> Option<TraitRef> {
314320
// Get the implemented trait for the current function

0 commit comments

Comments
 (0)