Skip to content

remove usage of notrust from the docs #19614

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 9, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/doc/guide-crates.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading