forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an explicit test for issue rust-lang#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 rust-lang#50582.
- Loading branch information
Showing
2 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
fn main() { | ||
Vec::<[(); 1 + for x in 0..1 {}]>::new(); | ||
//~^ ERROR cannot add | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0277]: cannot add `()` to `{integer}` | ||
--> $DIR/issue-50582.rs:2:18 | ||
| | ||
LL | Vec::<[(); 1 + for x in 0..1 {}]>::new(); | ||
| ^ no implementation for `{integer} + ()` | ||
| | ||
= help: the trait `std::ops::Add<()>` is not implemented for `{integer}` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |