-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make writes_through_immutable_pointer a hard error
- Loading branch information
Showing
7 changed files
with
23 additions
and
102 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
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
54 changes: 7 additions & 47 deletions
54
tests/ui/consts/const-eval/ub-write-through-immutable.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,15 @@ | ||
error: writing through a pointer that was derived from a shared (immutable) reference | ||
--> $DIR/ub-write-through-immutable.rs:12:5 | ||
error[E0080]: evaluation of constant value failed | ||
--> $DIR/ub-write-through-immutable.rs:11:5 | ||
| | ||
LL | *ptr = 0; | ||
| ^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #X <https://github.com/rust-lang/rust/issues/X> | ||
note: the lint level is defined here | ||
--> $DIR/ub-write-through-immutable.rs:3:9 | ||
| | ||
LL | #![deny(writes_through_immutable_pointer)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| ^^^^^^^^ writing through a pointer that was derived from a shared (immutable) reference | ||
|
||
error: writing through a pointer that was derived from a shared (immutable) reference | ||
--> $DIR/ub-write-through-immutable.rs:19:5 | ||
error[E0080]: evaluation of constant value failed | ||
--> $DIR/ub-write-through-immutable.rs:18:5 | ||
| | ||
LL | *ptr = 0; | ||
| ^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #X <https://github.com/rust-lang/rust/issues/X> | ||
| ^^^^^^^^ writing through a pointer that was derived from a shared (immutable) reference | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Future incompatibility report: Future breakage diagnostic: | ||
error: writing through a pointer that was derived from a shared (immutable) reference | ||
--> $DIR/ub-write-through-immutable.rs:12:5 | ||
| | ||
LL | *ptr = 0; | ||
| ^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #X <https://github.com/rust-lang/rust/issues/X> | ||
note: the lint level is defined here | ||
--> $DIR/ub-write-through-immutable.rs:3:9 | ||
| | ||
LL | #![deny(writes_through_immutable_pointer)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
Future breakage diagnostic: | ||
error: writing through a pointer that was derived from a shared (immutable) reference | ||
--> $DIR/ub-write-through-immutable.rs:19:5 | ||
| | ||
LL | *ptr = 0; | ||
| ^^^^^^^^ | ||
| | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! | ||
= note: for more information, see issue #X <https://github.com/rust-lang/rust/issues/X> | ||
note: the lint level is defined here | ||
--> $DIR/ub-write-through-immutable.rs:3:9 | ||
| | ||
LL | #![deny(writes_through_immutable_pointer)] | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
For more information about this error, try `rustc --explain E0080`. |