2018-08-30 14:18:55 +02:00
|
|
|
//@ run-pass
|
2018-09-25 23:51:35 +02:00
|
|
|
#![allow(dead_code)]
|
2012-05-31 17:41:01 -07:00
|
|
|
// Issue #2263.
|
|
|
|
|
|
|
|
// Here, `f` is a function that takes a pointer `x` and a function
|
|
|
|
// `g`, where `g` requires its argument `y` to be in the same region
|
|
|
|
// that `x` is in.
|
2015-03-22 13:13:15 -07:00
|
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
|
2019-05-28 14:47:21 -04:00
|
|
|
fn has_same_region(f: Box<dyn for<'a> FnMut(&'a isize, Box<dyn FnMut(&'a isize)>)>) {
|
2012-05-31 17:41:01 -07:00
|
|
|
// `f` should be the type that `wants_same_region` wants, but
|
|
|
|
// right now the compiler complains that it isn't.
|
|
|
|
wants_same_region(f);
|
|
|
|
}
|
|
|
|
|
2019-05-28 14:47:21 -04:00
|
|
|
fn wants_same_region(_f: Box<dyn for<'b> FnMut(&'b isize, Box<dyn FnMut(&'b isize)>)>) {
|
2012-05-31 17:41:01 -07:00
|
|
|
}
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() {
|
2012-05-31 17:41:01 -07:00
|
|
|
}
|