blob: 4229d1fb2745f9f3452532a0a63b5eff7da7310e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
//! Tests basic pointer coercions
//@ run-pass
pub fn main() {
// &mut -> &
let x: &mut isize = &mut 42;
let _x: &isize = x;
let _x: &isize = &mut 42;
// & -> *const
let x: &isize = &42;
let _x: *const isize = x;
let _x: *const isize = &42;
// &mut -> *const
let x: &mut isize = &mut 42;
let _x: *const isize = x;
let _x: *const isize = &mut 42;
// *mut -> *const
let _x: *mut isize = &mut 42;
let _x: *const isize = x;
}
|