about summary refs log tree commit diff
path: root/tests/ui/stability-attribute/check-stability-issue-138319.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/stability-attribute/check-stability-issue-138319.rs')
-rw-r--r--tests/ui/stability-attribute/check-stability-issue-138319.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/ui/stability-attribute/check-stability-issue-138319.rs b/tests/ui/stability-attribute/check-stability-issue-138319.rs
new file mode 100644
index 00000000000..5440e0cad94
--- /dev/null
+++ b/tests/ui/stability-attribute/check-stability-issue-138319.rs
@@ -0,0 +1,39 @@
+//@ check-pass
+fn _foo() {
+    _Bar { //~ WARNING use of deprecated struct `_Bar`: reason
+        #[expect(deprecated)]
+        foo: 0,
+    };
+}
+
+#[deprecated = "reason"]
+struct _Bar {
+    foo: u32,
+}
+
+fn _foo2() {
+    #[expect(deprecated)]
+    _Bar2 {
+        foo2: 0,
+    };
+}
+
+#[deprecated = "reason"]
+struct _Bar2 {
+    foo2: u32,
+}
+
+fn _foo3() {
+    _Bar3 {
+        #[expect(deprecated)]
+        foo3: 0,
+    };
+}
+
+struct _Bar3 {
+    #[deprecated = "reason"]
+    foo3: u32,
+}
+
+
+fn main() {}