Skip to content

Commit fd2626c

Browse files
committed
Auto merge of #30111 - GuillaumeGomez:patch-3, r=Manishearth
r? @Manishearth cc @huonw
2 parents 52d95e6 + 1099af7 commit fd2626c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc/diagnostics.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1950,9 +1950,9 @@ const E: &'static Cell<usize> = &D.a; // error
19501950
const F: &'static C = &D; // error
19511951
```
19521952
1953-
This is because cell types internally use `UnsafeCell`, which isn't `Sync`.
1954-
These aren't thread safe, and thus can't be placed in statics. In this case,
1955-
`StaticMutex` would work just fine, but it isn't stable yet:
1953+
This is because cell types do operations that are not thread-safe. Due to this,
1954+
they don't implement Sync and thus can't be placed in statics. In this
1955+
case, `StaticMutex` would work just fine, but it isn't stable yet:
19561956
https://doc.rust-lang.org/nightly/std/sync/struct.StaticMutex.html
19571957
19581958
However, if you still wish to use these types, you can achieve this by an unsafe

0 commit comments

Comments
 (0)