]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #14622 : reillywatson/rust/master, r=alexcrichton
authorbors <bors@rust-lang.org>
Tue, 3 Jun 2014 17:01:40 +0000 (10:01 -0700)
committerbors <bors@rust-lang.org>
Tue, 3 Jun 2014 17:01:40 +0000 (10:01 -0700)
1  2 
src/doc/intro.md

diff --combined src/doc/intro.md
index 50f57aca12f1fdcde33f935928a4d3c460a2f174,ba8a730782637f2ea245b6dbc3a68d21a373940b..4d1eb1b31a7d4261411245525e444428a28d023e
@@@ -18,11 -18,11 +18,11 @@@ and its implications on a task that pro
  
  Ownership is central to Rust,
  and is the feature from which many of Rust's powerful capabilities are derived.
- "Ownership" refers to which parts of your code are allowed read,
+ "Ownership" refers to which parts of your code are allowed to read,
  write, and ultimately release, memory.
  Let's start by looking at some C++ code:
  
 -```notrust
 +```cpp
  int* dangling(void)
  {
      int i = 1234;
@@@ -74,7 -74,7 +74,7 @@@ fn main() 
  
  Save this program as `dangling.rs`. When you try to compile this program with `rustc dangling.rs`, you'll get an interesting (and long) error message:
  
 -```notrust
 +```text
  dangling.rs:3:12: 3:14 error: `i` does not live long enough
  dangling.rs:3     return &i;
                           ^~
@@@ -155,7 -155,7 +155,7 @@@ You can roughly compare these two lines
  let i = box 1234;
  ```
  
 -```notrust
 +```cpp
  // C++
  int *i = new int;
  *i = 1234;
@@@ -254,7 -254,7 +254,7 @@@ fn main() 
  
  This will result an error indicating that the value is no longer in scope:
  
 -```notrust
 +```text
  concurrency.rs:12:20: 12:27 error: use of moved value: 'numbers'
  concurrency.rs:12     println!("{}", numbers.get(0));
                                       ^~~~~~~