]> git.lizzy.rs Git - rust.git/blob - tests/ui/ptr-coercion-rpass.rs
Auto merge of #106853 - TimNN:undo-remap, r=oli-obk
[rust.git] / tests / ui / ptr-coercion-rpass.rs
1 // run-pass
2
3 #![allow(unused_variables)]
4 // Test coercions between pointers which don't do anything fancy like unsizing.
5
6 // pretty-expanded FIXME #23616
7
8 pub fn main() {
9     // &mut -> &
10     let x: &mut isize = &mut 42;
11     let x: &isize = x;
12
13     let x: &isize = &mut 42;
14
15     // & -> *const
16     let x: &isize = &42;
17     let x: *const isize = x;
18
19     let x: *const isize = &42;
20
21     // &mut -> *const
22     let x: &mut isize = &mut 42;
23     let x: *const isize = x;
24
25     let x: *const isize = &mut 42;
26
27     // *mut -> *const
28     let x: *mut isize = &mut 42;
29     let x: *const isize = x;
30 }