]> git.lizzy.rs Git - rust.git/blob - tests/ui/wf/wf-in-fn-type-static.rs
Rollup merge of #107389 - zvavybir:master, r=estebank
[rust.git] / tests / ui / wf / wf-in-fn-type-static.rs
1 // Check that we enforce WF conditions related to regions also for
2 // types in fns.
3
4 #![allow(dead_code)]
5
6
7 struct MustBeCopy<T:Copy> {
8     t: T
9 }
10
11 struct Foo<T> {
12     // needs T: 'static
13     x: fn() -> &'static T //~ ERROR E0310
14 }
15
16 struct Bar<T> {
17     // needs T: Copy
18     x: fn(&'static T) //~ ERROR E0310
19 }
20
21
22 fn main() { }