]> git.lizzy.rs Git - rust.git/blob - tests/ui/generic-associated-types/bugs/hrtb-implied-3.rs
Rollup merge of #107112 - eltociear:patch-19, r=albertlarsan68
[rust.git] / tests / ui / generic-associated-types / bugs / hrtb-implied-3.rs
1 trait LendingIterator {
2     type Item<'a>
3     where
4         Self: 'a;
5 }
6
7 impl LendingIterator for &str {
8     type Item<'a> = () where Self:'a;
9 }
10
11 fn trivial_bound<I>(_: I)
12 where
13     I: LendingIterator,
14     for<'a> I::Item<'a>: Sized,
15 {
16 }
17
18 fn fails(iter: &str) {
19     trivial_bound(iter);
20     //~^ borrowed data escapes
21 }
22
23 fn main() {}