2020-09-25 13:51:52 -07:00
|
|
|
#![feature(staged_api)]
|
2023-08-06 13:20:55 +00:00
|
|
|
#![feature(const_trait_impl, effects)]
|
2021-11-17 21:06:17 -05:00
|
|
|
#![stable(feature = "stable", since = "1.0.0")]
|
2020-09-25 13:51:52 -07:00
|
|
|
|
2021-11-17 21:06:17 -05:00
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
|
|
|
pub const fn foo() {} //~ ERROR function has missing const stability attribute
|
2020-09-25 13:51:52 -07:00
|
|
|
|
2021-11-17 21:06:17 -05:00
|
|
|
#[unstable(feature = "unstable", issue = "none")]
|
2021-11-17 21:08:16 -05:00
|
|
|
pub const fn bar() {} // ok because function is unstable
|
2020-09-25 13:51:52 -07:00
|
|
|
|
2021-11-17 21:06:17 -05: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-17 21:08:16 -05:00
|
|
|
pub const fn bar() {} // ok because function is unstable
|
2021-11-17 21:06:17 -05:00
|
|
|
}
|
|
|
|
|
2022-02-13 05:54:00 -05:00
|
|
|
#[stable(feature = "stable", since = "1.0.0")]
|
2022-08-28 06:27:31 +00:00
|
|
|
#[const_trait]
|
2022-02-13 05:54:00 -05: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 13:51:52 -07:00
|
|
|
|
|
|
|
fn main() {}
|