Skip to content

Commit 9ebe418

Browse files
authored
Rollup merge of #153038 - pthariensflame:syncview-rename, r=Amanieu
core::sync: rename `Exclusive` to `SyncView` and make improvements This PR implements the renaming of `core::sync::Exclusive` to `SyncView` as decided in #98407. To preserve the ability to search for the old name, it adds `Exclusive` as a `doc_alias`. It also makes the following additional changes: - Converting the `get_mut` method to being an instance of `AsMut::as_mut`. In the process, it makes both the new `impl AsMut` and the existing `impl AsRef` `const`, and it also renames `get_pin_mut` to `as_pin_mut` for consistency. This direction follows a suggestion from #98407. - Adding an `as_pin` method that can only be used when the wrapped type implements `Sync`, to complete the square of access methods. - Making as many of the existing `impl`s `const` as possible; this involved making the existing `impl Default` no longer derived. - Adding `impl`s for `AsyncFnOnce`, `AsyncFnMut`, and `AsyncFn`, akin to the existing `impls` for `FnOnce`, `FnMut`, and `Fn`. It does not yet do the following, which may be desirable: - Fixing/improving the documentation to address the concern pointed out in #146245. It previously did the following, but this was removed after discussion: - Adding an `impl` for (`const`) `Iterator`, which felt in line with the existing `impl`s for `Future` and `Coroutine`.
2 parents 1fe72d3 + 57d4965 commit 9ebe418

File tree

8 files changed

+427
-335
lines changed

8 files changed

+427
-335
lines changed

library/core/src/sync/exclusive.rs

Lines changed: 0 additions & 322 deletions
This file was deleted.

library/core/src/sync/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
#![stable(feature = "rust1", since = "1.0.0")]
44

55
pub mod atomic;
6-
mod exclusive;
6+
mod sync_view;
77
#[unstable(feature = "exclusive_wrapper", issue = "98407")]
8-
pub use exclusive::Exclusive;
8+
pub use sync_view::SyncView;

0 commit comments

Comments
 (0)