rust/tests
bors ba1690bedd Auto merge of #111567 - Urgau:uplift_cast_ref_to_mut, r=b-naber
Uplift `clippy::cast_ref_to_mut` lint

This PR aims at uplifting the `clippy::cast_ref_to_mut` lint into rustc.

## `cast_ref_to_mut`

(deny-by-default)

The `cast_ref_to_mut` lint checks for casts of `&T` to `&mut T` without using interior mutability.

### Example

```rust,compile_fail
fn x(r: &i32) {
    unsafe {
        *(r as *const i32 as *mut i32) += 1;
    }
}
```

### Explanation

Casting `&T` to `&mut T` without interior mutability is undefined behavior, as it's a violation of Rust reference aliasing requirements.

-----

Mostly followed the instructions for uplifting a clippy lint described here: https://github.com/rust-lang/rust/pull/99696#pullrequestreview-1134072751

`@rustbot` label: +I-lang-nominated
r? compiler

-----

For Clippy:

changelog: Moves: Uplifted `clippy::cast_ref_to_mut` into rustc
2023-06-01 01:27:32 +00:00
..
assembly Fix linkage for large binaries on mips64 platforms ... 2023-05-29 10:57:03 -06:00
auxiliary
codegen Auto merge of #111913 - oli-obk:valtrees2, r=lcnr 2023-05-31 16:36:51 +00:00
codegen-units
debuginfo Add multiple borrow test. 2023-05-13 10:32:32 +00:00
incremental Only rewrite valtree-constants to patterns and keep other constants opaque 2023-05-31 14:02:57 +00:00
mir-opt Only rewrite valtree-constants to patterns and keep other constants opaque 2023-05-31 14:02:57 +00:00
pretty Rollup merge of #111042 - Zalathar:no-coverage, r=wesleywiser 2023-05-01 17:10:24 +02:00
run-make Auto merge of #86844 - bjorn3:global_alloc_improvements, r=pnkfelix 2023-05-25 16:59:57 +00:00
run-make-fulldeps Move BodyWithBorrowckFacts to consumers 2023-05-23 14:36:36 +02:00
run-pass-valgrind
rustdoc Add regression test for re-export of doc hidden item inside private item not displayed 2023-05-30 20:27:53 +02:00
rustdoc-gui Rollup merge of #112064 - GuillaumeGomez:migrate-gui-test-color-9, r=notriddle 2023-05-30 12:57:40 +02:00
rustdoc-js Rollup merge of #110780 - notriddle:notriddle/slice-index, r=GuillaumeGomez 2023-05-06 09:09:31 +09:00
rustdoc-js-std
rustdoc-json Serialize all enums as externally tagged to guarantee compatibility with binary formats such as bincode or postcard 2023-05-22 18:22:08 +01:00
rustdoc-ui rustdoc: get unnormalized link destination for suggestions 2023-05-26 18:38:46 -07:00
ui Auto merge of #111567 - Urgau:uplift_cast_ref_to_mut, r=b-naber 2023-06-01 01:27:32 +00:00
ui-fulldeps Use Cow in {D,Subd}iagnosticMessage. 2023-05-29 09:23:43 +10:00
COMPILER_TESTS.md