diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/consts/const_transmute_type_id4.rs | 2 | ||||
| -rw-r--r-- | tests/ui/consts/const_transmute_type_id4.stderr | 2 | ||||
| -rw-r--r-- | tests/ui/consts/const_transmute_type_id5.rs | 9 | ||||
| -rw-r--r-- | tests/ui/consts/const_transmute_type_id5.stderr | 6 |
4 files changed, 9 insertions, 10 deletions
diff --git a/tests/ui/consts/const_transmute_type_id4.rs b/tests/ui/consts/const_transmute_type_id4.rs index 22a607e9e0e..0ea75f2a2f4 100644 --- a/tests/ui/consts/const_transmute_type_id4.rs +++ b/tests/ui/consts/const_transmute_type_id4.rs @@ -10,7 +10,7 @@ const _: () = { std::ptr::write(ptr.offset(0), main as fn() as *const ()); } assert!(a == b); - //~^ ERROR: type_id_eq: `TypeId` provenance is not a type id + //~^ ERROR: invalid `TypeId` value }; fn main() {} diff --git a/tests/ui/consts/const_transmute_type_id4.stderr b/tests/ui/consts/const_transmute_type_id4.stderr index b418a79d7f0..b224227cf35 100644 --- a/tests/ui/consts/const_transmute_type_id4.stderr +++ b/tests/ui/consts/const_transmute_type_id4.stderr @@ -1,4 +1,4 @@ -error[E0080]: type_id_eq: `TypeId` provenance is not a type id +error[E0080]: invalid `TypeId` value: not all bytes carry type id metadata --> $DIR/const_transmute_type_id4.rs:12:13 | LL | assert!(a == b); diff --git a/tests/ui/consts/const_transmute_type_id5.rs b/tests/ui/consts/const_transmute_type_id5.rs index 0a9ba01e0dd..ae0429f8dbb 100644 --- a/tests/ui/consts/const_transmute_type_id5.rs +++ b/tests/ui/consts/const_transmute_type_id5.rs @@ -1,12 +1,11 @@ -//! Test that we require an equal TypeId to have the same integer -//! part, even if the provenance matches. +//! Test that we require an equal TypeId to have an integer part that properly +//! reflects the type id hash. #![feature(const_type_id, const_trait_impl, const_cmp)] use std::any::TypeId; const _: () = { - let a = TypeId::of::<()>(); let mut b = TypeId::of::<()>(); unsafe { let ptr = &mut b as *mut TypeId as *mut *const (); @@ -14,8 +13,8 @@ const _: () = { let val = std::ptr::read(ptr); std::ptr::write(ptr.offset(1), val); } - assert!(a == b); - //~^ ERROR: type_id_eq: one of the TypeId arguments is invalid, chunk 1 of the hash does not match the type it represents + assert!(b == b); + //~^ ERROR: invalid `TypeId` value }; fn main() {} diff --git a/tests/ui/consts/const_transmute_type_id5.stderr b/tests/ui/consts/const_transmute_type_id5.stderr index 59823fcc1c9..6205679ebb6 100644 --- a/tests/ui/consts/const_transmute_type_id5.stderr +++ b/tests/ui/consts/const_transmute_type_id5.stderr @@ -1,7 +1,7 @@ -error[E0080]: type_id_eq: one of the TypeId arguments is invalid, chunk 1 of the hash does not match the type it represents - --> $DIR/const_transmute_type_id5.rs:17:13 +error[E0080]: invalid `TypeId` value: the hash does not match the type id metadata + --> $DIR/const_transmute_type_id5.rs:16:13 | -LL | assert!(a == b); +LL | assert!(b == b); | ^^^^^^ evaluation of `_` failed inside this call | note: inside `<TypeId as PartialEq>::eq` |
