Skip to content

Commit

Permalink
Auto merge of #27818 - alexcrichton:tag-all-the-issues, r=aturon
Browse files Browse the repository at this point in the history
This commit turns `#[unstable]` attributes missing an `issue` annotation into a hard error. This will require the libs team to ensure that there's a tracking issue for all unstable features in the standard library.

All existing unstable features have had issues created and they've all been updated. Yay!

Closes #26868
  • Loading branch information
bors committed Aug 16, 2015
2 parents fc7efab + 8ef1e3b commit 9165a4e
Show file tree
Hide file tree
Showing 131 changed files with 752 additions and 539 deletions.
20 changes: 12 additions & 8 deletions src/liballoc/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ impl<T: ?Sized + Unsize<U>, U: ?Sized> CoerceUnsized<Arc<U>> for Arc<T> {}
/// used to break cycles between `Arc` pointers.
#[unsafe_no_drop_flag]
#[unstable(feature = "arc_weak",
reason = "Weak pointers may not belong in this module.")]
reason = "Weak pointers may not belong in this module.",
issue = "27718")]
pub struct Weak<T: ?Sized> {
// FIXME #12808: strange name to try to avoid interfering with
// field accesses of the contained type via Deref
Expand Down Expand Up @@ -209,7 +210,8 @@ impl<T: ?Sized> Arc<T> {
/// let weak_five = five.downgrade();
/// ```
#[unstable(feature = "arc_weak",
reason = "Weak pointers may not belong in this module.")]
reason = "Weak pointers may not belong in this module.",
issue = "27718")]
pub fn downgrade(&self) -> Weak<T> {
loop {
// This Relaxed is OK because we're checking the value in the CAS
Expand All @@ -234,14 +236,14 @@ impl<T: ?Sized> Arc<T> {

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

/// Get the number of strong references to this value.
#[inline]
#[unstable(feature = "arc_counts")]
#[unstable(feature = "arc_counts", issue = "27718")]
pub fn strong_count(this: &Arc<T>) -> usize {
this.inner().strong.load(SeqCst)
}
Expand Down Expand Up @@ -349,7 +351,7 @@ impl<T: Clone> Arc<T> {
/// let mut_five = Arc::make_unique(&mut five);
/// ```
#[inline]
#[unstable(feature = "arc_unique")]
#[unstable(feature = "arc_unique", issue = "27718")]
pub fn make_unique(this: &mut Arc<T>) -> &mut T {
// Note that we hold both a strong reference and a weak reference.
// Thus, releasing our strong reference only will not, by itself, cause
Expand Down Expand Up @@ -427,7 +429,7 @@ impl<T: ?Sized> Arc<T> {
/// # }
/// ```
#[inline]
#[unstable(feature = "arc_unique")]
#[unstable(feature = "arc_unique", issue = "27718")]
pub fn get_mut(this: &mut Arc<T>) -> Option<&mut T> {
if this.is_unique() {
// This unsafety is ok because we're guaranteed that the pointer
Expand Down Expand Up @@ -541,7 +543,8 @@ impl<T: ?Sized> Drop for Arc<T> {
}

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

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

/// This the singleton type used solely for `boxed::HEAP`.
#[unstable(feature = "box_heap",
reason = "may be renamed; uncertain about custom allocator design")]
reason = "may be renamed; uncertain about custom allocator design",
issue = "27779")]
#[derive(Copy, Clone)]
pub struct ExchangeHeapSingleton { _force_singleton: () }

Expand Down Expand Up @@ -121,7 +123,9 @@ pub struct Box<T: ?Sized>(Unique<T>);
/// the fact that the `align_of` intrinsic currently requires the
/// input type to be Sized (which I do not think is strictly
/// necessary).
#[unstable(feature = "placement_in", reason = "placement box design is still being worked out.")]
#[unstable(feature = "placement_in",
reason = "placement box design is still being worked out.",
issue = "27779")]
pub struct IntermediateBox<T: ?Sized>{
ptr: *mut u8,
size: usize,
Expand Down Expand Up @@ -222,7 +226,8 @@ impl<T : ?Sized> Box<T> {
/// lead to memory problems like double-free, for example if the
/// function is called twice on the same raw pointer.
#[unstable(feature = "box_raw",
reason = "may be renamed or moved out of Box scope")]
reason = "may be renamed or moved out of Box scope",
issue = "27768")]
#[inline]
// NB: may want to be called from_ptr, see comments on CStr::from_ptr
pub unsafe fn from_raw(raw: *mut T) -> Self {
Expand All @@ -245,7 +250,8 @@ impl<T : ?Sized> Box<T> {
/// let raw = Box::into_raw(seventeen);
/// let boxed_again = unsafe { Box::from_raw(raw) };
/// ```
#[unstable(feature = "box_raw", reason = "may be renamed")]
#[unstable(feature = "box_raw", reason = "may be renamed",
issue = "27768")]
#[inline]
// NB: may want to be called into_ptr, see comments on CStr::from_ptr
pub fn into_raw(b: Box<T>) -> *mut T {
Expand Down Expand Up @@ -470,7 +476,7 @@ impl<I: ExactSizeIterator + ?Sized> ExactSizeIterator for Box<I> {}
/// }
/// ```
#[rustc_paren_sugar]
#[unstable(feature = "fnbox", reason = "Newly introduced")]
#[unstable(feature = "fnbox", reason = "Newly introduced", issue = "0")]
pub trait FnBox<A> {
type Output;

Expand Down
3 changes: 2 additions & 1 deletion src/liballoc/heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
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")]
tracing garbage collector",
issue = "27700")]

use core::{isize, usize};

Expand Down
6 changes: 4 additions & 2 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
#![allow(unused_attributes)]
#![unstable(feature = "alloc",
reason = "this library is unlikely to be stabilized in its current \
form or name")]
form or name",
issue = "27783")]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/",
Expand Down Expand Up @@ -131,7 +132,8 @@ pub mod raw_vec;
/// Common out-of-memory routine
#[cold]
#[inline(never)]
#[unstable(feature = "oom", reason = "not a scrutinized interface")]
#[unstable(feature = "oom", reason = "not a scrutinized interface",
issue = "27700")]
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 Down
24 changes: 14 additions & 10 deletions src/liballoc/rc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ impl<T> Rc<T> {
/// assert_eq!(Rc::try_unwrap(x), Err(Rc::new(4)));
/// ```
#[inline]
#[unstable(feature = "rc_unique")]
#[unstable(feature = "rc_unique", issue = "27718")]
pub fn try_unwrap(rc: Rc<T>) -> Result<T, Rc<T>> {
if Rc::is_unique(&rc) {
unsafe {
Expand Down Expand Up @@ -271,20 +271,21 @@ impl<T: ?Sized> Rc<T> {
/// let weak_five = five.downgrade();
/// ```
#[unstable(feature = "rc_weak",
reason = "Weak pointers may not belong in this module")]
reason = "Weak pointers may not belong in this module",
issue = "27718")]
pub fn downgrade(&self) -> Weak<T> {
self.inc_weak();
Weak { _ptr: self._ptr }
}

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

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

/// Returns true if there are no other `Rc` or `Weak<T>` values that share
Expand All @@ -302,7 +303,7 @@ impl<T: ?Sized> Rc<T> {
/// assert!(Rc::is_unique(&five));
/// ```
#[inline]
#[unstable(feature = "rc_unique")]
#[unstable(feature = "rc_unique", issue = "27718")]
pub fn is_unique(rc: &Rc<T>) -> bool {
Rc::weak_count(rc) == 0 && Rc::strong_count(rc) == 1
}
Expand All @@ -327,7 +328,7 @@ impl<T: ?Sized> Rc<T> {
/// assert!(Rc::get_mut(&mut x).is_none());
/// ```
#[inline]
#[unstable(feature = "rc_unique")]
#[unstable(feature = "rc_unique", issue = "27718")]
pub fn get_mut(rc: &mut Rc<T>) -> Option<&mut T> {
if Rc::is_unique(rc) {
let inner = unsafe { &mut **rc._ptr };
Expand Down Expand Up @@ -356,7 +357,7 @@ impl<T: Clone> Rc<T> {
/// let mut_five = five.make_unique();
/// ```
#[inline]
#[unstable(feature = "rc_unique")]
#[unstable(feature = "rc_unique", issue = "27718")]
pub fn make_unique(&mut self) -> &mut T {
if !Rc::is_unique(self) {
*self = Rc::new((**self).clone())
Expand Down Expand Up @@ -653,7 +654,8 @@ impl<T> fmt::Pointer for Rc<T> {
/// See the [module level documentation](./index.html) for more.
#[unsafe_no_drop_flag]
#[unstable(feature = "rc_weak",
reason = "Weak pointers may not belong in this module.")]
reason = "Weak pointers may not belong in this module.",
issue = "27718")]
pub struct Weak<T: ?Sized> {
// FIXME #12808: strange names to try to avoid interfering with
// field accesses of the contained type via Deref
Expand All @@ -666,7 +668,8 @@ impl<T: ?Sized> !marker::Sync for Weak<T> {}
impl<T: ?Sized+Unsize<U>, U: ?Sized> CoerceUnsized<Weak<U>> for Weak<T> {}

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

/// Upgrades a weak reference to a strong reference.
Expand Down Expand Up @@ -746,7 +749,8 @@ impl<T: ?Sized> Drop for Weak<T> {
}

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

/// Makes a clone of the `Weak<T>`.
Expand Down
3 changes: 2 additions & 1 deletion src/liballoc_jemalloc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
#![cfg_attr(not(stage0), allocator)]
#![unstable(feature = "alloc_jemalloc",
reason = "this library is unlikely to be stabilized in its current \
form or name")]
form or name",
issue = "27783")]
#![feature(allocator)]
#![feature(libc)]
#![feature(no_std)]
Expand Down
3 changes: 2 additions & 1 deletion src/liballoc_system/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
#![cfg_attr(not(stage0), allocator)]
#![unstable(feature = "alloc_system",
reason = "this library is unlikely to be stabilized in its current \
form or name")]
form or name",
issue = "27783")]
#![feature(allocator)]
#![feature(libc)]
#![feature(no_std)]
Expand Down
2 changes: 1 addition & 1 deletion src/libarena/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
// Do not remove on snapshot creation. Needed for bootstrap. (Issue #22364)
#![cfg_attr(stage0, feature(custom_attribute))]
#![crate_name = "arena"]
#![unstable(feature = "rustc_private")]
#![unstable(feature = "rustc_private", issue = "27812")]
#![staged_api]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
Expand Down
5 changes: 3 additions & 2 deletions src/libcollections/binary_heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,8 @@ impl<T: Ord> BinaryHeap<T> {
#[inline]
#[unstable(feature = "drain",
reason = "matches collection reform specification, \
waiting for dust to settle")]
waiting for dust to settle",
issue = "27711")]
pub fn drain(&mut self) -> Drain<T> {
Drain { iter: self.data.drain(..) }
}
Expand Down Expand Up @@ -685,7 +686,7 @@ impl<T> DoubleEndedIterator for IntoIter<T> {
impl<T> ExactSizeIterator for IntoIter<T> {}

/// An iterator that drains a `BinaryHeap`.
#[unstable(feature = "drain", reason = "recent addition")]
#[unstable(feature = "drain", reason = "recent addition", issue = "27711")]
pub struct Drain<'a, T: 'a> {
iter: vec::Drain<'a, T>,
}
Expand Down
3 changes: 2 additions & 1 deletion src/libcollections/borrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ impl<'a, B: ?Sized> Hash for Cow<'a, B> where B: Hash + ToOwned
}

/// Trait for moving into a `Cow`.
#[unstable(feature = "into_cow", reason = "may be replaced by `convert::Into`")]
#[unstable(feature = "into_cow", reason = "may be replaced by `convert::Into`",
issue = "27735")]
pub trait IntoCow<'a, B: ?Sized> where B: ToOwned {
/// Moves `self` into `Cow`
fn into_cow(self) -> Cow<'a, B>;
Expand Down
9 changes: 7 additions & 2 deletions src/libcollections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// Makes a new empty BTreeMap with the given B.
///
/// B cannot be less than 2.
#[unstable(feature = "btree_b",
reason = "probably want this to be on the type, eventually",
issue = "27795")]
pub fn with_b(b: usize) -> BTreeMap<K, V> {
assert!(b > 1, "B must be greater than 1");
BTreeMap {
Expand Down Expand Up @@ -1504,7 +1507,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// assert_eq!(Some((&5, &"b")), map.range(Included(&4), Unbounded).next());
/// ```
#[unstable(feature = "btree_range",
reason = "matches collection reform specification, waiting for dust to settle")]
reason = "matches collection reform specification, waiting for dust to settle",
issue = "27787")]
pub fn range<Min: ?Sized + Ord = K, Max: ?Sized + Ord = K>(&self, min: Bound<&Min>,
max: Bound<&Max>)
-> Range<K, V> where
Expand Down Expand Up @@ -1537,7 +1541,8 @@ impl<K: Ord, V> BTreeMap<K, V> {
/// }
/// ```
#[unstable(feature = "btree_range",
reason = "matches collection reform specification, waiting for dust to settle")]
reason = "matches collection reform specification, waiting for dust to settle",
issue = "27787")]
pub fn range_mut<Min: ?Sized + Ord = K, Max: ?Sized + Ord = K>(&mut self, min: Bound<&Min>,
max: Bound<&Max>)
-> RangeMut<K, V> where
Expand Down
6 changes: 4 additions & 2 deletions src/libcollections/btree/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ impl<T: Ord> BTreeSet<T> {
///
/// B cannot be less than 2.
#[unstable(feature = "btree_b",
reason = "probably want this to be on the type, eventually")]
reason = "probably want this to be on the type, eventually",
issue = "27795")]
pub fn with_b(b: usize) -> BTreeSet<T> {
BTreeSet { map: BTreeMap::with_b(b) }
}
Expand Down Expand Up @@ -154,7 +155,8 @@ impl<T: Ord> BTreeSet<T> {
/// assert_eq!(Some(&5), set.range(Included(&4), Unbounded).next());
/// ```
#[unstable(feature = "btree_range",
reason = "matches collection reform specification, waiting for dust to settle")]
reason = "matches collection reform specification, waiting for dust to settle",
issue = "27787")]
pub fn range<'a, Min: ?Sized + Ord = T, Max: ?Sized + Ord = T>(&'a self, min: Bound<&Min>,
max: Bound<&Max>)
-> Range<'a, T> where
Expand Down
3 changes: 2 additions & 1 deletion src/libcollections/enum_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
#![unstable(feature = "enumset",
reason = "matches collection reform specification, \
waiting for dust to settle")]
waiting for dust to settle",
issue = "0")]

use core::marker;
use core::fmt;
Expand Down
5 changes: 3 additions & 2 deletions src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
#![crate_type = "rlib"]
#![unstable(feature = "collections",
reason = "library is unlikely to be stabilized with the current \
layout and name, use std::collections instead")]
layout and name, use std::collections instead",
issue = "27783")]
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/",
Expand Down Expand Up @@ -110,7 +111,7 @@ mod std {
}

/// An endpoint of a range of keys.
#[unstable(feature = "collections_bound")]
#[unstable(feature = "collections_bound", issue = "27711")]
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
pub enum Bound<T> {
/// An inclusive bound.
Expand Down
Loading

0 comments on commit 9165a4e

Please sign in to comment.