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-20 01:39:15 +00:00
fn id<T>(t: T) -> T { t }
2019-05-28 18:46:13 +00:00
fn f<'r, T>(v: &'r T) -> Box<dyn FnMut() -> T + 'r> {
id(Box::new(|| *v))
//~^ ERROR E0507
}
2013-01-20 01:39:15 +00:00
fn main() {
2015-01-31 16:23:42 +00:00
let v = &5;
2015-01-03 15:45:00 +00:00
println!("{}", f(v).call_mut(()));
}