Skip to content

Fix up some {ignore} and {notrust}s #19714

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 15, 2014
Merged
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/complement-bugreport.md
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ It's also helpful to provide the exact version and host by copying the output of
re-running the erroneous rustc command with the `--version=verbose` flag, which will
produce something like this:

```{ignore}
```text
rustc 0.12.0 (ba4081a5a 2014-10-07 13:44:41 -0700)
binary: rustc
commit-hash: ba4081a5a8573875fed17545846f6f6902c8ba8d
2 changes: 1 addition & 1 deletion src/doc/guide-crates.md
Original file line number Diff line number Diff line change
@@ -452,7 +452,7 @@ fn main() {
Rust will give us a compile-time error:
```{notrust}
```text
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;
4 changes: 2 additions & 2 deletions src/doc/guide-error-handling.md
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@ fn main() {

This will give us an error:

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

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

gives

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

4 changes: 2 additions & 2 deletions src/doc/guide-ownership.md
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ fn add_one(mut num: Box<int>) {

This does not compile, and gives us an error:

```{notrust}
```text
error: use of moved value: `x`
println!("{}", x);
^
@@ -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}
```text
error: use of moved value: `car`
Wheel { size: 360, owner: car };
^~~
16 changes: 8 additions & 8 deletions src/doc/guide-pointers.md
Original file line number Diff line number Diff line change
@@ -84,7 +84,7 @@ println!("{}", x + z);

This gives us an error:

```{notrust}
```text
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):

```{ignore}
```text
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...

```{ignore}
```text
func foo(&int x) {
*x = 5
}
@@ -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:

```{ignore}
```text
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:

```{ignore}
```text
func mutate(&int i, int j) {
*i = j;
}
@@ -398,7 +398,7 @@ fn main() {

It gives this error:

```{notrust}
```text
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:

```{ignore}
```c
{
int *x;
x = (int *)malloc(sizeof(int));
@@ -626,7 +626,7 @@ fn main() {

This prints:

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

112 changes: 56 additions & 56 deletions src/doc/guide.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/doc/intro.md
Original file line number Diff line number Diff line change
@@ -313,7 +313,7 @@ print `"Hello"`, or does Rust crash?

Neither. It refuses to compile:

```{notrust}
```bash
$ cargo run
Compiling hello_world v0.0.1 (file:///Users/you/src/hello_world)
main.rs:8:5: 8:6 error: cannot borrow `v` as mutable because it is also borrowed as immutable
@@ -428,7 +428,7 @@ fn main() {
It gives us this error:
```{notrust}
```text
6:71 error: capture of moved value: `numbers`
for j in range(0, 3) { numbers[j] += 1 }
^~~~~~~