summaryrefslogtreecommitdiffstats
path: root/tests/ui/stability-attribute/auxiliary
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/stability-attribute/auxiliary')
-rw-r--r--tests/ui/stability-attribute/auxiliary/const-stability-attribute-implies.rs12
-rw-r--r--tests/ui/stability-attribute/auxiliary/similar-unstable-method.rs13
2 files changed, 25 insertions, 0 deletions
diff --git a/tests/ui/stability-attribute/auxiliary/const-stability-attribute-implies.rs b/tests/ui/stability-attribute/auxiliary/const-stability-attribute-implies.rs
new file mode 100644
index 000000000..f78871b5a
--- /dev/null
+++ b/tests/ui/stability-attribute/auxiliary/const-stability-attribute-implies.rs
@@ -0,0 +1,12 @@
+#![crate_type = "lib"]
+#![feature(staged_api)]
+#![stable(feature = "stability_attribute_implies", since = "1.0.0")]
+#![rustc_const_stable(feature = "stability_attribute_implies", since = "1.0.0")]
+
+#[stable(feature = "stability_attribute_implies", since = "1.0.0")]
+#[rustc_const_stable(feature = "const_foo", since = "1.62.0")]
+pub const fn foo() {}
+
+#[stable(feature = "stability_attribute_implies", since = "1.0.0")]
+#[rustc_const_unstable(feature = "const_foobar", issue = "1", implied_by = "const_foo")]
+pub const fn foobar() {}
diff --git a/tests/ui/stability-attribute/auxiliary/similar-unstable-method.rs b/tests/ui/stability-attribute/auxiliary/similar-unstable-method.rs
new file mode 100644
index 000000000..8804186ee
--- /dev/null
+++ b/tests/ui/stability-attribute/auxiliary/similar-unstable-method.rs
@@ -0,0 +1,13 @@
+#![feature(staged_api)]
+#![stable(feature = "libfoo", since = "1.0.0")]
+
+#[unstable(feature = "foo", reason = "...", issue = "none")]
+pub fn foo() {}
+
+#[stable(feature = "libfoo", since = "1.0.0")]
+pub struct Foo;
+
+impl Foo {
+ #[unstable(feature = "foo", reason = "...", issue = "none")]
+ pub fn foo(&self) {}
+}