From e620daf3b1a40ae825c625bc4328fb7d2b3ee8b6 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 2 Jul 2014 02:54:21 -0400 Subject: initial commit --- examples/17_borrow-error-fixed.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 examples/17_borrow-error-fixed.rs (limited to 'examples/17_borrow-error-fixed.rs') diff --git a/examples/17_borrow-error-fixed.rs b/examples/17_borrow-error-fixed.rs new file mode 100644 index 0000000..06ff060 --- /dev/null +++ b/examples/17_borrow-error-fixed.rs @@ -0,0 +1,10 @@ +fn foo () -> Box { + let x = box 2; + return x; +} + +fn main () { + let x = foo(); + println!("{}", *x); +} + -- cgit v1.2.3