File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
tests/ui/consts/const-eval Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 11// ignore-tidy-linelength
22#![ allow( unused) ]
33
4- use std:: mem;
4+ use std:: { ptr , mem} ;
55
66// Strip out raw byte dumps to make comparison platform-independent:
77//@ normalize-stderr-test "(the raw bytes of the constant) \(size: [0-9]*, align: [0-9]*\)" -> "$1 (size: $$SIZE, align: $$ALIGN)"
@@ -145,6 +145,8 @@ const RAW_TRAIT_OBJ_VTABLE_NULL: *const dyn Trait = unsafe { mem::transmute((&92
145145const RAW_TRAIT_OBJ_VTABLE_INVALID : * const dyn Trait = unsafe { mem:: transmute ( ( & 92u8 , & 3u64 ) ) } ;
146146//~^ ERROR it is undefined behavior to use this value
147147const RAW_TRAIT_OBJ_CONTENT_INVALID : * const dyn Trait = unsafe { mem:: transmute :: < _ , & bool > ( & 3u8 ) } as * const dyn Trait ; // ok because raw
148+ // Officially blessed way to get the vtable
149+ const DYN_METADATA : DynMetadata < dyn Send > = ptr:: metadata :: < dyn Send > ( ptr:: null :: < i32 > ( ) ) ;
148150
149151// Const eval fails for these, so they need to be statics to error.
150152static mut RAW_TRAIT_OBJ_VTABLE_NULL_THROUGH_REF : * const dyn Trait = unsafe {
You can’t perform that action at this time.
0 commit comments