diff options
Diffstat (limited to 'tests/ui/closures/capture-unsized-by-ref.rs')
-rw-r--r-- | tests/ui/closures/capture-unsized-by-ref.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/closures/capture-unsized-by-ref.rs b/tests/ui/closures/capture-unsized-by-ref.rs new file mode 100644 index 000000000..c9e4a5903 --- /dev/null +++ b/tests/ui/closures/capture-unsized-by-ref.rs @@ -0,0 +1,10 @@ +// build-pass +// compile-flags: --crate-type=lib + +#![feature(unsized_fn_params)] + +pub fn f(k: dyn std::fmt::Display) { + let k2 = || { + k.to_string(); + }; +} |