rust/tests/ui/issues/issue-4335.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
226 B
Rust
Raw Normal View History

#![feature(fn_traits)]
2013-01-19 19:39:15 -06:00
fn id<T>(t: T) -> T { t }
2019-05-28 13:46:13 -05:00
fn f<'r, T>(v: &'r T) -> Box<dyn FnMut() -> T + 'r> {
id(Box::new(|| *v))
//~^ ERROR E0507
}
2013-01-19 19:39:15 -06:00
fn main() {
2015-01-31 10:23:42 -06:00
let v = &5;
2015-01-03 09:45:00 -06:00
println!("{}", f(v).call_mut(()));
}