]> git.lizzy.rs Git - rust.git/blob - src/test/ui/fn/implied-bounds-unnorm-associated-type-4.rs
Auto merge of #106349 - LeSeulArtichaut:dyn-star-tracking-issue, r=jackh726
[rust.git] / src / test / ui / fn / implied-bounds-unnorm-associated-type-4.rs
1 // A regression test for #98543
2
3 trait Trait {
4     type Type;
5 }
6
7 impl<T> Trait for T {
8     type Type = ();
9 }
10
11 fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str
12 where
13     &'a &'b (): Trait, // <- adding this bound is the change from #91068
14 {
15     s
16 }
17
18 fn main() {
19     let x = String::from("Hello World!");
20     let y = f(&x, ());
21     drop(x);
22     //~^ ERROR cannot move out of `x` because it is borrowed
23     println!("{}", y);
24 }