Skip to content

Commit 2d813b2

Browse files
committed
Add a test that triggers the out-of-bounds ICE.
Add a test that has the right input to trigger an out-of-bounds error when in MIR the local_decls and the normalized_input_tys don't match in amount.
1 parent 5676bd5 commit 2d813b2

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Test that when in MIR the amount of local_decls and amount of normalized_input_tys don't match
2+
// that an out-of-bounds access does not occur.
3+
#![feature(c_variadic)]
4+
5+
fn main() {}
6+
7+
fn foo(_: Bar, ...) -> impl {}
8+
//~^ ERROR only foreign or `unsafe extern "C" functions may be C-variadic
9+
//~| ERROR cannot find type `Bar` in this scope
10+
//~| ERROR at least one trait must be specified
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
error: only foreign or `unsafe extern "C" functions may be C-variadic
2+
--> $DIR/issue-83499-input-output-iteration-ice.rs:7:16
3+
|
4+
LL | fn foo(_: Bar, ...) -> impl {}
5+
| ^^^
6+
7+
error: at least one trait must be specified
8+
--> $DIR/issue-83499-input-output-iteration-ice.rs:7:24
9+
|
10+
LL | fn foo(_: Bar, ...) -> impl {}
11+
| ^^^^
12+
13+
error[E0412]: cannot find type `Bar` in this scope
14+
--> $DIR/issue-83499-input-output-iteration-ice.rs:7:11
15+
|
16+
LL | fn foo(_: Bar, ...) -> impl {}
17+
| ^^^ not found in this scope
18+
19+
error: aborting due to 3 previous errors
20+
21+
For more information about this error, try `rustc --explain E0412`.

0 commit comments

Comments
 (0)