]> git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/relate_tys/trait-hrtb.rs
New upstream version 1.67.1+dfsg1
[rustc.git] / src / test / ui / nll / relate_tys / trait-hrtb.rs
1 // Test that NLL generates proper error spans for trait HRTB errors
2 //
3 // compile-flags:-Zno-leak-check
4
5 trait Foo<'a> {}
6
7 fn make_foo<'a>() -> Box<dyn Foo<'a>> {
8 panic!()
9 }
10
11 fn main() {
12 let x: Box<dyn Foo<'static>> = make_foo();
13 let y: Box<dyn for<'a> Foo<'a>> = x; //~ ERROR mismatched types [E0308]
14 }