Skip to content

Commit 8e7f69a

Browse files
authored
Rollup merge of #53317 - estebank:abolish-ice, r=oli-obk
Mark prior failure to avoid ICE Fix #53251
2 parents 47f66e7 + 397db46 commit 8e7f69a

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

src/librustc_typeck/check/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -5154,6 +5154,7 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
51545154
} else {
51555155
None
51565156
} {
5157+
self.set_tainted_by_errors(); // #53251
51575158
err.span_label(span, format!("expected {}", expected_text)).emit();
51585159
}
51595160

src/test/ui/issue-53251.rs

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2018 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+
struct S;
12+
13+
impl S {
14+
fn f() {}
15+
}
16+
17+
macro_rules! impl_add {
18+
($($n:ident)*) => {
19+
$(
20+
fn $n() {
21+
S::f::<i64>();
22+
//~^ ERROR too many type parameters provided
23+
}
24+
)*
25+
}
26+
}
27+
28+
impl_add!(a b);

src/test/ui/issue-53251.stderr

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
error[E0601]: `main` function not found in crate `issue_53251`
2+
|
3+
= note: consider adding a `main` function to `$DIR/issue-53251.rs`
4+
5+
error[E0087]: too many type parameters provided: expected at most 0 type parameters, found 1 type parameter
6+
--> $DIR/issue-53251.rs:21:24
7+
|
8+
LL | S::f::<i64>();
9+
| ^^^ expected 0 type parameters
10+
...
11+
LL | impl_add!(a b);
12+
| --------------- in this macro invocation
13+
14+
error: aborting due to 2 previous errors
15+
16+
Some errors occurred: E0087, E0601.
17+
For more information about an error, try `rustc --explain E0087`.

0 commit comments

Comments
 (0)