Skip to content

Commit 416edc1

Browse files
authored
Rollup merge of #58921 - cuviper:issue-50582, r=varkor
Add an explicit test for issue #50582 This code no longer ICEs, and @yodaldevoid found that it was fixed by commit fe5710a. While that added a similar test, we can explicitly test this reproducer too. Closes #50582.
2 parents c99a240 + 842014d commit 416edc1

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

src/test/ui/issues/issue-50582.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
Vec::<[(); 1 + for x in 0..1 {}]>::new();
3+
//~^ ERROR cannot add
4+
}

src/test/ui/issues/issue-50582.stderr

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0277]: cannot add `()` to `{integer}`
2+
--> $DIR/issue-50582.rs:2:18
3+
|
4+
LL | Vec::<[(); 1 + for x in 0..1 {}]>::new();
5+
| ^ no implementation for `{integer} + ()`
6+
|
7+
= help: the trait `std::ops::Add<()>` is not implemented for `{integer}`
8+
9+
error: aborting due to previous error
10+
11+
For more information about this error, try `rustc --explain E0277`.

0 commit comments

Comments
 (0)