Fix doctest

This commit is contained in:
Philipp Hansch 2019-03-08 09:10:41 +01:00
parent e1d47cd5f1
commit 65694cc6c8
No known key found for this signature in database
GPG key ID: B6FA06A6E0E2665B

View file

@ -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