Skip to content

Commit 494e5b7

Browse files
committed
propagate tainted_by_errors in MirBorrowckCtxt::emit_errors
1 parent 842d6fc commit 494e5b7

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

compiler/rustc_borrowck/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2522,7 +2522,7 @@ mod diags {
25222522
}
25232523

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

25272527
// Buffer any move errors that we collected and de-duplicated.
25282528
for (_, (_, diag)) in std::mem::take(&mut self.diags.buffered_move_errors) {

tests/crashes/126896.rs renamed to tests/ui/polymorphization/taint.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
//@ known-bug: rust-lang/rust#126896
21
//@ compile-flags: -Zvalidate-mir -Zinline-mir=yes
32

3+
// reported as rust-lang/rust#126896
4+
45
#![feature(type_alias_impl_trait)]
56
type Two<'a, 'b> = impl std::fmt::Debug;
67

@@ -13,5 +14,4 @@ fn d(x: Two) {
1314
c1;
1415
}
1516

16-
fn main() {
17-
}
17+
fn main() {}
+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)