diff options
| author | Dylan DPC <dylan.dpc@gmail.com> | 2021-02-12 22:53:29 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-12 22:53:29 +0100 |
| commit | fc93e260e914aefb6896a65de025fb34127cccaf (patch) | |
| tree | ea75ad358d946906d138142c1bdc7b566f90afcb /library/std/src/sys/unix/stack_overflow.rs | |
| parent | 8280abc57b50a08b42cbfec39e6a6840f466c33c (diff) | |
| parent | d64b749f2cebcfec942ecbbb87e24a9f8cc28469 (diff) | |
| download | rust-fc93e260e914aefb6896a65de025fb34127cccaf.tar.gz rust-fc93e260e914aefb6896a65de025fb34127cccaf.zip | |
Rollup merge of #81479 - osa1:issue24151, r=lcnr
Allow casting mut array ref to mut ptr
Allow casting mut array ref to mut ptr
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
Diffstat (limited to 'library/std/src/sys/unix/stack_overflow.rs')
0 files changed, 0 insertions, 0 deletions
