Skip to content

Commit 0b0744a

Browse files
committed
Add a regression test for rust-lang#134162
1 parent a1740a9 commit 0b0744a

5 files changed

+51
-8
lines changed

tests/crashes/134162.rs

-8
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0369]: binary operation `==` cannot be applied to type `[X; 1]`
2+
--> $DIR/rhs-ty-hint-134162.rs:16:17
3+
|
4+
LL | let _ = [X] == [panic!(); 2];
5+
| --- ^^ ------------- [_; 2]
6+
| |
7+
| [X; 1]
8+
9+
error: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0369`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0369]: binary operation `==` cannot be applied to type `[X; 1]`
2+
--> $DIR/rhs-ty-hint-134162.rs:16:17
3+
|
4+
LL | let _ = [X] == [panic!(); 2];
5+
| --- ^^ ------------- [_; 2]
6+
| |
7+
| [X; 1]
8+
9+
error: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0369`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0369]: binary operation `==` cannot be applied to type `[X; 1]`
2+
--> $DIR/rhs-ty-hint-134162.rs:16:17
3+
|
4+
LL | let _ = [X] == [panic!(); 2];
5+
| --- ^^ ------------- [_; 2]
6+
| |
7+
| [X; 1]
8+
9+
error: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0369`.

tests/ui/typeck/rhs-ty-hint-134162.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//! Regression test for <https://github.com/rust-lang/rust/issues/134162>.
2+
//!
3+
//! <https://github.com/rust-lang/rust/pull/110877> introduced RHS type hints for when a ty doesn't
4+
//! support a bin op. In the suggestion path, there was a `delay_bug`.
5+
//! <https://github.com/rust-lang/rust/pull/121208> converted this `delay_bug` to `bug`, which did
6+
//! not trigger any test failures as we did not have test coverage for this particular case. This
7+
//! manifested in an ICE as reported in <https://github.com/rust-lang/rust/issues/134162>.
8+
9+
//@ revisions: e2018 e2021 e2024
10+
//@[e2018] edition: 2018
11+
//@[e2021] edition: 2021
12+
//@[e2024] edition: 2024
13+
14+
fn main() {
15+
struct X;
16+
let _ = [X] == [panic!(); 2];
17+
//[e2018,e2021,e2024]~^ ERROR binary operation `==` cannot be applied to type `[X; 1]`
18+
}

0 commit comments

Comments
 (0)