]> git.lizzy.rs Git - rust.git/blob - tests/ui/single-use-lifetime/two-uses-in-trait-impl.rs
Rollup merge of #105526 - Xiretza:iter-from-generator-derive, r=scottmcm
[rust.git] / tests / ui / single-use-lifetime / two-uses-in-trait-impl.rs
1 // Test that we DO NOT warn for a lifetime on an impl used in both
2 // header and in an associated type.
3 //
4 // check-pass
5
6 #![deny(single_use_lifetimes)]
7 #![allow(dead_code)]
8 #![allow(unused_variables)]
9
10 struct Foo<'f> {
11     data: &'f u32,
12 }
13
14 impl<'f> Iterator for Foo<'f> {
15     type Item = &'f u32;
16
17     fn next(&mut self) -> Option<Self::Item> {
18         None
19     }
20 }
21
22 fn main() {}