diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-4335.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-4335.rs b/src/test/ui/issues/issue-4335.rs new file mode 100644 index 000000000..c5914a17c --- /dev/null +++ b/src/test/ui/issues/issue-4335.rs @@ -0,0 +1,13 @@ +#![feature(fn_traits)] + +fn id<T>(t: T) -> T { t } + +fn f<'r, T>(v: &'r T) -> Box<dyn FnMut() -> T + 'r> { + id(Box::new(|| *v)) + //~^ ERROR E0507 +} + +fn main() { + let v = &5; + println!("{}", f(v).call_mut(())); +} |