Skip to content

Commit d3f8fb9

Browse files
committed
fix: Move CoerceShared into ops
1 parent c507654 commit d3f8fb9

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

core/src/marker.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1372,12 +1372,3 @@ pub trait CoercePointeeValidated {
13721372
pub trait Reborrow {
13731373
// Empty.
13741374
}
1375-
1376-
/// Allows reborrowable value to be reborrowed as shared, creating a copy of
1377-
/// that disables the source for writes for the lifetime of the copy.
1378-
#[lang = "coerce_shared"]
1379-
#[unstable(feature = "reborrow", issue = "145612")]
1380-
pub trait CoerceShared: Reborrow {
1381-
/// The type of this value when reborrowed as shared.
1382-
type Target: Copy;
1383-
}

core/src/ops/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ mod function;
149149
mod index;
150150
mod index_range;
151151
mod range;
152+
mod reborrow;
152153
mod try_trait;
153154
mod unsize;
154155

@@ -189,6 +190,8 @@ pub use self::range::{Bound, RangeBounds, RangeInclusive, RangeToInclusive};
189190
pub use self::range::{OneSidedRange, OneSidedRangeBound};
190191
#[stable(feature = "rust1", since = "1.0.0")]
191192
pub use self::range::{Range, RangeFrom, RangeFull, RangeTo};
193+
#[unstable(feature = "reborrow", issue = "145612")]
194+
pub use self::reborrow::CoerceShared;
192195
#[unstable(feature = "try_trait_v2_residual", issue = "91285")]
193196
pub use self::try_trait::Residual;
194197
#[unstable(feature = "try_trait_v2_yeet", issue = "96374")]

core/src/ops/reborrow.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use crate::marker::Reborrow;
2+
3+
/// Allows reborrowable value to be reborrowed as shared, creating a copy
4+
/// that disables the source for writes for the lifetime of the copy.
5+
#[lang = "coerce_shared"]
6+
#[unstable(feature = "reborrow", issue = "145612")]
7+
pub trait CoerceShared: Reborrow {
8+
/// The type of this value when reborrowed as shared.
9+
type Target: Copy;
10+
}

0 commit comments

Comments
 (0)