Skip to content

Commit 3059d00

Browse files
committed
ignore code examples in tests
1 parent 8350715 commit 3059d00

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/rust-2021/IntoIterator-for-arrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Until Rust 1.53, only *references* to arrays implement `IntoIterator`.
88
This means you can iterate over `&[1, 2, 3]` and `&mut [1, 2, 3]`,
99
but not over `[1, 2, 3]` directly.
1010

11-
```rust
11+
```rust,ignore
1212
for &e in &[1, 2, 3] {} // Ok :)
1313
1414
for e in [1, 2, 3] {} // Error :(

src/rust-2021/disjoint-capture-in-closures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ When a field of the struct is already borrowed (mutably) or moved out of,
1515
the other fields can no longer be used in a closure,
1616
since that would capture the whole struct, which is no longer available.
1717

18-
```rust
18+
```rust,ignore
1919
let a = SomeStruct::new();
2020
2121
drop(a.x); // Move out of one field of the struct

src/rust-2021/panic-macro-consistency.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ The `panic!()` macro is one of Rust's most well known macros.
99
However, it has [some subtle surprises](https://github.com/rust-lang/rfcs/blob/master/text/3007-panic-plan.md)
1010
that we can't just change due to backwards compatibility.
1111

12-
```rust
12+
```rust,ignore
1313
panic!("{}", 1); // Ok, panics with the message "1"
1414
panic!("{}"); // Ok, panics with the message "{}"
1515
```
1616

1717
The `panic!()` macro only uses string formatting when it's invoked with more than one argument.
1818
When invoked with a single argument, it doesn't even look at that argument.
1919

20-
```rust
20+
```rust,ignore
2121
let a = "{";
2222
println!(a); // Error: First argument must be a format string literal
2323
panic!(a); // Ok: The panic macro doesn't care

0 commit comments

Comments
 (0)