forked from rust-lang/rust
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement Mutation- and BorrowOfLayoutConstrainedField in thir-unsafeck
- Loading branch information
1 parent
a84d1b2
commit b088861
Showing
30 changed files
with
512 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1131,3 +1131,5 @@ mod expr; | |
mod matches; | ||
mod misc; | ||
mod scope; | ||
|
||
pub(crate) use expr::category::Category as ExprCategory; |
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
2 changes: 1 addition & 1 deletion
2
src/test/ui/unsafe/ranged_ints2.stderr → ...ui/unsafe/ranged_ints2.mirunsafeck.stderr
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,11 @@ | ||
error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block | ||
--> $DIR/ranged_ints2.rs:11:13 | ||
| | ||
LL | let y = &mut x.0; | ||
| ^^^^^^^^ mutation of layout constrained field | ||
| | ||
= note: mutating layout constrained fields cannot statically be checked for valid values | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0133`. |
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,39 @@ | ||
error[E0133]: mutation of layout constrained field is unsafe and requires unsafe function or block | ||
--> $DIR/ranged_ints2_const.rs:14:13 | ||
| | ||
LL | let y = &mut x.0; | ||
| ^^^^^^^^ mutation of layout constrained field | ||
| | ||
= note: mutating layout constrained fields cannot statically be checked for valid values | ||
|
||
error[E0658]: mutable references are not allowed in constant functions | ||
--> $DIR/ranged_ints2_const.rs:14:13 | ||
| | ||
LL | let y = &mut x.0; | ||
| ^^^^^^^^ | ||
| | ||
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information | ||
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable | ||
|
||
error[E0658]: mutable references are not allowed in constant functions | ||
--> $DIR/ranged_ints2_const.rs:21:22 | ||
| | ||
LL | let y = unsafe { &mut x.0 }; | ||
| ^^^^^^^^ | ||
| | ||
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information | ||
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable | ||
|
||
error[E0658]: mutable references are not allowed in constant functions | ||
--> $DIR/ranged_ints2_const.rs:27:22 | ||
| | ||
LL | unsafe { let y = &mut x.0; } | ||
| ^^^^^^^^ | ||
| | ||
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information | ||
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable | ||
|
||
error: aborting due to 4 previous errors | ||
|
||
Some errors have detailed explanations: E0133, E0658. | ||
For more information about an error, try `rustc --explain E0133`. |
2 changes: 1 addition & 1 deletion
2
src/test/ui/unsafe/ranged_ints3.stderr → ...ui/unsafe/ranged_ints3.mirunsafeck.stderr
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
Oops, something went wrong.