about summary refs log tree commit diff
path: root/tests/rustdoc/const-display.rs
diff options
context:
space:
mode:
authorLukas Markeffsky <@>2024-09-24 20:17:52 +0200
committerLukas Markeffsky <@>2024-09-24 20:18:36 +0200
commit2fdeb3b8f4cb91eb545880cc0b5db003ef4869b7 (patch)
tree374fdc678ba3025955abc4284b4c5bc47da34381 /tests/rustdoc/const-display.rs
parent67bb749c2e1cf503fee64842963dd3e72a417a3f (diff)
downloadrust-2fdeb3b8f4cb91eb545880cc0b5db003ef4869b7.tar.gz
rust-2fdeb3b8f4cb91eb545880cc0b5db003ef4869b7.zip
rustdoc: inherit parent's stability where applicable
Diffstat (limited to 'tests/rustdoc/const-display.rs')
-rw-r--r--tests/rustdoc/const-display.rs18
1 files changed, 12 insertions, 6 deletions
diff --git a/tests/rustdoc/const-display.rs b/tests/rustdoc/const-display.rs
index ac55a6302f7..a71825d883d 100644
--- a/tests/rustdoc/const-display.rs
+++ b/tests/rustdoc/const-display.rs
@@ -1,8 +1,6 @@
 #![crate_name = "foo"]
 
-#![unstable(feature = "humans",
-            reason = "who ever let humans program computers, we're apparently really bad at it",
-            issue = "none")]
+#![stable(feature = "rust1", since = "1.0.0")]
 
 #![feature(foo, foo2)]
 #![feature(staged_api)]
@@ -48,10 +46,18 @@ pub const unsafe fn foo2_gated() -> u32 { 42 }
 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
 pub const unsafe fn bar2_gated() -> u32 { 42 }
 
-//@ has 'foo/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32'
-//@ !hasraw - '//span[@class="since"]'
-pub const unsafe fn bar_not_gated() -> u32 { 42 }
+#[unstable(
+    feature = "humans",
+    reason = "who ever let humans program computers, we're apparently really bad at it",
+    issue = "none",
+)]
+pub mod unstable {
+    //@ has 'foo/unstable/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32'
+    //@ !hasraw - '//span[@class="since"]'
+    pub const unsafe fn bar_not_gated() -> u32 { 42 }
+}
 
+#[stable(feature = "rust1", since = "1.0.0")]
 pub struct Foo;
 
 impl Foo {