Skip to content

Commit 8df3f59

Browse files
committed
Rollup merge of rust-lang#32811 - alexcrichton:check-lints, r=nrc
This was a regression introduced by rust-lang#31250 where the compiler deferred returning the results of compilation a little too late (after the `Stop` check was looked at). This commit alters the stop point to first try to return an erroneous `result` and only if it was successful return the sentinel `Err(0)`. Closes rust-lang#31576
2 parents 079990d + b8526d7 commit 8df3f59

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

src/librustc_driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ pub fn compile_input(sess: &Session,
193193
(control.after_analysis.callback)(state);
194194

195195
if control.after_analysis.stop == Compilation::Stop {
196-
return Err(0usize);
196+
return result.and_then(|_| Err(0usize));
197197
}
198198
}
199199

src/librustc_typeck/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ recursion limit (which can be set via the `recursion_limit` attribute).
632632
633633
For a somewhat artificial example:
634634
635-
```compile_fail
635+
```compile_fail,ignore
636636
#![recursion_limit="2"]
637637
638638
struct Foo;
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// compile-flags:--test
12+
// should-fail
13+
14+
#![doc(test(attr(deny(warnings))))]
15+
16+
/// ```no_run
17+
/// let a = 3;
18+
/// ```
19+
pub fn foo() {}

0 commit comments

Comments
 (0)