about summary refs log tree commit diff
path: root/src/liballoc/lib.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-01-28 03:59:14 +0000
committerbors <bors@rust-lang.org>2015-01-28 03:59:14 +0000
commita530cc9706324ad44dba464d541a807eb5afdb08 (patch)
treea8f9e5444cf2378b9c3d5a193484a3f6c9873a06 /src/liballoc/lib.rs
parent92ff8ea52816982ad4cbfac8168e216d32d74c77 (diff)
parent71223050538939ed758fcd3b9114f71abff20bb2 (diff)
downloadrust-a530cc9706324ad44dba464d541a807eb5afdb08.tar.gz
rust-a530cc9706324ad44dba464d541a807eb5afdb08.zip
Auto merge of #21248 - brson:feature-staging, r=alexcrichton
This implements the remaining bits of 'feature staging', as described in [RFC 507](https://github.com/rust-lang/rfcs/blob/master/text/0507-release-channels.md).

This is not quite done, but the substance of the work is complete so submitting for early review.

Key changes:
* `unstable`, `stable` and `deprecated` attributes all require 'feature' and 'since', and support an optional 'reason'.
* The `unstable` lint is removed.
* A new 'stability checking' pass warns when a used unstable library feature has not been activated with the `feature` attribute. At 1.0 beta this will become an error.
* A new 'unused feature checking' pass emits a lint ('unused_feature', renamed from 'unknown_feature') for any features that were activated but not used.
* A new tidy script `featureck.py` performs some global sanity checking, particularly that 'since' numbers agree, and also prints out a summary of features.

Differences from RFC:
* As implemented `unstable` requires a `since` attribute. I do not know if this is useful. I included it in the original sed script and just left it.
* RFC didn't specify the name of the optional 'reason' attribute.
* This continues to use 'unstable', 'stable' and 'deprecated' names (the 'nice' names) instead of 'staged_unstable', but only activates them with the crate-level 'staged_api' attribute.

I intend to update the RFC based on the outcome of this PR.

Issues:
* The unused feature check doesn't account for language features - i.e. you can activate a language feature, not use it, and not get the error.

Open questions:
* All unstable and deprecated features are named 'unnamed_feature', which i picked just because it is uniquely greppable. This is the 'catch-all' feature. What should it be?
* All stable features are named 'grandfathered'. What should this be?

TODO:
* Add check that all `deprecated` attributes are paired with a `stable` attribute in order to preserve the knowledge about when a feature became stable.
* Update rustdoc in various ways.
* Remove obsolete stability discussion from reference.
* Add features for 'path', 'io', 'os', 'hash' and 'rand'.

cc #20445 @alexcrichton @aturon 
Diffstat (limited to 'src/liballoc/lib.rs')
-rw-r--r--src/liballoc/lib.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/liballoc/lib.rs b/src/liballoc/lib.rs
index 231ef6e7e74..6830a1c33df 100644
--- a/src/liballoc/lib.rs
+++ b/src/liballoc/lib.rs
@@ -57,7 +57,8 @@
 //! default global allocator. It is not compatible with the libc allocator API.
 
 #![crate_name = "alloc"]
-#![unstable]
+#![unstable(feature = "alloc")]
+#![feature(staged_api)]
 #![staged_api]
 #![crate_type = "rlib"]
 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
@@ -66,13 +67,15 @@
 
 #![no_std]
 #![allow(unknown_features)]
-#![allow(unstable)]
 #![feature(lang_items, unsafe_destructor)]
 #![feature(box_syntax)]
 #![feature(optin_builtin_traits)]
 // FIXME(#21363) remove `old_impl_check` when bug is fixed
 #![feature(old_impl_check)]
 #![allow(unknown_features)] #![feature(int_uint)]
+#![feature(core)]
+#![feature(hash)]
+#![feature(libc)]
 
 #[macro_use]
 extern crate core;