Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit eb1f9ba

Browse files
Add test for bad cast with deferred projection equality
1 parent 8973049 commit eb1f9ba

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// compile-flags: -Ztrait-solver=next
2+
// known-bug: unknown
3+
4+
fn main() {
5+
(0u8 + 0u8) as char;
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0271]: type mismatch resolving `char == <u8 as Add>::Output`
2+
--> $DIR/cast-checks-handling-projections.rs:5:5
3+
|
4+
LL | (0u8 + 0u8) as char;
5+
| ^^^^^^^^^^^ types differ
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0271`.

0 commit comments

Comments
 (0)