mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 13:13:34 +00:00
Fix doctest
This commit is contained in:
parent
e1d47cd5f1
commit
65694cc6c8
1 changed files with 8 additions and 2 deletions
|
@ -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<TraitRef> {
|
||||
// Get the implemented trait for the current function
|
||||
|
|
Loading…
Reference in a new issue