]> git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/issue-54943-3.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / ui / nll / issue-54943-3.rs
1 // check-pass
2 // FIXME(#54943) This test targets the scenario where proving the WF requirements requires
3 // knowing the value of the `_` type present in the user type annotation - unfortunately, figuring
4 // out the value of that `_` requires type-checking the surrounding code, but that code is dead,
5 // so our NLL region checker doesn't have access to it. This test should actually fail to compile.
6
7 #![allow(warnings)]
8
9 use std::fmt::Debug;
10
11 fn foo<T: 'static + Debug>(_: T) { }
12
13 fn bar<'a>() {
14 return;
15
16 let _x = foo::<Vec<_>>(Vec::<&'a u32>::new());
17 }
18
19 fn main() {}