@@ -70,17 +70,33 @@ help: make the function or method const
7070LL | pub extern "C" fn foo_c() {}
7171 | ^^^^^^^^^^^^^^^^^^^^^^^^^
7272
73+ error: attribute `#[rustc_const_stable]` can only be applied to functions that are declared `#[stable]`
74+ --> $DIR/rustc-const-stability-require-const.rs:52:1
75+ |
76+ LL | #[rustc_const_stable(feature = "barfoo_const", since = "1.0.0")]
77+ | ---------------------------------------------------------------- attribute specified here
78+ LL | const fn barfoo_unmarked() {}
79+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
80+
81+ error: attribute `#[rustc_const_stable]` can only be applied to functions that are declared `#[stable]`
82+ --> $DIR/rustc-const-stability-require-const.rs:57:1
83+ |
84+ LL | #[rustc_const_stable(feature = "barfoo_const", since = "1.0.0")]
85+ | ---------------------------------------------------------------- attribute specified here
86+ LL | pub const fn barfoo_unstable() {}
87+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88+
7389error: attributes `#[rustc_const_unstable]`, `#[rustc_const_stable]` and `#[rustc_const_stable_indirect]` require the function or method to be `const`
74- --> $DIR/rustc-const-stability-require-const.rs:64 :1
90+ --> $DIR/rustc-const-stability-require-const.rs:63 :1
7591 |
7692LL | pub fn not_a_const_fn() {}
7793 | ^^^^^^^^^^^^^^^^^^^^^^^
7894 |
7995help: make the function or method const
80- --> $DIR/rustc-const-stability-require-const.rs:64 :1
96+ --> $DIR/rustc-const-stability-require-const.rs:63 :1
8197 |
8298LL | pub fn not_a_const_fn() {}
8399 | ^^^^^^^^^^^^^^^^^^^^^^^
84100
85- error: aborting due to 7 previous errors
101+ error: aborting due to 9 previous errors
86102
0 commit comments