Skip to content

Commit

Permalink
Auto merge of #113422 - Urgau:cast_ref_to_mut-pre-beta, r=Nilstrieb
Browse files Browse the repository at this point in the history
Rename and allow `cast_ref_to_mut` lint

This PR is a small subset of rust-lang/rust#112431, that is the renaming of the lint (`cast_ref_to_mut` -> `invalid_reference_casting`).

BUT also temporarily change the default level of the lint from deny-by-default to allow-by-default until rust-lang/rust#112431 is merged.

r? `@Nilstrieb`
  • Loading branch information
bors committed Jul 29, 2023
2 parents cc7d560 + 24b9f82 commit 2451ef5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/fail/both_borrows/shr_frozen_violation1.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@revisions: stack tree
//@[tree]compile-flags: -Zmiri-tree-borrows

#![allow(cast_ref_to_mut)]
#![allow(invalid_reference_casting)]

fn foo(x: &mut i32) -> i32 {
*x = 5;
Expand Down
2 changes: 1 addition & 1 deletion tests/fail/modifying_constants.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This should fail even without validation/SB
//@compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows

#![allow(cast_ref_to_mut)]
#![allow(invalid_reference_casting)]

fn main() {
let x = &1; // the `&1` is promoted to a constant, but it used to be that only the pointer is marked static, not the pointee
Expand Down

0 comments on commit 2451ef5

Please sign in to comment.