about summary refs log tree commit diff
path: root/library/std/src/sys/unix/stack_overflow.rs
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2021-02-12 22:53:29 +0100
committerGitHub <noreply@github.com>2021-02-12 22:53:29 +0100
commitfc93e260e914aefb6896a65de025fb34127cccaf (patch)
treeea75ad358d946906d138142c1bdc7b566f90afcb /library/std/src/sys/unix/stack_overflow.rs
parent8280abc57b50a08b42cbfec39e6a6840f466c33c (diff)
parentd64b749f2cebcfec942ecbbb87e24a9f8cc28469 (diff)
downloadrust-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