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