mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
912783402f
Extend support for `implies_by` (from `#[stable]` and `#[unstable]`) to `#[rustc_const_stable]` and `#[rustc_const_unstable]`. Signed-off-by: David Wood <david.wood@huawei.com>
17 lines
602 B
Rust
17 lines
602 B
Rust
#![crate_type = "lib"]
|
|
#![feature(staged_api)]
|
|
#![stable(feature = "stability_attribute_implies", since = "1.0.0")]
|
|
#![rustc_const_stable(feature = "stability_attribute_implies", since = "1.0.0")]
|
|
|
|
// Tests that `implied_by = "const_bar"` results in an error being emitted if `const_bar` does not
|
|
// exist.
|
|
|
|
#[stable(feature = "stability_attribute_implies", since = "1.0.0")]
|
|
#[rustc_const_unstable(feature = "const_foobar", issue = "1", implied_by = "const_bar")]
|
|
//~^ ERROR feature `const_bar` implying `const_foobar` does not exist
|
|
pub const fn foobar() -> u32 {
|
|
0
|
|
}
|
|
|
|
const VAR: u32 = foobar();
|