Skip to content

Commit 9812432

Browse files
committed
propagate tainted_by_errors in MirBorrowckCtxt::emit_errors
1 parent b5723af commit 9812432

File tree

5 files changed

+22
-2
lines changed

5 files changed

+22
-2
lines changed

compiler/rustc_borrowck/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2520,7 +2520,7 @@ mod diags {
25202520
}
25212521

25222522
pub fn emit_errors(&mut self) -> Option<ErrorGuaranteed> {
2523-
let mut res = None;
2523+
let mut res = self.infcx.tainted_by_errors();
25242524

25252525
// Buffer any move errors that we collected and de-duplicated.
25262526
for (_, (_, diag)) in std::mem::take(&mut self.diags.buffered_move_errors) {
File renamed without changes.
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0792]: expected generic lifetime parameter, found `'_`
2+
--> $DIR/taint.rs:12:17
3+
|
4+
LL | type Two<'a, 'b> = impl std::fmt::Debug;
5+
| -- this generic parameter must be used with a generic lifetime parameter
6+
...
7+
LL | let c1 = || set(x);
8+
| ^^^^^^
9+
10+
error: aborting due to 1 previous error
11+
12+
For more information about this error, try `rustc --explain E0792`.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ known-bug: #124164
1+
//reported as #124164
22
static S_COUNT: = std::sync::atomic::AtomicUsize::new(0);
33

44
fn main() {}

tests/ui/static/missing-type.stderr

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: missing type for `static` item
2+
--> $DIR/missing-type.rs:2:16
3+
|
4+
LL | static S_COUNT: = std::sync::atomic::AtomicUsize::new(0);
5+
| ^ help: provide a type for the static variable: `AtomicUsize`
6+
7+
error: aborting due to 1 previous error
8+

0 commit comments

Comments
 (0)