about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSteve Klabnik <steve@steveklabnik.com>2015-01-22 18:09:58 -0500
committerSteve Klabnik <steve@steveklabnik.com>2015-01-22 18:09:58 -0500
commit5f71c22d87ecb591670d5a8a3f2ba7c51022e562 (patch)
tree9782c4e02327d5f7af677f6cc7e4201a072aca5a
parent3364d412827151c669c0dc2cc67e7c0e6e4d8c55 (diff)
parent9293607f8f485acc91be83bcc216ae01ed70b5fd (diff)
downloadrust-5f71c22d87ecb591670d5a8a3f2ba7c51022e562.tar.gz
rust-5f71c22d87ecb591670d5a8a3f2ba7c51022e562.zip
Rollup merge of #21373 - angst7:pointer_doc_1, r=steveklabnik
Updated incorrect error messages, and removed explicit return statements from example code.
-rw-r--r--src/doc/trpl/pointers.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/doc/trpl/pointers.md b/src/doc/trpl/pointers.md
index d74c10b8145..29986d7f235 100644
--- a/src/doc/trpl/pointers.md
+++ b/src/doc/trpl/pointers.md
@@ -87,7 +87,7 @@ println!("{}", x + z);
 This gives us an error:
 
 ```text
-hello.rs:6:24: 6:25 error: mismatched types: expected `i32` but found `&i32` (expected i32 but found &-ptr)
+hello.rs:6:24: 6:25 error: mismatched types: expected `_`, found `&_` (expected integral variable, found &-ptr)
 hello.rs:6     println!("{}", x + z);
                                   ^
 ```
@@ -305,7 +305,7 @@ References are immutable by default:
 let x = 5;
 let y = &x;
 
-*y = 5; // error: cannot assign to immutable dereference of `&`-pointer `*y`
+*y = 5; // error: cannot assign to immutable borrowed content `*y`
 ```
 
 They can be made mutable with `mut`, but only if its referent is also mutable.
@@ -668,7 +668,7 @@ struct BigStruct {
 }
 
 fn foo(x: Box<BigStruct>) -> Box<BigStruct> {
-    return Box::new(*x);
+    Box::new(*x)
 }
 
 fn main() {
@@ -696,7 +696,7 @@ struct BigStruct {
 }
 
 fn foo(x: Box<BigStruct>) -> BigStruct {
-    return *x;
+    *x
 }
 
 fn main() {