]> git.lizzy.rs Git - rust.git/commitdiff
Minor fixes
authorBrian Anderson <banderson@mozilla.com>
Fri, 16 Jan 2015 22:08:24 +0000 (14:08 -0800)
committerBrian Anderson <banderson@mozilla.com>
Thu, 22 Jan 2015 00:16:22 +0000 (16:16 -0800)
13 files changed:
mk/tests.mk
src/etc/featureck.py
src/liballoc/rc.rs
src/libcore/hash/mod.rs
src/libcoretest/cell.rs
src/librustc/middle/stability.rs
src/librustc_driver/driver.rs
src/test/auxiliary/lint_output_format.rs
src/test/compile-fail/lint-forbid-cmdline.rs
src/test/compile-fail/lint-output-format.rs
src/test/compile-fail/lint-stability.rs
src/test/compile-fail/lint-unknown-feature.rs
src/test/compile-fail/simd-experimental.rs [deleted file]

index 3389065212485f067313dfbcd0bfe822528216a4..bf0b58f70a9a9aed1d710b7ab6c7f01e7058bb5a 100644 (file)
@@ -300,7 +300,7 @@ tidy:
                | grep '^$(S)src/libbacktrace' -v \
                | grep '^$(S)src/rust-installer' -v \
                | xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py
-               $(CFG_PYTHON) $(S)src/etc/featureck.py $(S)src/
+               $(Q)$(CFG_PYTHON) $(S)src/etc/featureck.py $(S)src/
 
 
 endif
index 06ef2d7c60567bdc8e6361a6a09a8f8db8063f40..616596aa352362215e2bec7d50fa3f09951df5e7 100644 (file)
@@ -43,7 +43,7 @@ with open(feature_gate_source, 'r') as f:
             line = line.replace("(", "").replace("),", "").replace(")", "")
             parts = line.split(",")
             if len(parts) != 3:
-                print "unexpected number of components in line: " + original_line
+                print "error: unexpected number of components in line: " + original_line
                 sys.exit(1)
             feature_name = parts[0].strip().replace('"', "")
             since = parts[1].strip().replace('"', "")
@@ -102,14 +102,15 @@ for (dirpath, dirnames, filenames) in os.walk(src_dir):
                     lib_features[feature_name] = feature_name
                     if lib_features_and_level.get((feature_name, level)) is None:
                         # Add it to the observed features
-                        lib_features_and_level[(feature_name, level)] = (since, path, line_num, line)
+                        lib_features_and_level[(feature_name, level)] = \
+                            (since, path, line_num, line)
                     else:
                         # Verify that for this combination of feature_name and level the 'since'
                         # attribute matches.
                         (expected_since, source_path, source_line_num, source_line) = \
                             lib_features_and_level.get((feature_name, level))
                         if since != expected_since:
-                            print "mismatch in " + level + " feature '" + feature_name + "'"
+                            print "error: mismatch in " + level + " feature '" + feature_name + "'"
                             print "line " + str(source_line_num) + " of " + source_path + ":"
                             print source_line
                             print "line " + str(line_num) + " of " + path + ":"
@@ -118,13 +119,13 @@ for (dirpath, dirnames, filenames) in os.walk(src_dir):
 
                     # Verify that this lib feature doesn't duplicate a lang feature
                     if feature_name in language_feature_names:
-                        print "lib feature '" + feature_name + "' duplicates a lang feature"
+                        print "error: lib feature '" + feature_name + "' duplicates a lang feature"
                         print "line " + str(line_num) + " of " + path + ":"
                         print line
                         errors = True
 
                 else:
-                    print "misformed stability attribute"
+                    print "error: misformed stability attribute"
                     print "line " + str(line_num) + " of " + path + ":"
                     print line
                     errors = True
@@ -141,7 +142,7 @@ for f in language_features:
     status = "unstable"
     stable_since = None
     partially_deprecated = False
-    
+
     if f[2] == "Accepted":
         status = "stable"
     if status == "stable":
@@ -165,7 +166,7 @@ for f in lib_features:
     is_deprecated = lib_features_and_level.get((name, "deprecated")) is not None
 
     if is_stable and is_unstable:
-        print "feature '" + name + "' is both stable and unstable"
+        print "error: feature '" + name + "' is both stable and unstable"
         errors = True
 
     if is_stable:
@@ -189,7 +190,7 @@ merged_stats = { }
 for name in lib_feature_stats:
     if language_feature_stats.get(name) is not None:
         if not name in joint_features:
-            print "feature '" + name + "' is both a lang and lib feature but not whitelisted"
+            print "error: feature '" + name + "' is both a lang and lib feature but not whitelisted"
             errors = True
         lang_status = lang_feature_stats[name][3]
         lib_status = lib_feature_stats[name][3]
@@ -199,7 +200,7 @@ for name in lib_feature_stats:
         lib_partially_deprecated = lib_feature_stats[name][5]
 
         if lang_status != lib_status and lib_status != "deprecated":
-            print "feature '" + name + "' has lang status " + lang_status + \
+            print "error: feature '" + name + "' has lang status " + lang_status + \
                   " but lib status " + lib_status
             errors = True
 
@@ -208,7 +209,7 @@ for name in lib_feature_stats:
             partially_deprecated = True
 
         if lang_stable_since != lib_stable_since:
-            print "feature '" + name + "' has lang stable since " + lang_stable_since + \
+            print "error: feature '" + name + "' has lang stable since " + lang_stable_since + \
                   " but lib stable since " + lib_stable_since
             errors = True
 
index 5e82810673999088548a6ce56e9bca518ce973fc..07eebe600d56ae2f47ddd11b8ffe0ab969b25fe1 100644 (file)
@@ -742,11 +742,9 @@ pub struct Weak<T> {
 }
 
 #[cfg(not(stage0))] // NOTE remove cfg after next snapshot
-#[allow(unstable)]
 impl<T> !marker::Send for Weak<T> {}
 
 #[cfg(not(stage0))] // NOTE remove cfg after next snapshot
-#[allow(unstable)]
 impl<T> !marker::Sync for Weak<T> {}
 
 
index 51212bcdb68e7f258ee973272f683a58015d240c..9e436367e6c39ef5553fdcc9188e802af1dfafda 100644 (file)
@@ -96,7 +96,8 @@ pub trait Hasher {
 
 /// A common bound on the `Hasher` parameter to `Hash` implementations in order
 /// to generically hash an aggregate.
-#[experimental = "this trait will likely be replaced by io::Writer"]
+#[unstable(feature = "unnamed_feature", since = "1.0.0",
+           reason = "this trait will likely be replaced by io::Writer")]
 #[allow(missing_docs)]
 pub trait Writer {
     fn write(&mut self, bytes: &[u8]);
index a808593ffbd7d61f1cd39515c69adba34799e27a..8bd2ed95ed5689071dc743aaed8f191f75fea9d5 100644 (file)
@@ -114,7 +114,6 @@ fn discard_doesnt_unborrow() {
 }
 
 #[test]
-#[allow(unstable)]
 fn clone_ref_updates_flag() {
     let x = RefCell::new(0i);
     {
index b1f6a19ea3ede633822f8bf553091f378b4a4cdd..e91571a270f28b00b7655cc1ec4b0e0237769226 100644 (file)
@@ -233,7 +233,7 @@ fn check(&mut self, id: ast::DefId, span: Span, stab: &Option<Stability>) {
             None => {
                 // This is an 'unmarked' API, which should not exist
                 // in the standard library.
-                self.tcx.sess.span_err(span, "use of unmarked staged library feature");
+                self.tcx.sess.span_err(span, "use of unmarked library feature");
                 self.tcx.sess.span_note(span, "this is either a bug in the library you are \
                                                using or a bug in the compiler - there is \
                                                no way to use this feature");
index 4626c5216bcae199989bf3251b46f834aa99874b..4d5c2b765feedef1475231a435665d854ff3279a 100644 (file)
@@ -486,7 +486,7 @@ pub fn phase_2_configure_and_expand(sess: &Session,
 
     // Needs to go *after* expansion to be able to check the results of macro expansion.
     time(time_passes, "complete gated feature checking", (), |_| {
-        let features = 
+        let features =
             syntax::feature_gate::check_crate(sess.codemap(),
                                           &sess.parse_sess.span_diagnostic,
                                           &krate);
index 3af319197e3bb3b392324bdcbcac5b5c90dd371b..e47d1eeb40178e43de93692b1ee35cc9cdad51af 100755 (executable)
@@ -11,6 +11,7 @@
 #![crate_name="lint_output_format"]
 #![crate_type = "lib"]
 #![staged_api]
+#![unstable(feature = "unnamed_feature", since = "1.0.0")]
 
 #[deprecated(feature = "oldstuff", since = "1.0.0")]
 pub fn foo() -> uint {
index e3be0d06a350f6ae1fbb20e1ecec9abc8e4dcfb0..53575192965bb0148b0f22b70bd558059ffb7c46 100644 (file)
@@ -8,9 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags: -F unstable
+// compile-flags: -F deprecated
 
 #![staged_api]
-#[allow(unstable)] //~ ERROR allow(unstable) overruled by outer forbid(unstable)
+#[allow(deprecated)] //~ ERROR allow(deprecated) overruled by outer forbid(deprecated)
 fn main() {
 }
index 10217481bf38af87036592ded82654ccf94b8744..ec4e3c774dbf02d9e9aae57ef8b42788513cfdba 100644 (file)
@@ -8,13 +8,15 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-// compile-flags:-F unstable
+// compile-flags: -F unused_features
 // aux-build:lint_output_format.rs
 
-extern crate lint_output_format; //~ ERROR: use of unmarked item
+#![feature(foo)] //~ ERROR unused or unknown feature
+
+extern crate lint_output_format; //~ WARNING: use of unstable library feature
 use lint_output_format::{foo, bar};
 
 fn main() {
     let _x = foo(); //~ WARNING #[warn(deprecated)] on by default
-    let _y = bar(); //~ ERROR [-F unstable]
+    let _y = bar(); //~ WARNING: use of unstable library feature
 }
index 316c971e016ff6fb2019ef22d54671f8eec7e2c9..130b396387c2142ed70507e4f55f3524417fb92f 100644 (file)
 // aux-build:inherited_stability.rs
 // aux-build:stability_cfg1.rs
 // aux-build:stability_cfg2.rs
+// ignore-tidy-linelength
 
-#![deny(unstable)]
 #![deny(deprecated)]
-#![deny(unstable)]
 #![allow(dead_code)]
 #![staged_api]
 
 #[macro_use]
-extern crate lint_stability; //~ ERROR: use of unmarked item
+extern crate lint_stability; //~ ERROR: use of unmarked library feature
 
 mod cross_crate {
     extern crate stability_cfg1;
-    extern crate stability_cfg2; //~ ERROR: use of unstable item
+    extern crate stability_cfg2; //~ WARNING: use of unstable library feature
 
     use lint_stability::*;
 
@@ -39,17 +38,17 @@ fn test() {
         foo.method_deprecated_text(); //~ ERROR use of deprecated item: text
         foo.trait_deprecated_text(); //~ ERROR use of deprecated item: text
 
-        unstable(); //~ ERROR use of unstable item
-        foo.method_unstable(); //~ ERROR use of unstable item
-        foo.trait_unstable(); //~ ERROR use of unstable item
+        unstable(); //~ WARNING use of unstable library feature
+        foo.method_unstable(); //~ WARNING use of unstable library feature
+        foo.trait_unstable(); //~ WARNING use of unstable library feature
 
-        unstable_text(); //~ ERROR use of unstable item: text
-        foo.method_unstable_text(); //~ ERROR use of unstable item: text
-        foo.trait_unstable_text(); //~ ERROR use of unstable item: text
+        unstable_text(); //~ WARNING use of unstable library feature 'unnamed_feature': text
+        foo.method_unstable_text(); //~ WARNING use of unstable library feature 'unnamed_feature': text
+        foo.trait_unstable_text(); //~ WARNING use of unstable library feature 'unnamed_feature': text
 
-        unmarked(); //~ ERROR use of unmarked item
-        foo.method_unmarked(); //~ ERROR use of unmarked item
-        foo.trait_unmarked(); //~ ERROR use of unmarked item
+        unmarked(); //~ ERROR use of unmarked library feature
+        foo.method_unmarked(); //~ ERROR use of unmarked library feature
+        foo.trait_unmarked(); //~ ERROR use of unmarked library feature
 
         stable();
         foo.method_stable();
@@ -60,23 +59,23 @@ fn test() {
         foo.trait_stable_text();
 
         let _ = DeprecatedStruct { i: 0 }; //~ ERROR use of deprecated item
-        let _ = UnstableStruct { i: 0 }; //~ ERROR use of unstable item
-        let _ = UnmarkedStruct { i: 0 }; //~ ERROR use of unmarked item
+        let _ = UnstableStruct { i: 0 }; //~ WARNING use of unstable library feature
+        let _ = UnmarkedStruct { i: 0 }; //~ ERROR use of unmarked library feature
         let _ = StableStruct { i: 0 };
 
         let _ = DeprecatedUnitStruct; //~ ERROR use of deprecated item
-        let _ = UnstableUnitStruct; //~ ERROR use of unstable item
-        let _ = UnmarkedUnitStruct; //~ ERROR use of unmarked item
+        let _ = UnstableUnitStruct; //~ WARNING use of unstable library feature
+        let _ = UnmarkedUnitStruct; //~ ERROR use of unmarked library feature
         let _ = StableUnitStruct;
 
         let _ = Enum::DeprecatedVariant; //~ ERROR use of deprecated item
-        let _ = Enum::UnstableVariant; //~ ERROR use of unstable item
-        let _ = Enum::UnmarkedVariant; //~ ERROR use of unmarked item
+        let _ = Enum::UnstableVariant; //~ WARNING use of unstable library feature
+        let _ = Enum::UnmarkedVariant; //~ ERROR use of unmarked library feature
         let _ = Enum::StableVariant;
 
         let _ = DeprecatedTupleStruct (1); //~ ERROR use of deprecated item
-        let _ = UnstableTupleStruct (1); //~ ERROR use of unstable item
-        let _ = UnmarkedTupleStruct (1); //~ ERROR use of unmarked item
+        let _ = UnstableTupleStruct (1); //~ WARNING use of unstable library feature
+        let _ = UnmarkedTupleStruct (1); //~ ERROR use of unmarked library feature
         let _ = StableTupleStruct (1);
 
         // At the moment, the lint checker only checks stability in
@@ -93,47 +92,47 @@ fn test() {
     fn test_method_param<F: Trait>(foo: F) {
         foo.trait_deprecated(); //~ ERROR use of deprecated item
         foo.trait_deprecated_text(); //~ ERROR use of deprecated item: text
-        foo.trait_unstable(); //~ ERROR use of unstable item
-        foo.trait_unstable_text(); //~ ERROR use of unstable item: text
-        foo.trait_unmarked(); //~ ERROR use of unmarked item
+        foo.trait_unstable(); //~ WARNING use of unstable library feature
+        foo.trait_unstable_text(); //~ WARNING use of unstable library feature 'unnamed_feature': text
+        foo.trait_unmarked(); //~ ERROR use of unmarked library feature
         foo.trait_stable();
     }
 
     fn test_method_object(foo: &Trait) {
         foo.trait_deprecated(); //~ ERROR use of deprecated item
         foo.trait_deprecated_text(); //~ ERROR use of deprecated item: text
-        foo.trait_unstable(); //~ ERROR use of unstable item
-        foo.trait_unstable_text(); //~ ERROR use of unstable item: text
-        foo.trait_unmarked(); //~ ERROR use of unmarked item
+        foo.trait_unstable(); //~ WARNING use of unstable library feature
+        foo.trait_unstable_text(); //~ WARNING use of unstable library feature 'unnamed_feature': text
+        foo.trait_unmarked(); //~ ERROR use of unmarked library feature
         foo.trait_stable();
     }
 
     struct S;
 
-    impl UnstableTrait for S { } //~ ERROR use of unstable item
+    impl UnstableTrait for S { } //~ WARNING use of unstable library feature
 
-    trait LocalTrait : UnstableTrait { } //~ ERROR use of unstable item
+    trait LocalTrait : UnstableTrait { } //~ WARNING use of unstable library feature
 }
 
 mod inheritance {
-    extern crate inherited_stability; //~ ERROR: use of unstable item
+    extern crate inherited_stability; //~ WARNING: use of unstable library feature
     use self::inherited_stability::*;
 
     fn test_inheritance() {
-        unstable(); //~ ERROR use of unstable item
+        unstable(); //~ WARNING use of unstable library feature
         stable();
 
-        stable_mod::unstable(); //~ ERROR use of unstable item
+        stable_mod::unstable(); //~ WARNING use of unstable library feature
         stable_mod::stable();
 
         unstable_mod::deprecated(); //~ ERROR use of deprecated item
-        unstable_mod::unstable(); //~ ERROR use of unstable item
+        unstable_mod::unstable(); //~ WARNING use of unstable library feature
 
-        let _ = Unstable::UnstableVariant; //~ ERROR use of unstable item
+        let _ = Unstable::UnstableVariant; //~ WARNING use of unstable library feature
         let _ = Unstable::StableVariant;
 
         let x: usize = 0;
-        x.unstable(); //~ ERROR use of unstable item
+        x.unstable(); //~ WARNING use of unstable library feature
         x.stable();
     }
 }
index 6252e01749bd218a2184820e3e70e85368daa5e7..ac1720b339e8412087645dfdbf03ab47ee968200 100644 (file)
@@ -8,8 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![deny(unknown_features)]
+#![deny(unused_features)]
 
-#![feature(this_is_not_a_feature)] //~ ERROR: unknown feature
+#![feature(this_is_not_a_feature)] //~ ERROR: unused or unknown feature
 
 fn main() {}
diff --git a/src/test/compile-fail/simd-experimental.rs b/src/test/compile-fail/simd-experimental.rs
deleted file mode 100644 (file)
index f817f94..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![deny(unstable)]
-#![feature(unnamed_feature)]
-
-use std::simd;
-
-fn main() {
-    let _ = simd::i64x2(0, 0); //~ ERROR: experimental
-}