about summary refs log tree commit diff
path: root/src/test/compile-fail/lint-output-format.rs
diff options
context:
space:
mode:
authorAaron Turon <aturon@mozilla.com>2014-06-11 17:23:11 -0700
committerAaron Turon <aturon@mozilla.com>2014-06-18 22:22:26 -0700
commit6008f2c98276be3b880a5a75a0ac234cd866800e (patch)
tree5f420c6d2d216182c49a1ea6ed122cf6451ca705 /src/test/compile-fail/lint-output-format.rs
parentf05cd6e04e62651ec95a3ae66906399d7c0092a1 (diff)
downloadrust-6008f2c98276be3b880a5a75a0ac234cd866800e.tar.gz
rust-6008f2c98276be3b880a5a75a0ac234cd866800e.zip
Add stability inheritance
This commit makes several changes to the stability index infrastructure:

* Stability levels are now inherited lexically, i.e., each item's
  stability level becomes the default for any nested items.

* The computed stability level for an item is stored as part of the
  metadata. When using an item from an external crate, this data is
  looked up and cached.

* The stability lint works from the computed stability level, rather
  than manual stability attribute annotations. However, the lint still
  checks only a limited set of item uses (e.g., it does not check every
  component of a path on import). This will be addressed in a later PR,
  as part of issue #8962.

* The stability lint only applies to items originating from external
  crates, since the stability index is intended as a promise to
  downstream crates.

* The "experimental" lint is now _allow_ by default. This is because
  almost all existing crates have been marked "experimental", pending
  library stabilization. With inheritance in place, this would generate
  a massive explosion of warnings for every Rust program.

  The lint should be changed back to deny-by-default after library
  stabilization is complete.

* The "deprecated" lint still warns by default.

The net result: we can begin tracking stability index for the standard
libraries as we stabilize, without impacting most clients.

Closes #13540.
Diffstat (limited to 'src/test/compile-fail/lint-output-format.rs')
-rw-r--r--src/test/compile-fail/lint-output-format.rs17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/test/compile-fail/lint-output-format.rs b/src/test/compile-fail/lint-output-format.rs
index ba4cf5d17fb..db60002b468 100644
--- a/src/test/compile-fail/lint-output-format.rs
+++ b/src/test/compile-fail/lint-output-format.rs
@@ -9,21 +9,10 @@
 // except according to those terms.
 
 // compile-flags:-F experimental -D unstable
+// aux-build:lint_output_format.rs
 
-#[deprecated]
-fn foo() -> uint {
-    20
-}
-
-#[experimental]
-fn bar() -> uint {
-    40
-}
-
-#[unstable]
-fn baz() -> uint {
-    30
-}
+extern crate lint_output_format;
+use lint_output_format::{foo, bar, baz};
 
 fn main() {
     let _x = foo(); //~ WARNING #[warn(deprecated)] on by default