]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/type-test-universe.rs
Rollup merge of #103644 - catlee:catlee/option-question-mark-docs, r=workingjubilee
[rust.git] / src / test / ui / nll / type-test-universe.rs
1 // Regression test for #98095: make sure that
2 // we detect that S needs to outlive 'static.
3
4 fn outlives_forall<T>()
5 where
6     for<'u> T: 'u,
7 {
8 }
9
10 fn test1<S>() {
11     outlives_forall::<S>();
12     //~^ ERROR `S` does not live long enough
13 }
14
15 struct Value<'a>(&'a ());
16 fn test2<'a>() {
17     outlives_forall::<Value<'a>>();
18     //~^ ERROR lifetime may not live long enough
19 }
20
21 fn main() {}