File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change
1
+ //@ run-pass
2
+ //@ check-run-results
3
+ //@ normalize-stdout-test: "0x[0-9a-fA-F]+" -> "$$HEX"
4
+
5
+ use std:: fmt:: Display ;
6
+
7
+ fn main ( ) {
8
+ let plain = & mut 777 ;
9
+ println ! ( "*mut i32: {:?}" , plain as * mut i32 ) ;
10
+ println ! ( "*const i32: {:?}" , plain as * const i32 ) ;
11
+
12
+ let slice = & mut [ 1 , 2 , 3 ] [ ..] ;
13
+ println ! ( "*mut [i32]: {:?}" , slice as * mut [ i32 ] ) ;
14
+ println ! ( "*const [i32]: {:?}" , slice as * const [ i32 ] ) ;
15
+
16
+ let vtable = & mut 999 as & mut dyn Display ;
17
+ println ! ( "*mut dyn Display: {:?}" , vtable as * mut dyn Display ) ;
18
+ println ! ( "*const dyn Display: {:?}" , vtable as * const dyn Display ) ;
19
+ }
Original file line number Diff line number Diff line change
1
+ *mut i32: $HEX
2
+ *const i32: $HEX
3
+ *mut [i32]: $HEX
4
+ *const [i32]: $HEX
5
+ *mut dyn Display: $HEX
6
+ *const dyn Display: $HEX
You can’t perform that action at this time.
0 commit comments