-
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.
- Loading branch information
1 parent
7aa8c6d
commit fc0bc1d
Showing
9 changed files
with
74 additions
and
9 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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
fn main() { | ||
let mut ref x = 10; //~ ERROR [E0658] | ||
x = &11; | ||
let ref mut y = 12; | ||
*y = 13; | ||
let mut ref mut z = 14; //~ ERROR [E0658] | ||
z = &mut 15; | ||
|
||
#[cfg(FALSE)] | ||
let mut ref x = 10; //~ ERROR [E0658] | ||
#[cfg(FALSE)] | ||
let mut ref mut y = 10; //~ ERROR [E0658] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
error[E0658]: mutable by-reference bindings are experimental | ||
--> $DIR/feature-gate-mut-ref.rs:2:17 | ||
| | ||
LL | let mut ref x = 10; | ||
| ^ | ||
| | ||
= note: see issue #123076 <https://github.com/rust-lang/rust/issues/123076> for more information | ||
= help: add `#![feature(mut_ref)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0658]: mutable by-reference bindings are experimental | ||
--> $DIR/feature-gate-mut-ref.rs:6:21 | ||
| | ||
LL | let mut ref mut z = 14; | ||
| ^ | ||
| | ||
= note: see issue #123076 <https://github.com/rust-lang/rust/issues/123076> for more information | ||
= help: add `#![feature(mut_ref)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0658]: mutable by-reference bindings are experimental | ||
--> $DIR/feature-gate-mut-ref.rs:10:17 | ||
| | ||
LL | let mut ref x = 10; | ||
| ^ | ||
| | ||
= note: see issue #123076 <https://github.com/rust-lang/rust/issues/123076> for more information | ||
= help: add `#![feature(mut_ref)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error[E0658]: mutable by-reference bindings are experimental | ||
--> $DIR/feature-gate-mut-ref.rs:12:21 | ||
| | ||
LL | let mut ref mut y = 10; | ||
| ^ | ||
| | ||
= note: see issue #123076 <https://github.com/rust-lang/rust/issues/123076> for more information | ||
= help: add `#![feature(mut_ref)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |
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,4 +1,5 @@ | ||
//@ edition: 2021 | ||
#![feature(mut_ref)] | ||
|
||
struct Foo(u8); | ||
|
||
|
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,5 +1,5 @@ | ||
//@ check-pass | ||
|
||
#![feature(mut_ref)] | ||
fn main() { | ||
let mut ref x = 10; | ||
x = &11; | ||
|