diff options
| author | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2021-01-28 20:22:33 +0300 |
|---|---|---|
| committer | Ömer Sinan Ağacan <omeragacan@gmail.com> | 2021-02-10 15:44:41 +0300 |
| commit | d64b749f2cebcfec942ecbbb87e24a9f8cc28469 (patch) | |
| tree | 4beeddf028a59d62fbe674d92e0c680049e26ae2 /library/std/src/sys/unix/stack_overflow.rs | |
| parent | 6523b721c3d8a92cf06aab04dd15ebe7fd5a9fb7 (diff) | |
| download | rust-d64b749f2cebcfec942ecbbb87e24a9f8cc28469.tar.gz rust-d64b749f2cebcfec942ecbbb87e24a9f8cc28469.zip | |
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
