From 8ba56052330c69b6bb5bb9c477ff2d3894e5911d Mon Sep 17 00:00:00 2001 From: Steve Klabnik Date: Sun, 7 Dec 2014 04:18:56 -0500 Subject: remove usage of notrust from the docs Fixes #19599 --- src/doc/guide-pointers.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/doc/guide-pointers.md') diff --git a/src/doc/guide-pointers.md b/src/doc/guide-pointers.md index f6216760d64..dbb8d6b007d 100644 --- a/src/doc/guide-pointers.md +++ b/src/doc/guide-pointers.md @@ -84,7 +84,7 @@ println!("{}", x + z); This gives us an error: -```{notrust,ignore} +```{ignore} hello.rs:6:24: 6:25 error: mismatched types: expected `int` but found `&int` (expected int but found &-ptr) hello.rs:6 println!("{}", x + z); ^ @@ -132,7 +132,7 @@ Pointers are useful in languages that are pass-by-value, rather than pass-by-reference. Basically, languages can make two choices (this is made up syntax, it's not Rust): -```{notrust,ignore} +```{ignore} func foo(x) { x = 5 } @@ -152,7 +152,7 @@ and therefore, can change its value. At the comment, `i` will be `5`. So what do pointers have to do with this? Well, since pointers point to a location in memory... -```{notrust,ignore} +```{ignore} func foo(&int x) { *x = 5 } @@ -179,7 +179,7 @@ but here are problems with pointers in other languages: Uninitialized pointers can cause a problem. For example, what does this program do? -```{notrust,ignore} +```{ignore} &int x; *x = 5; // whoops! ``` @@ -191,7 +191,7 @@ knows. This might be harmless, and it might be catastrophic. When you combine pointers and functions, it's easy to accidentally invalidate the memory the pointer is pointing to. For example: -```{notrust,ignore} +```{ignore} func make_pointer(): &int { x = 5; @@ -213,7 +213,7 @@ As one last example of a big problem with pointers, **aliasing** can be an issue. Two pointers are said to alias when they point at the same location in memory. Like this: -```{notrust,ignore} +```{ignore} func mutate(&int i, int j) { *i = j; } @@ -398,7 +398,7 @@ fn main() { It gives this error: -```{notrust,ignore} +```{ignore} test.rs:5:8: 5:10 error: cannot assign to `*x` because it is borrowed test.rs:5 *x -= 1; ^~ @@ -522,7 +522,7 @@ boxes, though. As a rough approximation, you can treat this Rust code: As being similar to this C code: -```{notrust,ignore} +```{ignore} { int *x; x = (int *)malloc(sizeof(int)); @@ -626,7 +626,7 @@ fn main() { This prints: -```{notrust,ignore} +```{ignore} Cons(1, box Cons(2, box Cons(3, box Nil))) ``` -- cgit 1.4.1-3-g733a5