]> git.proxmox.com Git - rustc.git/blob - src/test/ui/generic-associated-types/bugs/hrtb-implied-3.rs
New upstream version 1.65.0+dfsg1
[rustc.git] / src / test / 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() {}