diff options
| author | Aapo Alasuutari <aapo.alasuutari@gmail.com> | 2025-09-27 01:11:01 +0300 |
|---|---|---|
| committer | Aapo Alasuutari <aapo.alasuutari@gmail.com> | 2025-09-27 01:11:01 +0300 |
| commit | e88fa086fb597041a207a9bb5df0654628d57b1a (patch) | |
| tree | 395b4a1ff7972de1057895cffd95c82505db2b43 /library/core/src | |
| parent | c4a87eb62cd74e31e5d3889741a76a4bb2a48ed6 (diff) | |
| download | rust-e88fa086fb597041a207a9bb5df0654628d57b1a.tar.gz rust-e88fa086fb597041a207a9bb5df0654628d57b1a.zip | |
move Reborrow to ops, fix fmt issues
Diffstat (limited to 'library/core/src')
| -rw-r--r-- | library/core/src/marker.rs | 8 | ||||
| -rw-r--r-- | library/core/src/ops/mod.rs | 2 | ||||
| -rw-r--r-- | library/core/src/ops/reborrow.rs | 8 |
3 files changed, 8 insertions, 10 deletions
diff --git a/library/core/src/marker.rs b/library/core/src/marker.rs index d03d7a43469..fc715207d5d 100644 --- a/library/core/src/marker.rs +++ b/library/core/src/marker.rs @@ -1364,11 +1364,3 @@ pub macro CoercePointee($item:item) { pub trait CoercePointeeValidated { /* compiler built-in */ } - -/// Allows value to be reborrowed as exclusive, creating a copy of the value -/// that disables the source for reads and writes for the lifetime of the copy. -#[lang = "reborrow"] -#[unstable(feature = "reborrow", issue = "145612")] -pub trait Reborrow { - // Empty. -} diff --git a/library/core/src/ops/mod.rs b/library/core/src/ops/mod.rs index 9814f5d5795..ab1ad407ee2 100644 --- a/library/core/src/ops/mod.rs +++ b/library/core/src/ops/mod.rs @@ -191,7 +191,7 @@ 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; +pub use self::reborrow::{CoerceShared, Reborrow}; #[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 index 90288f766d5..f83f4233a4d 100644 --- a/library/core/src/ops/reborrow.rs +++ b/library/core/src/ops/reborrow.rs @@ -1,4 +1,10 @@ -use crate::marker::Reborrow; +/// Allows value to be reborrowed as exclusive, creating a copy of the value +/// that disables the source for reads and writes for the lifetime of the copy. +#[lang = "reborrow"] +#[unstable(feature = "reborrow", issue = "145612")] +pub trait Reborrow { + // Empty. +} /// Allows reborrowable value to be reborrowed as shared, creating a copy /// that disables the source for writes for the lifetime of the copy. |
