Closed
Description
Consider the following code:
struct X {
y: [u8, ..2],
}
fn main() {
let x1 = X { y: [0, 0] };
let p1: *u8 = &x1.y as *_;
let t1: *[u8, ..2] = &x1.y as *_;
let h1: *[u8, ..2] = &x1.y as *[u8, ..2];
}
The second cast is an error. The other casts work.
Consider the following code:
fn main() {
let mut x1 = X { y: [0, 0] };
let p1: *mut u8 = &mut x1.y as *mut _;
let t1: *mut [u8, ..2] = &mut x1.y as *mut _;
let h1: *mut [u8, ..2] = &mut x1.y as *mut [u8, ..2];
}
The first cast is an error. The other casts work.
Metadata
Metadata
Assignees
Labels
No labels