]> git.proxmox.com Git - rustc.git/blob - tests/ui/fn/implied-bounds-unnorm-associated-type.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / fn / implied-bounds-unnorm-associated-type.rs
1 // check-fail
2 // See issue #91068. We check that the unnormalized associated types in
3 // function signatures are implied
4
5 trait Trait {
6 type Type;
7 }
8
9 impl<T> Trait for T {
10 type Type = ();
11 }
12
13 fn f<'a, 'b>(s: &'b str, _: <&'a &'b () as Trait>::Type) -> &'a str {
14 s
15 }
16
17 fn main() {
18 let x = String::from("Hello World!");
19 let y = f(&x, ());
20 drop(x);
21 //~^ ERROR cannot move out of `x` because it is borrowed
22 println!("{}", y);
23 }