2016-11-15 10:19:37 -06:00
|
|
|
// Make sure #1399 stays fixed
|
|
|
|
|
|
|
|
#[allow(dead_code)]
|
2022-06-20 18:00:37 -05:00
|
|
|
struct A {
|
|
|
|
a: Box<isize>,
|
|
|
|
}
|
2016-11-15 10:19:37 -06:00
|
|
|
|
2019-05-30 03:58:30 -05:00
|
|
|
fn foo() -> Box<dyn FnMut() -> isize + 'static> {
|
2016-11-15 10:19:37 -06:00
|
|
|
let k: Box<_> = Box::new(22);
|
2022-06-20 18:00:37 -05:00
|
|
|
let _u = A { a: k.clone() };
|
|
|
|
let result = || 22;
|
2016-11-15 10:19:37 -06:00
|
|
|
Box::new(result)
|
|
|
|
}
|
|
|
|
|
|
|
|
pub fn main() {
|
|
|
|
assert_eq!(foo()(), 22);
|
|
|
|
}
|