about summary refs log tree commit diff
path: root/library/std/src/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
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
commitd64b749f2cebcfec942ecbbb87e24a9f8cc28469 (patch)
tree4beeddf028a59d62fbe674d92e0c680049e26ae2 /library/std/src/sys/unix/stack_overflow.rs
parent6523b721c3d8a92cf06aab04dd15ebe7fd5a9fb7 (diff)
downloadrust-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