Skip to content

Commit 142c52f

Browse files
committedApr 9, 2018
fix tests
1 parent 758a77d commit 142c52f

File tree

5 files changed

+29
-27
lines changed

5 files changed

+29
-27
lines changed
 

‎src/doc/rustc/src/lints/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ depending on how you've configured things.
77

88
Here's a small example:
99

10-
```rust
10+
```bash
1111
$ cat main.rs
1212
fn main() {
1313
let x = 5;
@@ -25,4 +25,4 @@ warning: unused variable: `x`
2525

2626
This is the `unused_variables` lint, and it tells you that you've introduced
2727
a variable that you don't use in your code. That's not *wrong*, so it's not
28-
an error, but it might be a bug, so you get a warning.
28+
an error, but it might be a bug, so you get a warning.

‎src/doc/rustc/src/lints/levels.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn foo() {}
2222

2323
Compiling this file produces no warnings:
2424

25-
```rust
25+
```bash
2626
$ rustc lib.rs --crate-type=lib
2727
$
2828
```
@@ -62,7 +62,7 @@ warning: unused variable: `x`
6262
A 'deny' lint produces an error if you violate it. For example, this code
6363
runs into the `exceeding_bitshifts` lint.
6464

65-
```rust
65+
```rust,ignore
6666
fn main() {
6767
100u8 << 10;
6868
}
@@ -215,7 +215,7 @@ pub fn foo() {}
215215
This is the maximum level for all lints. So for example, if we take our
216216
code sample from the "deny" lint level above:
217217
218-
```rust
218+
```rust,ignore
219219
fn main() {
220220
100u8 << 10;
221221
}
@@ -249,4 +249,4 @@ $
249249
250250
This feature is used heavily by Cargo; it will pass `--cap-lints allow` when
251251
compiling your dependencies, so that if they have any warnings, they do not
252-
pollute the output of your build.
252+
pollute the output of your build.

‎src/doc/rustc/src/lints/listing/allowed-by-default.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ This lint is deprecated and no longer used.
336336
This lint guards against `extern crate` items that are never used. Some
337337
example code that triggers this lint:
338338

339-
```rust
339+
```rust,ignore
340340
extern crate semver;
341341
```
342342

@@ -359,9 +359,10 @@ code that triggers this lint:
359359
```rust
360360
use test::{A};
361361

362-
mod test {
363-
struct A;
362+
pub mod test {
363+
pub struct A;
364364
}
365+
# fn main() {}
365366
```
366367

367368
When set to 'deny', this will produce:
@@ -410,7 +411,7 @@ You can call `bar()` directly, without the `foo::`.
410411
This lint checks for the unused result of an expression in a statement. Some
411412
example code that triggers this lint:
412413

413-
```rust
414+
```rust,no_run
414415
fn foo<T>() -> T { panic!() }
415416
416417
fn main() {
@@ -449,4 +450,4 @@ error: enum variant is more than three times larger (1024 bytes) than the next l
449450
5 | VBig([u8; 1024]), //~ ERROR variant is more than three times larger
450451
| ^^^^^^^^^^^^^^^^
451452
|
452-
```
453+
```

‎src/doc/rustc/src/lints/listing/deny-by-default.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ These lints are all set to the 'deny' level by default.
77
This lint detects that a shift exceeds the type's number of bits. Some
88
example code that triggers this lint:
99

10-
```rust
10+
```rust,ignore
1111
1_i32 << 32;
1212
```
1313

@@ -27,7 +27,7 @@ error: bitshift exceeds the type's number of bits
2727
This lint detects type parameter default erroneously allowed in invalid location. Some
2828
example code that triggers this lint:
2929

30-
```rust
30+
```rust,ignore
3131
fn foo<T=i32>(t: T) {}
3232
```
3333

@@ -51,7 +51,7 @@ error: defaults for type parameters are only allowed in `struct`, `enum`, `type`
5151
visibility rules, and changed the visibility of struct constructors. Some
5252
example code that triggers this lint:
5353

54-
```rust
54+
```rust,ignore
5555
mod m {
5656
pub struct S(u8);
5757
@@ -96,7 +96,7 @@ it into its own directory if appropriate.
9696
This lint detects names that resolve to ambiguous glob imports. Some example
9797
code that triggers this lint:
9898

99-
```rust
99+
```rust,ignore
100100
pub struct Foo;
101101
102102
mod bar {
@@ -143,7 +143,7 @@ This warning can always be fixed by removing the unused pattern in the
143143
This lint catches transmuting from `&T` to `&mut T` becuase it is undefined
144144
behavior. Some example code that triggers this lint:
145145

146-
```rust
146+
```rust,ignore
147147
unsafe {
148148
let y = std::mem::transmute::<&i32, &mut i32>(&5);
149149
}
@@ -168,7 +168,7 @@ Constants do not have their symbols exported, and therefore, this probably
168168
means you meant to use a `static`, not a `const. Some example code that
169169
triggers this lint:
170170

171-
```rust
171+
```rust,ignore
172172
#[no_mangle]
173173
const FOO: i32 = 5;
174174
```
@@ -191,7 +191,7 @@ error: const items should never be #[no_mangle]
191191
This lint detects incorrect parentheses. Some example code that triggers this
192192
lint:
193193

194-
```rust
194+
```rust,ignore
195195
let x = 5 as usize();
196196
```
197197

@@ -225,7 +225,7 @@ to be accessed in safe code. This lint now catches and denies this kind of code.
225225
This lint detects an unknown crate type found in a `#[crate_type]` directive. Some
226226
example code that triggers this lint:
227227

228-
```rust
228+
```rust,ignore
229229
#![crate_type="lol"]
230230
```
231231

@@ -238,4 +238,4 @@ error: invalid `crate_type` value
238238
1 | #![crate_type="lol"]
239239
| ^^^^^^^^^^^^^^^^^^^^
240240
|
241-
```
241+
```

‎src/doc/rustc/src/lints/listing/warn-by-default.md

+8-7
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ These lints are all set to the 'warn' level by default.
77
This lint detects an erroneous expression while doing constant evaluation. Some
88
example code that triggers this lint:
99

10-
```rust
10+
```rust,ignore
1111
let b = 200u8 + 200u8;
1212
```
1313

@@ -413,7 +413,7 @@ impl Trait for i32 {
413413
This lint detects when compiler plugins are used as ordinary library in
414414
non-plugin crate. Some example code that triggers this lint:
415415

416-
```rust
416+
```rust,ignore
417417
#![feature(plugin)]
418418
#![plugin(macro_crate_test)]
419419
@@ -425,7 +425,7 @@ extern crate macro_crate_test;
425425
This lint detects detect private items in public interfaces not caught by the old implementation. Some
426426
example code that triggers this lint:
427427

428-
```rust
428+
```rust,ignore
429429
pub trait Trait {
430430
type A;
431431
}
@@ -439,6 +439,7 @@ mod foo {
439439
type A = Z;
440440
}
441441
}
442+
# fn main() {}
442443
```
443444

444445
This will produce:
@@ -682,7 +683,7 @@ warning: union contains a field with possibly non-trivial drop code, drop code o
682683
This lint detects unrecognized lint attribute. Some
683684
example code that triggers this lint:
684685

685-
```rust
686+
```rust,ignore
686687
#[allow(not_a_real_lint)]
687688
```
688689

@@ -702,7 +703,7 @@ warning: unknown lint: `not_a_real_lint`
702703
This lint detects detects unreachable code paths. Some example code that
703704
triggers this lint:
704705

705-
```rust
706+
```rust,no_run
706707
panic!("we never go past here!");
707708
708709
let x = 5;
@@ -1020,7 +1021,7 @@ As such, you won't ever trigger this lint in your code directly.
10201021
This lint detects `while true { }`. Some example code that triggers this
10211022
lint:
10221023

1023-
```rust
1024+
```rust,no_run
10241025
while true {
10251026
10261027
}
@@ -1035,4 +1036,4 @@ warning: denote infinite loops with `loop { ... }`
10351036
2 | while true {
10361037
| ^^^^^^^^^^ help: use `loop`
10371038
|
1038-
```
1039+
```

0 commit comments

Comments
 (0)
Please sign in to comment.