Skip to content

Commit a6bbf15

Browse files
Add regression test for #131618
1 parent b5b353b commit a6bbf15

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/rustdoc/const-display.rs

+13-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@
77

88
//@ has 'foo/fn.foo.html' '//pre' 'pub fn foo() -> u32'
99
//@ has - '//span[@class="since"]' '1.0.0 (const: unstable)'
10+
//@ has - '//span[@class="item-info"]//span' 'The const version is a \
11+
// nightly-only experimental API. (foo)'
1012
#[stable(feature = "rust1", since = "1.0.0")]
1113
#[rustc_const_unstable(feature="foo", issue = "none")]
1214
pub const fn foo() -> u32 { 42 }
1315

1416
//@ has 'foo/fn.foo_unsafe.html' '//pre' 'pub unsafe fn foo_unsafe() -> u32'
1517
//@ has - '//span[@class="since"]' '1.0.0 (const: unstable)'
18+
//@ has - '//span[@class="item-info"]//span' 'The const version is a \
19+
// nightly-only experimental API. (foo #111)'
20+
//@ has - '//span[@class="item-info"]//a[@href="https://github.com/rust-lang/rust/issues/111"]' \
21+
// '#111'
1622
#[stable(feature = "rust1", since = "1.0.0")]
1723
#[rustc_const_unstable(feature="foo", issue = "111")]
1824
pub const unsafe fn foo_unsafe() -> u32 { 42 }
@@ -63,12 +69,18 @@ pub struct Foo;
6369
impl Foo {
6470
//@ has 'foo/struct.Foo.html' '//*[@id="method.gated"]/h4[@class="code-header"]' 'pub fn gated() -> u32'
6571
//@ has - '//span[@class="since"]' '1.0.0 (const: unstable)'
72+
//@ has - '//span[@class="item-info"]//span' 'The const version is a \
73+
// nightly-only experimental API. (foo #112)'
74+
//@ has - '//span[@class="item-info"]//a[@href="https://github.com/rust-lang/rust/issues/112"]' \
75+
// '#112'
6676
#[stable(feature = "rust1", since = "1.0.0")]
67-
#[rustc_const_unstable(feature="foo", issue = "none")]
77+
#[rustc_const_unstable(feature="foo", issue = "112")]
6878
pub const fn gated() -> u32 { 42 }
6979

7080
//@ has 'foo/struct.Foo.html' '//*[@id="method.gated_unsafe"]/h4[@class="code-header"]' 'pub unsafe fn gated_unsafe() -> u32'
7181
//@ has - '//span[@class="since"]' '1.0.0 (const: unstable)'
82+
//@ has - '//span[@class="item-info"]//span' 'The const version is a \
83+
// nightly-only experimental API. (foo)'
7284
#[stable(feature = "rust1", since = "1.0.0")]
7385
#[rustc_const_unstable(feature="foo", issue = "none")]
7486
pub const unsafe fn gated_unsafe() -> u32 { 42 }

0 commit comments

Comments
 (0)