]> git.lizzy.rs Git - rust.git/commitdiff
Review feedback: add unstable marker to Placer API and put in bound that now works.
authorFelix S. Klock II <pnkfelix@pnkfx.org>
Thu, 23 Jul 2015 14:01:46 +0000 (16:01 +0200)
committerFelix S. Klock II <pnkfelix@pnkfx.org>
Thu, 23 Jul 2015 14:02:26 +0000 (16:02 +0200)
src/liballoc/lib.rs
src/libcore/ops.rs

index 480c1a502c6fbd9aaa6f6a9c50497cdfdf13775b..f66495c4057c4c283350eaef90296ac81bf0ca51 100644 (file)
@@ -70,6 +70,8 @@
        test(no_crate_inject))]
 #![no_std]
 
+// SNAP d4432b3
+#![allow(unused_features)] // until feature(placement_in_syntax) is in snap
 #![feature(allocator)]
 #![feature(box_syntax)]
 #![feature(coerce_unsized)]
@@ -83,6 +85,7 @@
 #![feature(nonzero)]
 #![feature(optin_builtin_traits)]
 #![feature(placement_in_syntax)]
+#![feature(placement_new_protocol)]
 #![feature(raw)]
 #![feature(staged_api)]
 #![feature(unboxed_closures)]
index 18e4e282f2223a05b42ed883a446a8cd1e6f76d0..2ea42011a5cf2ff6a2206c52ad780a689bc25394 100644 (file)
@@ -1285,6 +1285,7 @@ impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<*const U> for *const T {}
 /// If evaluating EXPR fails, then the destructor for the
 /// implementation of Place to clean up any intermediate state
 /// (e.g. deallocate box storage, pop a stack, etc).
+#[unstable(feature = "placement_new_protocol")]
 pub trait Place<Data: ?Sized> {
     /// Returns the address where the input value will be written.
     /// Note that the data at this address is generally uninitialized,
@@ -1315,6 +1316,7 @@ pub trait Place<Data: ?Sized> {
 /// Values for types implementing this trait usually are transient
 /// intermediate values (e.g. the return value of `Vec::emplace_back`)
 /// or `Copy`, since the `make_place` method takes `self` by value.
+#[unstable(feature = "placement_new_protocol")]
 pub trait Placer<Data: ?Sized> {
     /// `Place` is the intermedate agent guarding the
     /// uninitialized state for `Data`.
@@ -1325,6 +1327,7 @@ pub trait Placer<Data: ?Sized> {
 }
 
 /// Specialization of `Place` trait supporting `in (PLACE) EXPR`.
+#[unstable(feature = "placement_new_protocol")]
 pub trait InPlace<Data: ?Sized>: Place<Data> {
     /// `Owner` is the type of the end value of `in (PLACE) EXPR`
     ///
@@ -1361,11 +1364,12 @@ pub trait InPlace<Data: ?Sized>: Place<Data> {
 /// `<T as Boxed>` in turn dictates determines which
 /// implementation of `BoxPlace` to use, namely:
 /// `<<T as Boxed>::Place as BoxPlace>`.
+#[unstable(feature = "placement_new_protocol")]
 pub trait Boxed {
     /// The kind of data that is stored in this kind of box.
     type Data;  /* (`Data` unused b/c cannot yet express below bound.) */
     /// The place that will negotiate the storage of the data.
-    type Place; /* should be bounded by BoxPlace<Self::Data> */
+    type Place: BoxPlace<Self::Data>;
 
     /// Converts filled place into final owning value, shifting
     /// deallocation/cleanup responsibilities (if any remain), over to
@@ -1374,6 +1378,7 @@ pub trait Boxed {
 }
 
 /// Specialization of `Place` trait supporting `box EXPR`.
+#[unstable(feature = "placement_new_protocol")]
 pub trait BoxPlace<Data: ?Sized> : Place<Data> {
     /// Creates a globally fresh place.
     fn make_place() -> Self;