1 // revisions: stock staged
2 #![cfg_attr(staged, feature(staged))]
4 #![feature(const_trait_impl)]
5 #![allow(incomplete_features)]
7 #![feature(staged_api)]
8 #![stable(feature = "rust1", since = "1.0.0")]
10 // aux-build: staged-api.rs
11 extern crate staged_api;
15 #[stable(feature = "rust1", since = "1.0.0")]
18 #[stable(feature = "rust1", since = "1.0.0")]
19 #[cfg_attr(staged, rustc_const_stable(feature = "rust1", since = "1.0.0"))]
20 // ^ should trigger error with or without the attribute
21 impl const MyTrait for Stable {
22 fn func() { //~ ERROR trait methods cannot be stable const fn
27 fn non_const_context() {
32 #[unstable(feature = "none", issue = "none")]
33 const fn const_context() {
35 //[stock]~^ ERROR `<staged_api::Unstable as staged_api::MyTrait>::func` is not yet stable as a const fn