about summary refs log tree commit diff
path: root/tests/ui/layout
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-11-21 01:34:50 +0000
committerMichael Goulet <michael@errs.io>2024-11-21 01:35:34 +0000
commit0465f71d600dbf9591b27ac569fa428cd5f7c013 (patch)
tree1eab62fb636b72bc8dfdf6a6625b1a5dd801b7fb /tests/ui/layout
parent2d0ea7956c45de6e421fd579e2ded27be405dec6 (diff)
downloadrust-0465f71d600dbf9591b27ac569fa428cd5f7c013.tar.gz
rust-0465f71d600dbf9591b27ac569fa428cd5f7c013.zip
Stop being so bail-y in candidate assembly
Diffstat (limited to 'tests/ui/layout')
-rw-r--r--tests/ui/layout/ice-type-error-in-tail-124031.rs3
-rw-r--r--tests/ui/layout/ice-type-error-in-tail-124031.stderr16
2 files changed, 16 insertions, 3 deletions
diff --git a/tests/ui/layout/ice-type-error-in-tail-124031.rs b/tests/ui/layout/ice-type-error-in-tail-124031.rs
index 0a2be117403..ecd6f3d56f3 100644
--- a/tests/ui/layout/ice-type-error-in-tail-124031.rs
+++ b/tests/ui/layout/ice-type-error-in-tail-124031.rs
@@ -1,3 +1,5 @@
+//@ normalize-stderr-test: "\d+ bits" -> "$$BITS bits"
+
 // Regression test for issue #124031
 // Checks that we don't ICE when the tail
 // of an ADT has a type error
@@ -16,5 +18,6 @@ struct Other {
 fn main() {
     unsafe {
         std::mem::transmute::<Option<()>, Option<&Other>>(None);
+        //~^ ERROR cannot transmute between types of different sizes
     }
 }
diff --git a/tests/ui/layout/ice-type-error-in-tail-124031.stderr b/tests/ui/layout/ice-type-error-in-tail-124031.stderr
index 57dc83f92df..a066e8574dc 100644
--- a/tests/ui/layout/ice-type-error-in-tail-124031.stderr
+++ b/tests/ui/layout/ice-type-error-in-tail-124031.stderr
@@ -1,5 +1,5 @@
 error[E0046]: not all trait items implemented, missing: `RefTarget`
-  --> $DIR/ice-type-error-in-tail-124031.rs:9:1
+  --> $DIR/ice-type-error-in-tail-124031.rs:11:1
    |
 LL |     type RefTarget;
    |     -------------- `RefTarget` from trait
@@ -7,6 +7,16 @@ LL |     type RefTarget;
 LL | impl Trait for () {}
    | ^^^^^^^^^^^^^^^^^ missing `RefTarget` in implementation
 
-error: aborting due to 1 previous error
+error[E0512]: cannot transmute between types of different sizes, or dependently-sized types
+  --> $DIR/ice-type-error-in-tail-124031.rs:20:9
+   |
+LL |         std::mem::transmute::<Option<()>, Option<&Other>>(None);
+   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+   |
+   = note: source type: `Option<()>` ($BITS bits)
+   = note: target type: `Option<&Other>` ($BITS bits)
+
+error: aborting due to 2 previous errors
 
-For more information about this error, try `rustc --explain E0046`.
+Some errors have detailed explanations: E0046, E0512.
+For more information about an error, try `rustc --explain E0046`.