This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
compiler/rustc_mir/src/transform/check_consts Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -251,15 +251,15 @@ impl NonConstOp for CellBorrow {
251251 ) ;
252252 if let hir:: ConstContext :: Static ( _) = ccx. const_kind ( ) {
253253 err. help (
254- "To fix this, the value can be extracted to separate \
255- `static` and then referenced. ",
254+ "to fix this, the value can be extracted to a separate \
255+ `static` item and then referenced",
256256 ) ;
257257 }
258258 if ccx. tcx . sess . teach ( & err. get_code ( ) . unwrap ( ) ) {
259259 err. note (
260260 "A constant containing interior mutable data behind a reference can allow you
261261 to modify that data. This would make multiple uses of a constant to be able to
262- see different values and allow one to escape the `Send` and `Sync` requirements
262+ see different values and allow circumventing the `Send` and `Sync` requirements
263263 for shared mutable data, which is unsound." ,
264264 ) ;
265265 }
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ error[E0492]: statics cannot refer to interior mutable data
1010LL | static C: &'static AtomicUsize = &A;
1111 | ^^ this borrow of an interior mutable value may end up in the final value
1212 |
13- = help: To fix this, the value can be extracted to separate `static` and then referenced.
13+ = help: to fix this, the value can be extracted to a separate `static` item and then referenced
1414
1515error: aborting due to 2 previous errors
1616
You can’t perform that action at this time.
0 commit comments