Skip to content

Commit 33e4b3b

Browse files
authored
Merge pull request #2049 from topecongiro/rustc-fix
rustc fix
2 parents b2c88b0 + 49d388d commit 33e4b3b

File tree

4 files changed

+41
-40
lines changed

4 files changed

+41
-40
lines changed

src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,13 @@ impl<'a> CompilerCalls<'a> for ClippyCompilerCalls {
6464
&mut self,
6565
matches: &getopts::Matches,
6666
sess: &Session,
67+
crate_stores: &rustc::middle::cstore::CrateStore,
6768
input: &Input,
6869
odir: &Option<PathBuf>,
6970
ofile: &Option<PathBuf>,
7071
) -> Compilation {
7172
self.default
72-
.late_callback(matches, sess, input, odir, ofile)
73+
.late_callback(matches, sess, crate_stores, input, odir, ofile)
7374
}
7475
fn build_controller(&mut self, sess: &Session, matches: &getopts::Matches) -> driver::CompileController<'a> {
7576
let mut control = self.default.build_controller(sess, matches);

tests/ui/never_loop.stderr

+13-13
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ error: this loop never actually loops
2424
error: this loop never actually loops
2525
--> $DIR/never_loop.rs:47:2
2626
|
27-
47 | / \tloop { // never loops
28-
48 | | \t while i == 0 { // never loops
29-
49 | | \t break
30-
50 | | \t }
31-
51 | | \t return
32-
52 | | \t}
27+
47 | / loop { // never loops
28+
48 | | while i == 0 { // never loops
29+
49 | | break
30+
50 | | }
31+
51 | | return
32+
52 | | }
3333
| |__^
3434

3535
error: this loop never actually loops
@@ -45,20 +45,20 @@ error: this loop never actually loops
4545
|
4646
57 | / 'outer: loop { // never loops
4747
58 | | x += 1;
48-
59 | | \t\tloop { // never loops
48+
59 | | loop { // never loops
4949
60 | | if x == 5 { break }
5050
... |
51-
63 | | \t\treturn
52-
64 | | \t}
51+
63 | | return
52+
64 | | }
5353
| |__^
5454

5555
error: this loop never actually loops
5656
--> $DIR/never_loop.rs:59:3
5757
|
58-
59 | / \t\tloop { // never loops
59-
60 | | \t\t if x == 5 { break }
60-
61 | | \t\t\tcontinue 'outer
61-
62 | | \t\t}
58+
59 | / loop { // never loops
59+
60 | | if x == 5 { break }
60+
61 | | continue 'outer
61+
62 | | }
6262
| |___^
6363

6464
error: this loop never actually loops
+16-16
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
11
error: You are trying to use classic C overflow conditions that will fail in Rust.
22
--> $DIR/overflow_check_conditional.rs:11:5
33
|
4-
11 | \tif a + b < a {
5-
| \t ^^^^^^^^^
4+
11 | if a + b < a {
5+
| ^^^^^^^^^
66
|
77
= note: `-D overflow-check-conditional` implied by `-D warnings`
88

99
error: You are trying to use classic C overflow conditions that will fail in Rust.
1010
--> $DIR/overflow_check_conditional.rs:14:5
1111
|
12-
14 | \tif a > a + b {
13-
| \t ^^^^^^^^^
12+
14 | if a > a + b {
13+
| ^^^^^^^^^
1414

1515
error: You are trying to use classic C overflow conditions that will fail in Rust.
1616
--> $DIR/overflow_check_conditional.rs:17:5
1717
|
18-
17 | \tif a + b < b {
19-
| \t ^^^^^^^^^
18+
17 | if a + b < b {
19+
| ^^^^^^^^^
2020

2121
error: You are trying to use classic C overflow conditions that will fail in Rust.
2222
--> $DIR/overflow_check_conditional.rs:20:5
2323
|
24-
20 | \tif b > a + b {
25-
| \t ^^^^^^^^^
24+
20 | if b > a + b {
25+
| ^^^^^^^^^
2626

2727
error: You are trying to use classic C underflow conditions that will fail in Rust.
2828
--> $DIR/overflow_check_conditional.rs:23:5
2929
|
30-
23 | \tif a - b > b {
31-
| \t ^^^^^^^^^
30+
23 | if a - b > b {
31+
| ^^^^^^^^^
3232

3333
error: You are trying to use classic C underflow conditions that will fail in Rust.
3434
--> $DIR/overflow_check_conditional.rs:26:5
3535
|
36-
26 | \tif b < a - b {
37-
| \t ^^^^^^^^^
36+
26 | if b < a - b {
37+
| ^^^^^^^^^
3838

3939
error: You are trying to use classic C underflow conditions that will fail in Rust.
4040
--> $DIR/overflow_check_conditional.rs:29:5
4141
|
42-
29 | \tif a - b > a {
43-
| \t ^^^^^^^^^
42+
29 | if a - b > a {
43+
| ^^^^^^^^^
4444

4545
error: You are trying to use classic C underflow conditions that will fail in Rust.
4646
--> $DIR/overflow_check_conditional.rs:32:5
4747
|
48-
32 | \tif a < a - b {
49-
| \t ^^^^^^^^^
48+
32 | if a < a - b {
49+
| ^^^^^^^^^
5050

5151
error: aborting due to 8 previous errors
5252

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
error: Closure called just once immediately after it was declared
22
--> $DIR/redundant_closure_call.rs:15:2
33
|
4-
15 | \ti = closure();
5-
| \t^^^^^^^^^^^^^
4+
15 | i = closure();
5+
| ^^^^^^^^^^^^^
66
|
77
= note: `-D redundant-closure-call` implied by `-D warnings`
88

99
error: Closure called just once immediately after it was declared
1010
--> $DIR/redundant_closure_call.rs:18:2
1111
|
12-
18 | \ti = closure(3);
13-
| \t^^^^^^^^^^^^^^
12+
18 | i = closure(3);
13+
| ^^^^^^^^^^^^^^
1414

1515
error: Try not to call a closure in the expression where it is declared.
1616
--> $DIR/redundant_closure_call.rs:7:10
1717
|
18-
7 | \tlet a = (|| 42)();
19-
| \t ^^^^^^^^^ help: Try doing something like: : `42`
18+
7 | let a = (|| 42)();
19+
| ^^^^^^^^^ help: Try doing something like: : `42`
2020

2121
error: Try not to call a closure in the expression where it is declared.
2222
--> $DIR/redundant_closure_call.rs:10:14
2323
|
24-
10 | \tlet mut k = (|m| m+1)(i);
25-
| \t ^^^^^^^^^^^^
24+
10 | let mut k = (|m| m+1)(i);
25+
| ^^^^^^^^^^^^
2626

2727
error: Try not to call a closure in the expression where it is declared.
2828
--> $DIR/redundant_closure_call.rs:12:6
2929
|
30-
12 | \tk = (|a,b| a*b)(1,5);
31-
| \t ^^^^^^^^^^^^^^^^
30+
12 | k = (|a,b| a*b)(1,5);
31+
| ^^^^^^^^^^^^^^^^
3232

3333
error: aborting due to 5 previous errors
3434

0 commit comments

Comments
 (0)