summaryrefslogtreecommitdiffstats
path: root/tests/ui/deprecation/staged-deprecation-in-future.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/ui/deprecation/staged-deprecation-in-future.rs
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/deprecation/staged-deprecation-in-future.rs')
-rw-r--r--tests/ui/deprecation/staged-deprecation-in-future.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/ui/deprecation/staged-deprecation-in-future.rs b/tests/ui/deprecation/staged-deprecation-in-future.rs
new file mode 100644
index 000000000..87b15ec30
--- /dev/null
+++ b/tests/ui/deprecation/staged-deprecation-in-future.rs
@@ -0,0 +1,18 @@
+#![deny(deprecated_in_future)]
+
+#![feature(staged_api)]
+
+#![stable(feature = "rustc_deprecation-in-future-test", since = "1.0.0")]
+
+#[deprecated(since = "99.99.99", note = "effectively never")]
+#[stable(feature = "rustc_deprecation-in-future-test", since = "1.0.0")]
+pub struct S1;
+
+#[deprecated(since = "TBD", note = "literally never")]
+#[stable(feature = "rustc_deprecation-in-future-test", since = "1.0.0")]
+pub struct S2;
+
+fn main() {
+ let _ = S1; //~ ERROR use of unit struct `S1` that will be deprecated in future version 99.99.99: effectively never
+ let _ = S2; //~ ERROR use of unit struct `S2` that will be deprecated in a future Rust version: literally never
+}