about summary refs log tree commit diff
path: root/tests/ui/consts/rustc-const-stability-require-const.stderr
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-10-26 09:40:03 +0200
committerRalf Jung <post@ralfj.de>2024-10-28 11:48:39 +0100
commitd066dfdb835f15fe2c4d2bdb31d88cb948b360ad (patch)
treeec737bedc6aff10a4cd1ab2d9de28fa4a8280ef8 /tests/ui/consts/rustc-const-stability-require-const.stderr
parentf370f3493d3c85c7032a98e6c22b419251f18d2a (diff)
downloadrust-d066dfdb835f15fe2c4d2bdb31d88cb948b360ad.tar.gz
rust-d066dfdb835f15fe2c4d2bdb31d88cb948b360ad.zip
we can now enable the 'const stable fn must be stable' check
Diffstat (limited to 'tests/ui/consts/rustc-const-stability-require-const.stderr')
-rw-r--r--tests/ui/consts/rustc-const-stability-require-const.stderr22
1 files changed, 19 insertions, 3 deletions
diff --git a/tests/ui/consts/rustc-const-stability-require-const.stderr b/tests/ui/consts/rustc-const-stability-require-const.stderr
index 09b96ce6f83..d9a7d37cbcd 100644
--- a/tests/ui/consts/rustc-const-stability-require-const.stderr
+++ b/tests/ui/consts/rustc-const-stability-require-const.stderr
@@ -70,17 +70,33 @@ help: make the function or method const
 LL | pub extern "C" fn foo_c() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^^^
 
+error: attribute `#[rustc_const_stable]` can only be applied to functions that are declared `#[stable]`
+  --> $DIR/rustc-const-stability-require-const.rs:52:1
+   |
+LL | #[rustc_const_stable(feature = "barfoo_const", since = "1.0.0")]
+   | ---------------------------------------------------------------- attribute specified here
+LL | const fn barfoo_unmarked() {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: attribute `#[rustc_const_stable]` can only be applied to functions that are declared `#[stable]`
+  --> $DIR/rustc-const-stability-require-const.rs:57:1
+   |
+LL | #[rustc_const_stable(feature = "barfoo_const", since = "1.0.0")]
+   | ---------------------------------------------------------------- attribute specified here
+LL | pub const fn barfoo_unstable() {}
+   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 error: attributes `#[rustc_const_unstable]`, `#[rustc_const_stable]` and `#[rustc_const_stable_indirect]` require the function or method to be `const`
-  --> $DIR/rustc-const-stability-require-const.rs:64:1
+  --> $DIR/rustc-const-stability-require-const.rs:63:1
    |
 LL | pub fn not_a_const_fn() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^
    |
 help: make the function or method const
-  --> $DIR/rustc-const-stability-require-const.rs:64:1
+  --> $DIR/rustc-const-stability-require-const.rs:63:1
    |
 LL | pub fn not_a_const_fn() {}
    | ^^^^^^^^^^^^^^^^^^^^^^^
 
-error: aborting due to 7 previous errors
+error: aborting due to 9 previous errors