Skip to content

Commit

Permalink
remove usage of notrust from the docs
Browse files Browse the repository at this point in the history
Fixes #19599
  • Loading branch information
steveklabnik committed Dec 7, 2014
1 parent f7d18b9 commit 8ba5605
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 75 deletions.
2 changes: 1 addition & 1 deletion src/doc/guide-crates.md
Expand Up @@ -452,7 +452,7 @@ fn main() {
Rust will give us a compile-time error:
```{notrust,ignore}
```{ignore}
Compiling phrases v0.0.1 (file:///home/you/projects/phrases)
/home/you/projects/phrases/src/main.rs:4:5: 4:40 error: a value named `hello` has already been imported in this module
/home/you/projects/phrases/src/main.rs:4 use phrases::japanese::greetings::hello;
Expand Down
4 changes: 2 additions & 2 deletions src/doc/guide-error-handling.md
Expand Up @@ -76,7 +76,7 @@ fn main() {

This will give us an error:

```{notrust,ignore}
```{ignore}
error: non-exhaustive patterns: `_` not covered [E0004]
```

Expand Down Expand Up @@ -189,7 +189,7 @@ panic!("boom");

gives

```{notrust,ignore}
```{ignore}
task '<main>' panicked at 'boom', hello.rs:2
```

Expand Down
4 changes: 2 additions & 2 deletions src/doc/guide-ownership.md
Expand Up @@ -130,7 +130,7 @@ fn add_one(mut num: Box<int>) {

This does not compile, and gives us an error:

```{notrust,ignore}
```{ignore}
error: use of moved value: `x`
println!("{}", x);
^
Expand Down Expand Up @@ -406,7 +406,7 @@ fn main() {
We try to make four `Wheel`s, each with a `Car` that it's attached to. But the
compiler knows that on the second iteration of the loop, there's a problem:

```{notrust,ignore}
```{ignore}
error: use of moved value: `car`
Wheel { size: 360, owner: car };
^~~
Expand Down
18 changes: 9 additions & 9 deletions src/doc/guide-pointers.md
Expand Up @@ -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);
^
Expand Down Expand Up @@ -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
}
Expand All @@ -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
}
Expand All @@ -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!
```
Expand All @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
^~
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -626,7 +626,7 @@ fn main() {

This prints:

```{notrust,ignore}
```{ignore}
Cons(1, box Cons(2, box Cons(3, box Nil)))
```

Expand Down
6 changes: 3 additions & 3 deletions src/doc/guide-strings.md
Expand Up @@ -181,7 +181,7 @@ for l in s.graphemes(true) {

This prints:

```{notrust,ignore}
```{text}
n͈̰̎
i̙̮͚̦
Expand All @@ -207,7 +207,7 @@ for l in s.chars() {

This prints:

```{notrust,ignore}
```{text}
u
͔
n
Expand Down Expand Up @@ -252,7 +252,7 @@ for l in s.bytes() {

This will print:

```{notrust,ignore}
```{text}
117
205
148
Expand Down

0 comments on commit 8ba5605

Please sign in to comment.