Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c14d86f
core: Split apart the global `core` feature
alexcrichton Jun 9, 2015
c44f539
alloc: Split apart the global `alloc` feature
alexcrichton Jun 9, 2015
d444d0c
collections: Split the `collections` feature
alexcrichton Jun 9, 2015
6895311
std: Split the `std_misc` feature
alexcrichton Jun 10, 2015
ce1a965
Fallout in tests and docs from feature renamings
alexcrichton Jun 10, 2015
02a8d5b
std: Deprecate the RandomAccessIterator trait
alexcrichton Jun 11, 2015
669d1cd
std: Deprecate iter::{Unfold, Iterate}
alexcrichton Jun 11, 2015
153de4c
std: Deprecate the copy_{,mut_}lifetime functions
alexcrichton Jun 11, 2015
c72e01e
std: Deprecate result::fold
alexcrichton Jun 11, 2015
f55c366
std: Deprecate the IntSliceExt trait
alexcrichton Jun 11, 2015
a05ed99
std: Remove two internal `str_internals` functions
alexcrichton Jun 11, 2015
8797c9e
std: Deprecate f{32,64}::consts::PI_2
alexcrichton Jun 11, 2015
cdb69e2
std: Stabilize the remaining wrapping_* functions
alexcrichton Jun 11, 2015
f85c4f6
std: Deprecate all permutation-related slice methods
alexcrichton Jun 11, 2015
68b628b
std: Deprecate Vec::from_raw_buf
alexcrichton Jun 11, 2015
c032d6f
std: Stabilize the sync_poison feature
alexcrichton Jun 11, 2015
f358087
std: Stabilize the `once_new` feature
alexcrichton Jun 11, 2015
17a1059
std: Stabilize the `iter_{once,empty}` features
alexcrichton Jun 11, 2015
2d389c1
std: Stabilize the `str_matches` feature
alexcrichton Jun 11, 2015
0d818b4
std: Deprecate the io::BufStream type
alexcrichton Jun 11, 2015
96cce02
std: Deprecate the `exit_status` feature
alexcrichton Jun 11, 2015
04f7eba
std: Deprecate the `future` feature
alexcrichton Jun 11, 2015
d645f8f
std: Deprecate the `scoped` feature
alexcrichton Jun 11, 2015
3346fb0
std: Deprecate the `thunk` module
alexcrichton Jun 11, 2015
aa931e9
std: Move free-functions to associated functions
alexcrichton Jun 11, 2015
b4a2823
More test fixes and fallout of stability changes
alexcrichton Jun 11, 2015
252ef28
std: Update stable since for `core::char`
alexcrichton Jun 11, 2015
edf9335
std: Hide some internal functions more aggressively
alexcrichton Jun 11, 2015
c9b40a3
std: Stabilize vec_map::Entry::or_insert{,_with}
alexcrichton Jun 11, 2015
913c227
Add comment about stabilizing CString::from_ptr
alexcrichton Jun 11, 2015
ec33338
Fix libstd tests
alexcrichton Jun 12, 2015
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
alloc: Split apart the global alloc feature
  • Loading branch information
alexcrichton committed Jun 17, 2015
commit c44f5399e4dd2f9d55e107d365d6fe98f6491dc9
16 changes: 8 additions & 8 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {}
/// Weak pointers will not keep the data inside of the `Arc` alive, and can be
/// used to break cycles between `Arc` pointers.
#[unsafe_no_drop_flag]
#[unstable(feature = "alloc",
#[unstable(feature = "arc_weak",
reason = "Weak pointers may not belong in this module.")]
pub struct Weak<T: ?Sized> {
// FIXME #12808: strange name to try to avoid interfering with
Expand Down Expand Up @@ -198,7 +198,7 @@ impl<T: ?Sized> Arc<T> {
///
/// let weak_five = five.downgrade();
/// ```
#[unstable(feature = "alloc",
#[unstable(feature = "arc_weak",
reason = "Weak pointers may not belong in this module.")]
pub fn downgrade(&self) -> Weak<T> {
// See the clone() impl for why this is relaxed
Expand Down Expand Up @@ -236,12 +236,12 @@ impl<T: ?Sized> Arc<T> {

/// Get the number of weak references to this value.
#[inline]
#[unstable(feature = "alloc")]
#[unstable(feature = "arc_extras")]
pub fn weak_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().weak.load(SeqCst) - 1 }

/// Get the number of strong references to this value.
#[inline]
#[unstable(feature = "alloc")]
#[unstable(feature = "arc_extras")]
pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.load(SeqCst) }


Expand Down Expand Up @@ -271,7 +271,7 @@ pub fn strong_count<T: ?Sized>(this: &Arc<T>) -> usize { this.inner().strong.loa
/// # }
/// ```
#[inline]
#[unstable(feature = "alloc")]
#[unstable(feature = "arc_extras")]
pub unsafe fn get_mut<T: ?Sized>(this: &mut Arc<T>) -> Option<&mut T> {
// FIXME(#24880) potential race with upgraded weak pointers here
if strong_count(this) == 1 && weak_count(this) == 0 {
Expand Down Expand Up @@ -352,7 +352,7 @@ impl<T: Clone> Arc<T> {
/// # }
/// ```
#[inline]
#[unstable(feature = "alloc")]
#[unstable(feature = "arc_extras")]
pub unsafe fn make_unique(&mut self) -> &mut T {
// FIXME(#24880) potential race with upgraded weak pointers here
//
Expand Down Expand Up @@ -438,7 +438,7 @@ impl<T: ?Sized> Drop for Arc<T> {
}
}

#[unstable(feature = "alloc",
#[unstable(feature = "arc_weak",
reason = "Weak pointers may not belong in this module.")]
impl<T: ?Sized> Weak<T> {
/// Upgrades a weak reference to a strong reference.
Expand Down Expand Up @@ -479,7 +479,7 @@ impl<T: ?Sized> Weak<T> {
}
}

#[unstable(feature = "alloc",
#[unstable(feature = "arc_weak",
reason = "Weak pointers may not belong in this module.")]
impl<T: ?Sized> Clone for Weak<T> {
/// Makes a clone of the `Weak<T>`.
Expand Down
6 changes: 3 additions & 3 deletions src/liballoc/boxed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ use core::raw::{TraitObject};
/// }
/// ```
#[lang = "exchange_heap"]
#[unstable(feature = "alloc",
#[unstable(feature = "box_heap",
reason = "may be renamed; uncertain about custom allocator design")]
pub const HEAP: () = ();

Expand Down Expand Up @@ -121,7 +121,7 @@ impl<T : ?Sized> Box<T> {
/// Function is unsafe, because improper use of this function may
/// lead to memory problems like double-free, for example if the
/// function is called twice on the same raw pointer.
#[unstable(feature = "alloc",
#[unstable(feature = "box_raw",
reason = "may be renamed or moved out of Box scope")]
#[inline]
pub unsafe fn from_raw(raw: *mut T) -> Self {
Expand All @@ -146,7 +146,7 @@ impl<T : ?Sized> Box<T> {
/// let raw = boxed::into_raw(seventeen);
/// let boxed_again = unsafe { Box::from_raw(raw) };
/// ```
#[unstable(feature = "alloc",
#[unstable(feature = "box_raw",
reason = "may be renamed")]
#[inline]
pub fn into_raw<T : ?Sized>(b: Box<T>) -> *mut T {
Expand Down
7 changes: 6 additions & 1 deletion src/liballoc/heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![unstable(feature = "heap_api",
reason = "the precise API and guarantees it provides may be tweaked \
slightly, especially to possibly take into account the \
types being stored to make room for a future \
tracing garbage collector")]

use core::{isize, usize};

#[inline(always)]
Expand Down Expand Up @@ -94,7 +100,6 @@ pub fn usable_size(size: usize, align: usize) -> usize {
///
/// These statistics may be inconsistent if other threads use the allocator
/// during the call.
#[unstable(feature = "alloc")]
pub fn stats_print() {
imp::stats_print();
}
Expand Down
10 changes: 7 additions & 3 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,11 @@
// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
#![cfg_attr(stage0, feature(custom_attribute))]
#![crate_name = "alloc"]
#![unstable(feature = "alloc")]
#![staged_api]
#![crate_type = "rlib"]
#![staged_api]
#![unstable(feature = "alloc",
reason = "this library is unlikely to be stabilized in its current \
form or name")]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/",
Expand All @@ -86,11 +88,11 @@
#![feature(unique)]
#![feature(unsafe_no_drop_flag, filling_drop)]
#![feature(unsize)]

#![cfg_attr(test, feature(test, alloc, rustc_private))]
#![cfg_attr(all(not(feature = "external_funcs"), not(feature = "external_crate")),
feature(libc))]


#[macro_use]
extern crate core;

Expand Down Expand Up @@ -124,6 +126,7 @@ pub mod rc;
/// Common out-of-memory routine
#[cold]
#[inline(never)]
#[unstable(feature = "oom", reason = "not a scrutinized interface")]
pub fn oom() -> ! {
// FIXME(#14674): This really needs to do something other than just abort
// here, but any printing done must be *guaranteed* to not
Expand All @@ -144,4 +147,5 @@ pub fn oom() -> ! {
// to get linked in to libstd successfully (the linker won't
// optimize it out).
#[doc(hidden)]
#[unstable(feature = "issue_14344_fixme")]
pub fn fixme_14344_be_sure_to_link_to_collections() {}
20 changes: 10 additions & 10 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ impl<T: ?Sized> Rc<T> {
///
/// let weak_five = five.downgrade();
/// ```
#[unstable(feature = "alloc",
#[unstable(feature = "rc_weak",
reason = "Weak pointers may not belong in this module")]
pub fn downgrade(&self) -> Weak<T> {
self.inc_weak();
Expand All @@ -246,12 +246,12 @@ impl<T: ?Sized> Rc<T> {

/// Get the number of weak references to this value.
#[inline]
#[unstable(feature = "alloc")]
#[unstable(feature = "rc_extras")]
pub fn weak_count<T: ?Sized>(this: &Rc<T>) -> usize { this.weak() - 1 }

/// Get the number of strong references to this value.
#[inline]
#[unstable(feature = "alloc")]
#[unstable(feature = "rc_extras")]
pub fn strong_count<T: ?Sized>(this: &Rc<T>) -> usize { this.strong() }

/// Returns true if there are no other `Rc` or `Weak<T>` values that share the
Expand All @@ -269,7 +269,7 @@ pub fn strong_count<T: ?Sized>(this: &Rc<T>) -> usize { this.strong() }
/// rc::is_unique(&five);
/// ```
#[inline]
#[unstable(feature = "alloc")]
#[unstable(feature = "rc_extras")]
pub fn is_unique<T>(rc: &Rc<T>) -> bool {
weak_count(rc) == 0 && strong_count(rc) == 1
}
Expand All @@ -292,7 +292,7 @@ pub fn is_unique<T>(rc: &Rc<T>) -> bool {
/// assert_eq!(rc::try_unwrap(x), Err(Rc::new(4)));
/// ```
#[inline]
#[unstable(feature = "alloc")]
#[unstable(feature = "rc_extras")]
pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
if is_unique(&rc) {
unsafe {
Expand Down Expand Up @@ -327,7 +327,7 @@ pub fn try_unwrap<T>(rc: Rc<T>) -> Result<T, Rc<T>> {
/// assert!(rc::get_mut(&mut x).is_none());
/// ```
#[inline]
#[unstable(feature = "alloc")]
#[unstable(feature = "rc_extras")]
pub fn get_mut<T>(rc: &mut Rc<T>) -> Option<&mut T> {
if is_unique(rc) {
let inner = unsafe { &mut **rc._ptr };
Expand All @@ -354,7 +354,7 @@ impl<T: Clone> Rc<T> {
/// let mut_five = five.make_unique();
/// ```
#[inline]
#[unstable(feature = "alloc")]
#[unstable(feature = "rc_extras")]
pub fn make_unique(&mut self) -> &mut T {
if !is_unique(self) {
*self = Rc::new((**self).clone())
Expand Down Expand Up @@ -652,7 +652,7 @@ impl<T> fmt::Pointer for Rc<T> {
///
/// See the [module level documentation](./index.html) for more.
#[unsafe_no_drop_flag]
#[unstable(feature = "alloc",
#[unstable(feature = "rc_weak",
reason = "Weak pointers may not belong in this module.")]
pub struct Weak<T: ?Sized> {
// FIXME #12808: strange names to try to avoid interfering with
Expand All @@ -663,7 +663,7 @@ pub struct Weak<T: ?Sized> {
impl<T: ?Sized> !marker::Send for Weak<T> {}
impl<T: ?Sized> !marker::Sync for Weak<T> {}

#[unstable(feature = "alloc",
#[unstable(feature = "rc_weak",
reason = "Weak pointers may not belong in this module.")]
impl<T: ?Sized> Weak<T> {

Expand Down Expand Up @@ -741,7 +741,7 @@ impl<T: ?Sized> Drop for Weak<T> {
}
}

#[unstable(feature = "alloc",
#[unstable(feature = "rc_weak",
reason = "Weak pointers may not belong in this module.")]
impl<T: ?Sized> Clone for Weak<T> {

Expand Down
3 changes: 2 additions & 1 deletion src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
#![feature(alloc)]
#![feature(box_syntax)]
#![feature(core_intrinsics)]
#![feature(heap_api)]
#![feature(oom)]
#![feature(ptr_as_ref)]
#![feature(raw)]
#![feature(staged_api)]
#![feature(unboxed_closures)]
#![cfg_attr(test, feature(test))]

extern crate alloc;
Expand Down
3 changes: 3 additions & 0 deletions src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,23 @@

#![feature(alloc)]
#![feature(box_patterns)]
#![feature(box_raw)]
#![feature(box_syntax)]
#![feature(copy_lifetime)]
#![feature(core)]
#![feature(core_intrinsics)]
#![feature(core_prelude)]
#![feature(core_slice_ext)]
#![feature(core_str_ext)]
#![feature(heap_api)]
#![feature(iter_cmp)]
#![feature(iter_idx)]
#![feature(iter_order)]
#![feature(iter_product)]
#![feature(iter_sum)]
#![feature(lang_items)]
#![feature(num_bits_bytes)]
#![feature(oom)]
#![feature(pattern)]
#![feature(ptr_as_ref)]
#![feature(raw)]
Expand Down
5 changes: 3 additions & 2 deletions src/liblog/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,11 @@
html_playground_url = "http://play.rust-lang.org/")]
#![deny(missing_docs)]

#![feature(alloc)]
#![feature(staged_api)]
#![feature(box_raw)]
#![feature(box_syntax)]
#![feature(const_fn)]
#![feature(iter_cmp)]
#![feature(staged_api)]
#![feature(std_misc)]

use std::boxed;
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/")]

#![feature(alloc)]
#![feature(associated_consts)]
#![feature(collections)]
#![feature(rc_weak)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(staged_api)]
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/nightly/")]

#![feature(alloc)]
#![feature(box_patterns)]
#![feature(box_syntax)]
#![feature(collections)]
Expand All @@ -40,6 +39,7 @@
#![feature(path_relative_from)]
#![feature(path_relative_from)]
#![feature(quote)]
#![feature(rc_weak)]
#![feature(rustc_diagnostic_macros)]
#![feature(rustc_private)]
#![feature(staged_api)]
Expand Down
3 changes: 3 additions & 0 deletions src/libstd/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@
#![feature(allow_internal_unstable)]
#![feature(associated_consts)]
#![feature(borrow_state)]
#![feature(box_raw)]
#![feature(box_syntax)]
#![feature(char_internals)]
#![feature(collections)]
Expand All @@ -117,6 +118,7 @@
#![feature(core_prelude)]
#![feature(core_simd)]
#![feature(fnbox)]
#![feature(heap_api)]
#![feature(int_error_internals)]
#![feature(into_cow)]
#![feature(iter_order)]
Expand All @@ -126,6 +128,7 @@
#![feature(macro_reexport)]
#![feature(no_std)]
#![feature(num_bits_bytes)]
#![feature(oom)]
#![feature(optin_builtin_traits)]
#![feature(rand)]
#![feature(raw)]
Expand Down
11 changes: 6 additions & 5 deletions src/libtest/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@
#![feature(asm)]
#![feature(box_syntax)]
#![feature(collections)]
#![feature(core)]
#![feature(duration)]
#![feature(duration_span)]
#![feature(fnbox)]
#![feature(iter_cmp)]
#![feature(libc)]
#![feature(rustc_private)]
#![feature(set_stdio)]
#![feature(staged_api)]
#![feature(std_misc)]
#![feature(libc)]
#![feature(set_stdio)]
#![feature(duration)]
#![feature(duration_span)]

extern crate getopts;
extern crate serialize;
Expand Down