]> git.lizzy.rs Git - rust.git/blob - tests/ui/stability-attribute/allow-unstable-reexport.rs
Rollup merge of #107091 - clubby789:infer-ftl-missing-dollar, r=compiler-errors
[rust.git] / tests / ui / stability-attribute / allow-unstable-reexport.rs
1 // Allow an unstable re-export without requiring a feature gate.
2 // #94972
3
4 // aux-build:lint-stability.rs
5 // aux-build:lint-stability-reexport.rs
6 #![feature(staged_api)]
7 #![stable(feature = "lint_stability", since = "1.0.0")]
8
9 extern crate lint_stability;
10 extern crate lint_stability_reexport;
11
12 #[unstable(feature = "unstable_test_feature", issue = "none")]
13 pub use lint_stability::unstable;
14
15 // We want to confirm that using a re-export through another crate behaves
16 // the same way as using an item directly
17 #[unstable(feature = "unstable_test_feature", issue = "none")]
18 pub use lint_stability_reexport::unstable_text;
19
20 // Ensure items which aren't marked as unstable can't re-export unstable items
21 #[stable(feature = "lint_stability", since = "1.0.0")]
22 pub use lint_stability::unstable as unstable2;
23 //~^ ERROR use of unstable library feature 'unstable_test_feature'
24
25 fn main() {
26     // Since we didn't enable the feature in this crate, we still can't
27     // use these items, even though they're in scope from the `use`s which are now allowed.
28     unstable(); //~ ERROR use of unstable library feature 'unstable_test_feature'
29     unstable_text(); //~ ERROR use of unstable library feature 'unstable_test_feature'
30 }