Skip to content

Commit

Permalink
Add regression test for #131618
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jan 21, 2025
1 parent b5b353b commit b77b18a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/rustdoc/const-display.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@

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

//@ has 'foo/fn.foo_unsafe.html' '//pre' 'pub unsafe fn foo_unsafe() -> u32'
//@ has - '//span[@class="since"]' '1.0.0 (const: unstable)'
//@ has - '//span[@class="item-info"]//span' 'The const version is a \
// nightly-only experimental API. (foo #111)'
//@ has - '//span[@class="item-info"]//a[@href="https://github.com/rust-lang/rust/issues/111"]' \
// '#111'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature="foo", issue = "111")]
pub const unsafe fn foo_unsafe() -> u32 { 42 }
Expand Down

0 comments on commit b77b18a

Please sign in to comment.