2020-09-25 20:51:52 +00:00
|
|
|
#![feature(staged_api)]
|
2021-11-18 02:08:16 +00:00
|
|
|
#![feature(const_trait_impl)]
|
2021-11-18 02:06:17 +00:00
|
|
|
#![stable(feature = "stable", since = "1.0.0")]
|
2020-09-25 20:51:52 +00:00
|
|
|
|
2021-11-18 02:06:17 +00:00
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
pub const fn foo() {} //~ ERROR function has missing const stability attribute
|
2020-09-25 20:51:52 +00:00
|
|
|
|
2021-11-18 02:06:17 +00:00
|
|
|
#[unstable(feature = "unstable", issue = "none")]
|
2021-11-18 02:08:16 +00:00
|
|
|
pub const fn bar() {} // ok because function is unstable
|
2020-09-25 20:51:52 +00:00
|
|
|
|
2021-11-18 02:06:17 +00:00
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
pub struct Foo;
|
|
|
|
impl Foo {
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
pub const fn foo() {} //~ ERROR associated function has missing const stability attribute
|
|
|
|
|
|
|
|
#[unstable(feature = "unstable", issue = "none")]
|
2021-11-18 02:08:16 +00:00
|
|
|
pub const fn bar() {} // ok because function is unstable
|
2021-11-18 02:06:17 +00:00
|
|
|
}
|
|
|
|
|
2022-02-13 10:54:00 +00:00
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
2022-08-28 06:27:31 +00:00
|
|
|
#[const_trait]
|
2022-02-13 10:54:00 +00:00
|
|
|
pub trait Bar {
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
fn fun();
|
|
|
|
}
|
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
impl const Bar for Foo {
|
|
|
|
//~^ ERROR implementation has missing const stability attribute
|
|
|
|
fn fun() {}
|
|
|
|
}
|
2020-09-25 20:51:52 +00:00
|
|
|
|
|
|
|
fn main() {}
|