-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Showing
27 changed files
with
307 additions
and
15 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
23 changes: 23 additions & 0 deletions
23
tests/ui/async-await/issues/issue-67611-static-mut-refs.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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/issue-67611-static-mut-refs.rs:11:22 | ||
| | ||
LL | let u = unsafe { A[async { 1 }.await] }; | ||
| ^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
= note: `#[warn(static_mut_refs)]` on by default | ||
|
||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/issue-67611-static-mut-refs.rs:24:26 | ||
| | ||
LL | let u = unsafe { A[async { 1 }.await] }; | ||
| ^^^^^^^^^^^^^^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
|
||
warning: 2 warnings emitted | ||
|
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,33 @@ | ||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/order-drop-with-match.rs:16:13 | ||
| | ||
LL | ORDER[INDEX] = 1; | ||
| ^^^^^^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
= note: `#[warn(static_mut_refs)]` on by default | ||
|
||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/order-drop-with-match.rs:27:13 | ||
| | ||
LL | ORDER[INDEX] = 2; | ||
| ^^^^^^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
|
||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/order-drop-with-match.rs:38:13 | ||
| | ||
LL | ORDER[INDEX] = 3; | ||
| ^^^^^^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
|
||
warning: 3 warnings emitted | ||
|
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,23 @@ | ||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/static-mut-refs.rs:19:9 | ||
| | ||
LL | TEST[0] += 1; | ||
| ^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
= note: `#[warn(static_mut_refs)]` on by default | ||
|
||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/static-mut-refs.rs:21:20 | ||
| | ||
LL | assert_eq!(TEST[0], 2); | ||
| ^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
|
||
warning: 2 warnings emitted | ||
|
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
17 changes: 17 additions & 0 deletions
17
tests/ui/coroutine/static-mut-reference-across-yield.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/static-mut-reference-across-yield.rs:13:21 | ||
| | ||
LL | let u = A[{ | ||
| _____________________^ | ||
LL | | yield; | ||
LL | | 1 | ||
LL | | }]; | ||
| |______________^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
= note: `#[warn(static_mut_refs)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/issue-48962.rs:12:13 | ||
| | ||
LL | ORDER[INDEX] = self.0; | ||
| ^^^^^^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
= note: `#[warn(static_mut_refs)]` on by default | ||
|
||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/issue-48962.rs:21:9 | ||
| | ||
LL | ORDER[INDEX] = 2; | ||
| ^^^^^^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
|
||
warning: 2 warnings emitted | ||
|
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,33 @@ | ||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/static-issue-17302.rs:11:18 | ||
| | ||
LL | unsafe { DROPPED[i] = true; } | ||
| ^^^^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
= note: `#[warn(static_mut_refs)]` on by default | ||
|
||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/static-issue-17302.rs:24:17 | ||
| | ||
LL | assert!(DROPPED[0]); | ||
| ^^^^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
|
||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/static-issue-17302.rs:26:17 | ||
| | ||
LL | assert!(DROPPED[1]); | ||
| ^^^^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
|
||
warning: 3 warnings emitted | ||
|
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
15 changes: 13 additions & 2 deletions
15
tests/ui/functional-struct-update/functional-struct-update-respects-privacy.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,9 +1,20 @@ | ||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/functional-struct-update-respects-privacy.rs:14:36 | ||
| | ||
LL | let val = unsafe { let p = COUNT.get(); let val = *p; *p = val + 1; val }; | ||
| ^^^^^^^^^^^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
= note: `#[warn(static_mut_refs)]` on by default | ||
|
||
error[E0451]: field `secret_uid` of struct `S` is private | ||
--> $DIR/functional-struct-update-respects-privacy.rs:28:49 | ||
--> $DIR/functional-struct-update-respects-privacy.rs:29:49 | ||
| | ||
LL | let s_2 = foo::S { b: format!("ess two"), ..s_1 }; // FRU ... | ||
| ^^^ field `secret_uid` is private | ||
|
||
error: aborting due to 1 previous error | ||
error: aborting due to 1 previous error; 1 warning emitted | ||
|
||
For more information about this error, try `rustc --explain E0451`. |
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,17 @@ | ||
warning: creating a shared reference to mutable static is discouraged | ||
--> $DIR/issue-39367.rs:22:13 | ||
| | ||
LL | / ONCE.call_once(|| { | ||
LL | | DATA = transmute | ||
LL | | ::<Box<ArenaSet<Vec<u8>>>, *const ArenaSet<Vec<u8>>> | ||
LL | | (Box::new(__static_ref_initialize())); | ||
LL | | }); | ||
| |______________^ shared reference to mutable static | ||
| | ||
= note: for more information, see issue #114447 <https://github.com/rust-lang/rust/issues/114447> | ||
= note: this will be a hard error in the 2024 edition | ||
= note: this shared reference has lifetime `'static`, but if the static ever gets mutated, or a mutable reference is created, then any further use of this shared reference is Undefined Behavior | ||
= note: `#[warn(static_mut_refs)]` on by default | ||
|
||
warning: 1 warning emitted | ||
|
Oops, something went wrong.