diff options
Diffstat (limited to 'tests/ui/closure_context/issue-26046-fn-once.rs')
-rw-r--r-- | tests/ui/closure_context/issue-26046-fn-once.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ui/closure_context/issue-26046-fn-once.rs b/tests/ui/closure_context/issue-26046-fn-once.rs new file mode 100644 index 000000000..511690e9d --- /dev/null +++ b/tests/ui/closure_context/issue-26046-fn-once.rs @@ -0,0 +1,11 @@ +fn get_closure() -> Box<dyn Fn() -> Vec<u8>> { + let vec = vec![1u8, 2u8]; + + let closure = move || { //~ ERROR expected a closure + vec + }; + + Box::new(closure) +} + +fn main() {} |