diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-07-02 02:54:21 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-07-02 02:54:21 -0400 |
commit | e620daf3b1a40ae825c625bc4328fb7d2b3ee8b6 (patch) | |
tree | faa469408ee78623eaa8d2720dcbb36096788ca1 /examples/17_borrow-error-fixed.rs | |
download | intro-to-rust-yapc-na-2014-e620daf3b1a40ae825c625bc4328fb7d2b3ee8b6.tar.gz intro-to-rust-yapc-na-2014-e620daf3b1a40ae825c625bc4328fb7d2b3ee8b6.zip |
Diffstat (limited to 'examples/17_borrow-error-fixed.rs')
-rw-r--r-- | examples/17_borrow-error-fixed.rs | 10 |
1 files changed, 10 insertions, 0 deletions
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<int> { + let x = box 2; + return x; +} + +fn main () { + let x = foo(); + println!("{}", *x); +} + |