about summary refs log tree commit diff
path: root/src/test/ui/array-slice-vec/vector-cast-weirdness.rs
AgeCommit message (Collapse)AuthorLines
2021-02-10Allow casting mut array ref to mut ptrÖmer Sinan Ağacan-2/+12
We now allow two new casts: - mut array reference to mut ptr. Example: let mut x: [usize; 2] = [0, 0]; let p = &mut x as *mut usize; We allow casting const array references to const pointers so not allowing mut references to mut pointers was inconsistent. - mut array reference to const ptr. Example: let mut x: [usize; 2] = [0, 0]; let p = &mut x as *const usize; This was similarly inconsistent as we allow casting mut references to const pointers. Existing test 'vector-cast-weirdness' updated to test both cases. Fixes #24151
2020-12-31Move array-slice-vec-related testsYuki Okushi-0/+24