2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2018-09-25 21:51:35 +00:00
|
|
|
#![allow(dead_code)]
|
2012-06-01 00:41:01 +00: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 20:13:15 +00:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2019-05-28 18:47:21 +00:00
|
|
|
fn has_same_region(f: Box<dyn for<'a> FnMut(&'a isize, Box<dyn FnMut(&'a isize)>)>) {
|
2012-06-01 00:41:01 +00: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 18:47:21 +00:00
|
|
|
fn wants_same_region(_f: Box<dyn for<'b> FnMut(&'b isize, Box<dyn FnMut(&'b isize)>)>) {
|
2012-06-01 00:41:01 +00:00
|
|
|
}
|
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2012-06-01 00:41:01 +00:00
|
|
|
}
|