diff options
| author | Aapo Alasuutari <aapo.alasuutari@gmail.com> | 2025-09-15 20:32:06 +0300 |
|---|---|---|
| committer | Aapo Alasuutari <aapo.alasuutari@gmail.com> | 2025-09-15 20:50:00 +0300 |
| commit | c4a87eb62cd74e31e5d3889741a76a4bb2a48ed6 (patch) | |
| tree | 4ecff737192aec670c2ccb0f522ca66ca2d74c4c /library/core/src | |
| parent | 35bae9df1dfb164de7be95180a0982312128d559 (diff) | |
| download | rust-c4a87eb62cd74e31e5d3889741a76a4bb2a48ed6.tar.gz rust-c4a87eb62cd74e31e5d3889741a76a4bb2a48ed6.zip | |
fix: Move CoerceShared into ops
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/marker.rs | 9 | ||||
| -rw-r--r-- | library/core/src/ops/mod.rs | 3 | ||||
| -rw-r--r-- | library/core/src/ops/reborrow.rs | 10 |
3 files changed, 13 insertions, 9 deletions
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index 8541a5b91cd..d03d7a43469 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -1372,12 +1372,3 @@ pub trait CoercePointeeValidated { pub trait Reborrow { // Empty. } - -/// Allows reborrowable value to be reborrowed as shared, creating a copy of -/// that disables the source for writes for the lifetime of the copy. -#[lang = "coerce_shared"] -#[unstable(feature = "reborrow", issue = "145612")] -pub trait CoerceShared: Reborrow { - /// The type of this value when reborrowed as shared. - type Target: Copy; -} diff --git a/library/core/src/ops/mod.rs b/library/core/src/ops/mod.rs index 87dd873fdb5..9814f5d5795 100644 --- a/library/core/src/ops/mod.rs +++ b/library/core/src/ops/mod.rs @@ -149,6 +149,7 @@ mod function; mod index; mod index_range; mod range; +mod reborrow; mod try_trait; mod unsize; @@ -189,6 +190,8 @@ pub use self::range::{Bound, RangeBounds, RangeInclusive, RangeToInclusive}; pub use self::range::{OneSidedRange, OneSidedRangeBound}; #[stable(feature = "rust1", since = "1.0.0")] pub use self::range::{Range, RangeFrom, RangeFull, RangeTo}; +#[unstable(feature = "reborrow", issue = "145612")] +pub use self::reborrow::CoerceShared; #[unstable(feature = "try_trait_v2_residual", issue = "91285")] pub use self::try_trait::Residual; #[unstable(feature = "try_trait_v2_yeet", issue = "96374")] diff --git a/library/core/src/ops/reborrow.rs b/library/core/src/ops/reborrow.rs new file mode 100644 index 00000000000..90288f766d5 --- /dev/null +++ b/library/core/src/ops/reborrow.rs @@ -0,0 +1,10 @@ +use crate::marker::Reborrow; + +/// Allows reborrowable value to be reborrowed as shared, creating a copy +/// that disables the source for writes for the lifetime of the copy. +#[lang = "coerce_shared"] +#[unstable(feature = "reborrow", issue = "145612")] +pub trait CoerceShared: Reborrow { + /// The type of this value when reborrowed as shared. + type Target: Copy; +} |
