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.
This commit is contained in:
parent
a9da8fc9c2
commit
842014d8fc
4
src/test/ui/issues/issue-50582.rs
Normal file
4
src/test/ui/issues/issue-50582.rs
Normal file
@ -0,0 +1,4 @@
|
||||
fn main() {
|
||||
Vec::<[(); 1 + for x in 0..1 {}]>::new();
|
||||
//~^ ERROR cannot add
|
||||
}
|
11
src/test/ui/issues/issue-50582.stderr
Normal file
11
src/test/ui/issues/issue-50582.stderr
Normal file
@ -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`.
|
Loading…
x
Reference in New Issue
Block a user