@@ -1285,6 +1285,7 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
1285
1285
/// If evaluating EXPR fails, then the destructor for the
1286
1286
/// implementation of Place to clean up any intermediate state
1287
1287
/// (e.g. deallocate box storage, pop a stack, etc).
1288
+ #[ unstable( feature = "placement_new_protocol" ) ]
1288
1289
pub trait Place < Data : ?Sized > {
1289
1290
/// Returns the address where the input value will be written.
1290
1291
/// Note that the data at this address is generally uninitialized,
@@ -1315,6 +1316,7 @@ pub trait Place<Data: ?Sized> {
1315
1316
/// Values for types implementing this trait usually are transient
1316
1317
/// intermediate values (e.g. the return value of `Vec::emplace_back`)
1317
1318
/// or `Copy`, since the `make_place` method takes `self` by value.
1319
+ #[ unstable( feature = "placement_new_protocol" ) ]
1318
1320
pub trait Placer < Data : ?Sized > {
1319
1321
/// `Place` is the intermedate agent guarding the
1320
1322
/// uninitialized state for `Data`.
@@ -1325,6 +1327,7 @@ pub trait Placer<Data: ?Sized> {
1325
1327
}
1326
1328
1327
1329
/// Specialization of `Place` trait supporting `in (PLACE) EXPR`.
1330
+ #[ unstable( feature = "placement_new_protocol" ) ]
1328
1331
pub trait InPlace < Data : ?Sized > : Place < Data > {
1329
1332
/// `Owner` is the type of the end value of `in (PLACE) EXPR`
1330
1333
///
@@ -1361,11 +1364,12 @@ pub trait InPlace<Data: ?Sized>: Place<Data> {
1361
1364
/// `<T as Boxed>` in turn dictates determines which
1362
1365
/// implementation of `BoxPlace` to use, namely:
1363
1366
/// `<<T as Boxed>::Place as BoxPlace>`.
1367
+ #[ unstable( feature = "placement_new_protocol" ) ]
1364
1368
pub trait Boxed {
1365
1369
/// The kind of data that is stored in this kind of box.
1366
1370
type Data ; /* (`Data` unused b/c cannot yet express below bound.) */
1367
1371
/// The place that will negotiate the storage of the data.
1368
- type Place ; /* should be bounded by BoxPlace<Self::Data> */
1372
+ type Place : BoxPlace < Self :: Data > ;
1369
1373
1370
1374
/// Converts filled place into final owning value, shifting
1371
1375
/// deallocation/cleanup responsibilities (if any remain), over to
@@ -1374,6 +1378,7 @@ pub trait Boxed {
1374
1378
}
1375
1379
1376
1380
/// Specialization of `Place` trait supporting `box EXPR`.
1381
+ #[ unstable( feature = "placement_new_protocol" ) ]
1377
1382
pub trait BoxPlace < Data : ?Sized > : Place < Data > {
1378
1383
/// Creates a globally fresh place.
1379
1384
fn make_place ( ) -> Self ;
0 commit comments