2015-01-16 16:08:24 -06:00
|
|
|
// compile-flags: -F unused_features
|
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.
2014-06-11 19:23:11 -05:00
|
|
|
// aux-build:lint_output_format.rs
|
2013-10-08 20:26:09 -05:00
|
|
|
|
2016-11-10 11:08:21 -06:00
|
|
|
#![allow(deprecated)]
|
2015-01-16 16:08:24 -06:00
|
|
|
|
2015-03-05 20:33:58 -06:00
|
|
|
extern crate lint_output_format; //~ ERROR use of unstable library feature
|
2015-09-12 08:10:12 -05:00
|
|
|
use lint_output_format::{foo, bar}; //~ ERROR use of unstable library feature
|
2022-07-15 12:22:36 -05:00
|
|
|
//~| ERROR use of unstable library feature
|
2013-10-08 20:26:09 -05:00
|
|
|
|
|
|
|
fn main() {
|
2016-11-10 11:08:21 -06:00
|
|
|
let _x = foo();
|
2015-03-05 20:33:58 -06:00
|
|
|
let _y = bar(); //~ ERROR use of unstable library feature
|
2013-10-08 20:26:09 -05:00
|
|
|
}
|