-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #77420 - ecstatic-morse:const-checking-raw-mut-ref, r…
…=davidtwco Unify const-checking structured errors for `&mut` and `&raw mut` Resolves #77414 as well as a FIXME.
- Loading branch information
Showing
6 changed files
with
32 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
#![feature(raw_ref_op)] | ||
|
||
const A: () = { let mut x = 2; &raw mut x; }; //~ ERROR `&raw mut` is not allowed | ||
const A: () = { let mut x = 2; &raw mut x; }; //~ mutable reference | ||
|
||
static B: () = { let mut x = 2; &raw mut x; }; //~ ERROR `&raw mut` is not allowed | ||
static B: () = { let mut x = 2; &raw mut x; }; //~ mutable reference | ||
|
||
static mut C: () = { let mut x = 2; &raw mut x; }; //~ ERROR `&raw mut` is not allowed | ||
static mut C: () = { let mut x = 2; &raw mut x; }; //~ mutable reference | ||
|
||
const fn foo() { | ||
let mut x = 0; | ||
let y = &raw mut x; //~ ERROR `&raw mut` is not allowed | ||
let y = &raw mut x; //~ mutable reference | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters