rust/compiler
Ömer Sinan Ağacan d64b749f2c 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
2021-02-10 15:44:41 +03:00
..
2021-02-09 11:39:20 +03:00
2021-02-04 16:20:57 +01:00
2021-02-09 11:39:20 +03:00
2021-02-09 11:39:20 +03:00
2021-02-02 12:37:22 -05:00