]> git.lizzy.rs Git - rust.git/blob - tests/ui/regions/regions-fn-subtyping-2.rs
internally change regions to be covariant
[rust.git] / tests / ui / regions / regions-fn-subtyping-2.rs
1 // run-pass
2 #![allow(dead_code)]
3 // Issue #2263.
4
5 // Here, `f` is a function that takes a pointer `x` and a function
6 // `g`, where `g` requires its argument `y` to be in the same region
7 // that `x` is in.
8 // pretty-expanded FIXME #23616
9
10 fn has_same_region(f: Box<dyn for<'a> FnMut(&'a isize, Box<dyn FnMut(&'a isize)>)>) {
11     // `f` should be the type that `wants_same_region` wants, but
12     // right now the compiler complains that it isn't.
13     wants_same_region(f);
14 }
15
16 fn wants_same_region(_f: Box<dyn for<'b> FnMut(&'b isize, Box<dyn FnMut(&'b isize)>)>) {
17 }
18
19 pub fn main() {
20 }