Add support for stable-const-since in docs on items (standalone or assoc)

This commit is contained in:
Rune Tynan 2020-11-29 21:00:14 -05:00
parent b776d1c3e3
commit ccbb0f5c1a
No known key found for this signature in database
GPG key ID: 7ECC932F8B2C731E
7 changed files with 99 additions and 18 deletions

View file

@ -1,3 +1,5 @@
// ignore-tidy-linelength
#![crate_name = "foo"]
#![unstable(feature = "humans",
@ -17,6 +19,7 @@ pub const unsafe fn foo() -> u32 { 42 }
pub const fn foo2() -> u32 { 42 }
// @has 'foo/fn.bar2.html' '//pre' 'pub const fn bar2() -> u32'
// @has - //span '1.0.0 (const: 1.0.0)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
pub const fn bar2() -> u32 { 42 }
@ -26,6 +29,7 @@ pub const fn bar2() -> u32 { 42 }
pub const unsafe fn foo2_gated() -> u32 { 42 }
// @has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe fn bar2_gated() -> u32'
// @has - '//span[@class="since"]' '1.0.0 (const: 1.0.0)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.0.0")]
pub const unsafe fn bar2_gated() -> u32 { 42 }
@ -40,4 +44,10 @@ impl Foo {
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature="foo", issue = "none")]
pub const unsafe fn gated() -> u32 { 42 }
// @has 'foo/struct.Foo.html' '//h4[@id="method.stable_impl"]/code' 'pub const fn stable_impl() -> u32'
// @has - '//span[@class="since"]' '1.0.0 (const: 1.2.0)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_stable(feature = "rust1", since = "1.2.0")]
pub const fn stable_impl() -> u32 { 42 }
}