]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issue-54943-3.rs
Rollup merge of #59057 - czipperz:standardize_range_documentation, r=shepmaster
[rust.git] / src / test / ui / issue-54943-3.rs
1 // compile-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 #![feature(nll)]
8 #![allow(warnings)]
9
10 use std::fmt::Debug;
11
12 fn foo<T: 'static + Debug>(_: T) { }
13
14 fn bar<'a>() {
15     return;
16
17     let _x = foo::<Vec<_>>(Vec::<&'a u32>::new());
18     //~^ ERROR the type `&'a u32` does not fulfill the required lifetime [E0477]
19 }
20
21 fn main() {}