diff --git a/src/test/ui/stability-attribute/allow-unstable-reexport.rs b/src/test/ui/stability-attribute/allow-unstable-reexport.rs new file mode 100644 index 0000000000000..afe31321e2573 --- /dev/null +++ b/src/test/ui/stability-attribute/allow-unstable-reexport.rs @@ -0,0 +1,19 @@ +// Demonstrating that intermediary unstable attributes on re-exports appear to be ignored. This is a modified version of a test from another PR + +// aux-build:lint-stability.rs +// aux-build:lint-stability-reexport.rs +#![feature(staged_api)] + +// Enable the feature the root item requires. +#![feature(unstable_test_feature)] +#![stable(feature = "lint_stability", since = "1.0.0")] + +extern crate lint_stability; +extern crate lint_stability_reexport; + +// the `#[unstable(feature = "unstable_reexport")` attribute placed on this re-export hasn't been enabled here, but it seems to work anyway. +use lint_stability_reexport::unstable_text; + +fn main() { + unstable_text(); //~ ERROR use of unstable library feature 'unstable_reexport' +} diff --git a/src/test/ui/stability-attribute/auxiliary/lint-stability-reexport.rs b/src/test/ui/stability-attribute/auxiliary/lint-stability-reexport.rs new file mode 100644 index 0000000000000..db4836e6d303d --- /dev/null +++ b/src/test/ui/stability-attribute/auxiliary/lint-stability-reexport.rs @@ -0,0 +1,9 @@ +#![crate_type = "lib"] +#![feature(staged_api)] +#![feature(unstable_test_feature)] +#![stable(feature = "lint_stability", since = "1.0.0")] + +extern crate lint_stability; + +#[unstable(feature = "unstable_reexport", issue = "none")] +pub use lint_stability::unstable_text;