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 a regression test for rust-lang#134162
- Loading branch information
Showing
4 changed files
with
51 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,11 @@ | ||
error[E0369]: binary operation `==` cannot be applied to type `[X; 1]` | ||
--> $DIR/rhs-ty-hint-134162.rs:16:17 | ||
| | ||
LL | let _ = [X] == [panic!(); 2]; | ||
| --- ^^ ------------- [_; 2] | ||
| | | ||
| [X; 1] | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0369`. |
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[E0369]: binary operation `==` cannot be applied to type `[X; 1]` | ||
--> $DIR/rhs-ty-hint-134162.rs:16:17 | ||
| | ||
LL | let _ = [X] == [panic!(); 2]; | ||
| --- ^^ ------------- [_; 2] | ||
| | | ||
| [X; 1] | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0369`. |
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[E0369]: binary operation `==` cannot be applied to type `[X; 1]` | ||
--> $DIR/rhs-ty-hint-134162.rs:16:17 | ||
| | ||
LL | let _ = [X] == [panic!(); 2]; | ||
| --- ^^ ------------- [_; 2] | ||
| | | ||
| [X; 1] | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0369`. |
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,18 @@ | ||
//! Regression test for <https://github.com/rust-lang/rust/issues/134162>. | ||
//! | ||
//! <https://github.com/rust-lang/rust/pull/110877> introduced RHS type hints for when a ty doesn't | ||
//! support a bin op. In the suggestion path, there was a `delay_bug`. | ||
//! <https://github.com/rust-lang/rust/pull/121208> converted this `delay_bug` to `bug`, which did | ||
//! not trigger any test failures as we did not have test coverage for this particular case. This | ||
//! manifested in an ICE as reported in <https://github.com/rust-lang/rust/issues/134162>. | ||
//@ revisions: e2018 e2021 e2024 | ||
//@[e2018] edition: 2018 | ||
//@[e2021] edition: 2021 | ||
//@[e2024] edition: 2024 | ||
|
||
fn main() { | ||
struct X; | ||
let _ = [X] == [panic!(); 2]; | ||
//[e2018,e2021,e2024]~^ ERROR binary operation `==` cannot be applied to type `[X; 1]` | ||
} |