1 // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // Issue #14893. Tests that casts from vectors don't behave strangely in the
12 // presence of the `_` type shorthand notation.
19 let x1 = X { y: [0, 0] };
21 let p1: *u8 = &x1.y as *_; //~ ERROR mismatched types
22 let t1: *[u8, ..2] = &x1.y as *_;
23 let h1: *[u8, ..2] = &x1.y as *[u8, ..2];
25 let mut x1 = X { y: [0, 0] };
27 let p1: *mut u8 = &mut x1.y as *mut _; //~ ERROR mismatched types
28 let t1: *mut [u8, ..2] = &mut x1.y as *mut _;
29 let h1: *mut [u8, ..2] = &mut x1.y as *mut [u8, ..2];