]> git.lizzy.rs Git - rust.git/blob - src/test/ui/single-use-lifetime/two-uses-in-inherent-method-argument-and-return.rs
Merge commit 'e18101137866b79045fee0ef996e696e68c920b4' into clippyup
[rust.git] / src / test / ui / single-use-lifetime / two-uses-in-inherent-method-argument-and-return.rs
1 // Test that we DO NOT warn for a lifetime used twice in an impl method and
2 // header.
3
4 #![deny(single_use_lifetimes)]
5 #![allow(dead_code)]
6 #![allow(unused_variables)]
7
8 struct Foo<'f> {
9     data: &'f u32
10 }
11
12 impl<'f> Foo<'f> { //~ ERROR `'f` only used once
13     fn inherent_a<'a>(&self, data: &'a u32) -> &'a u32{
14       data
15     }
16 }
17
18 fn main() { }