summaryrefslogtreecommitdiff
path: root/tests/ui/typeck
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-02-20 21:02:04 +0000
committerMichael Goulet <michael@errs.io>2023-02-21 00:07:06 +0000
commiteb1f9babecbe51b7580e71ed8e558ff40eeee96c (patch)
tree9edb88e44c0ebaefd3a6fe5d0602a0aa8a229753 /tests/ui/typeck
parent897304954922a89f8af8bc4b1c40c2e78a3c62b0 (diff)
downloadrust-eb1f9babecbe51b7580e71ed8e558ff40eeee96c.tar.gz
Add test for bad cast with deferred projection equality
Diffstat (limited to 'tests/ui/typeck')
-rw-r--r--tests/ui/typeck/lazy-norm/cast-checks-handling-projections.rs6
-rw-r--r--tests/ui/typeck/lazy-norm/cast-checks-handling-projections.stderr9
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/typeck/lazy-norm/cast-checks-handling-projections.rs b/tests/ui/typeck/lazy-norm/cast-checks-handling-projections.rs
new file mode 100644
index 00000000000..5ff567cd07c
--- /dev/null
+++ b/tests/ui/typeck/lazy-norm/cast-checks-handling-projections.rs
@@ -0,0 +1,6 @@
+// compile-flags: -Ztrait-solver=next
+// known-bug: unknown
+
+fn main() {
+ (0u8 + 0u8) as char;
+}
diff --git a/tests/ui/typeck/lazy-norm/cast-checks-handling-projections.stderr b/tests/ui/typeck/lazy-norm/cast-checks-handling-projections.stderr
new file mode 100644
index 00000000000..6b09ccd5214
--- /dev/null
+++ b/tests/ui/typeck/lazy-norm/cast-checks-handling-projections.stderr
@@ -0,0 +1,9 @@
+error[E0271]: type mismatch resolving `char == <u8 as Add>::Output`
+ --> $DIR/cast-checks-handling-projections.rs:5:5
+ |
+LL | (0u8 + 0u8) as char;
+ | ^^^^^^^^^^^ types differ
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0271`.