From 65694cc6c8df092353a3dec046d7101857e979e7 Mon Sep 17 00:00:00 2001 From: Philipp Hansch Date: Fri, 8 Mar 2019 09:10:41 +0100 Subject: [PATCH] Fix doctest --- clippy_lints/src/utils/mod.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/clippy_lints/src/utils/mod.rs b/clippy_lints/src/utils/mod.rs index 6713f4769..7d370b475 100644 --- a/clippy_lints/src/utils/mod.rs +++ b/clippy_lints/src/utils/mod.rs @@ -306,9 +306,15 @@ pub fn implements_trait<'a, 'tcx>( /// Use this if you want to find the `TraitRef` of the `Point` trait in this example: /// /// ```rust -/// trait Point; +/// struct Point(isize, isize); /// -/// impl std::ops::Add for Point {} +/// impl std::ops::Add for Point { +/// type Output = Self; +/// +/// fn add(self, other: Self) -> Self { +/// Point(0, 0) +/// } +/// } /// ``` pub fn trait_ref_of_method(cx: &LateContext<'_, '_>, hir_id: HirId) -> Option { // Get the implemented trait for the current function