diff options
Diffstat (limited to 'tests/ui/closures/print/closure-print-generic-verbose-1.rs')
-rw-r--r-- | tests/ui/closures/print/closure-print-generic-verbose-1.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/ui/closures/print/closure-print-generic-verbose-1.rs b/tests/ui/closures/print/closure-print-generic-verbose-1.rs new file mode 100644 index 000000000..67d37f1c5 --- /dev/null +++ b/tests/ui/closures/print/closure-print-generic-verbose-1.rs @@ -0,0 +1,24 @@ +// compile-flags: -Zverbose + +fn to_fn_once<F:FnOnce()>(f: F) -> F { f } + +fn f<T: std::fmt::Display>(y: T) { + struct Foo<U: std::fmt::Display> { + x: U + }; + + let foo = Foo{ x: "x" }; + + let c = to_fn_once(move|| { + println!("{} {}", foo.x, y); + }); + + c(); + c(); + //~^ ERROR use of moved value +} + + +fn main() { + f("S"); +} |