summaryrefslogtreecommitdiffstats
path: root/src/test/ui/stability-attribute/auxiliary
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:06:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:06:37 +0000
commit246f239d9f40f633160f0c18f87a20922d4e77bb (patch)
tree5a88572663584b3d4d28e5a20e10abab1be40884 /src/test/ui/stability-attribute/auxiliary
parentReleasing progress-linux version 1.64.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-246f239d9f40f633160f0c18f87a20922d4e77bb.tar.xz
rustc-246f239d9f40f633160f0c18f87a20922d4e77bb.zip
Merging debian version 1.65.0+dfsg1-2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/stability-attribute/auxiliary')
-rw-r--r--src/test/ui/stability-attribute/auxiliary/ctor-stability.rs8
-rw-r--r--src/test/ui/stability-attribute/auxiliary/default_body.rs29
2 files changed, 37 insertions, 0 deletions
diff --git a/src/test/ui/stability-attribute/auxiliary/ctor-stability.rs b/src/test/ui/stability-attribute/auxiliary/ctor-stability.rs
new file mode 100644
index 000000000..74c6023d7
--- /dev/null
+++ b/src/test/ui/stability-attribute/auxiliary/ctor-stability.rs
@@ -0,0 +1,8 @@
+#![crate_type = "lib"]
+#![feature(staged_api)]
+#![stable(feature = "none", since = "1.0")]
+
+#[stable(feature = "none", since = "1.0")]
+pub enum Foo {
+ A,
+}
diff --git a/src/test/ui/stability-attribute/auxiliary/default_body.rs b/src/test/ui/stability-attribute/auxiliary/default_body.rs
new file mode 100644
index 000000000..3a177419d
--- /dev/null
+++ b/src/test/ui/stability-attribute/auxiliary/default_body.rs
@@ -0,0 +1,29 @@
+#![crate_type = "lib"]
+#![feature(staged_api, rustc_attrs)]
+#![stable(feature = "stable_feature", since = "1.0.0")]
+
+#[stable(feature = "stable_feature", since = "1.0.0")]
+pub trait JustTrait {
+ #[stable(feature = "stable_feature", since = "1.0.0")]
+ #[rustc_default_body_unstable(feature = "constant_default_body", issue = "none")]
+ const CONSTANT: usize = 0;
+
+ #[rustc_default_body_unstable(feature = "fun_default_body", issue = "none")]
+ #[stable(feature = "stable_feature", since = "1.0.0")]
+ fn fun() {}
+}
+
+#[rustc_must_implement_one_of(eq, neq)]
+#[stable(feature = "stable_feature", since = "1.0.0")]
+pub trait Equal {
+ #[rustc_default_body_unstable(feature = "eq_default_body", issue = "none")]
+ #[stable(feature = "stable_feature", since = "1.0.0")]
+ fn eq(&self, other: &Self) -> bool {
+ !self.neq(other)
+ }
+
+ #[stable(feature = "stable_feature", since = "1.0.0")]
+ fn neq(&self, other: &Self) -> bool {
+ !self.eq(other)
+ }
+}