-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
//! definitions for ../mixed-levels.rs | ||
|
||
#![stable(feature = "stable_feature", since = "1.0.0")] | ||
#![feature(staged_api)] | ||
#![crate_type = "lib"] | ||
|
||
#[stable(feature = "stable_a", since = "1.0.0")] | ||
#[stable(feature = "stable_b", since = "1.8.2")] | ||
#[macro_export] | ||
macro_rules! stable_mac { | ||
() => () | ||
} | ||
|
||
#[unstable(feature = "unstable_a", issue = "none")] | ||
#[stable(feature = "stable_a", since = "1.0.0")] | ||
#[macro_export] | ||
macro_rules! unstable_mac { | ||
() => () | ||
} | ||
|
||
#[stable(feature = "stable_feature", since = "1.0.0")] | ||
#[rustc_const_stable(feature = "stable_c", since = "1.8.2")] | ||
#[rustc_const_stable(feature = "stable_d", since = "1.0.0")] | ||
pub const fn const_stable_fn() {} | ||
|
||
#[stable(feature = "stable_feature", since = "1.0.0")] | ||
#[rustc_const_unstable(feature = "unstable_c", issue = "none")] | ||
#[rustc_const_stable(feature = "stable_c", since = "1.8.2")] | ||
pub const fn const_unstable_fn() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//! Test stability levels for items formerly dependent on multiple unstable features. | ||
//@ aux-build:mixed-levels.rs | ||
|
||
extern crate mixed_levels; | ||
|
||
const USE_STABLE: () = mixed_levels::const_stable_fn(); | ||
const USE_UNSTABLE: () = mixed_levels::const_unstable_fn(); | ||
//~^ ERROR `const_unstable_fn` is not yet stable as a const fn | ||
|
||
fn main() { | ||
mixed_levels::stable_mac!(); | ||
mixed_levels::unstable_mac!(); //~ ERROR use of unstable library feature `unstable_a` [E0658] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
error[E0658]: use of unstable library feature `unstable_a` | ||
--> $DIR/mixed-levels.rs:12:5 | ||
| | ||
LL | mixed_levels::unstable_mac!(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= help: add `#![feature(unstable_a)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: `const_unstable_fn` is not yet stable as a const fn | ||
--> $DIR/mixed-levels.rs:7:26 | ||
| | ||
LL | const USE_UNSTABLE: () = mixed_levels::const_unstable_fn(); | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| | ||
= note: use of unstable library feature `unstable_c` | ||
= help: add `#![feature(unstable_c)]` to the crate attributes to enable | ||
= note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0658`. |