about summary refs log tree commit diff
path: root/src/tools/clippy/tests/ui/useful_asref.rs
blob: a37c2785bde2ac4f868937a02433a47d7b59a07c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//@ check-pass

#![deny(clippy::useless_asref)]
#![allow(clippy::needless_lifetimes)]

trait Trait {
    fn as_ptr(&self);
}

impl<'a> Trait for &'a [u8] {
    fn as_ptr(&self) {
        self.as_ref().as_ptr();
    }
}

fn main() {}