"(const: unstable)" for stable-but-const-unstable

This commit is contained in:
Deadbeef 2021-06-20 08:13:23 +08:00
parent 39260f6d49
commit 9c495b30ef
No known key found for this signature in database
GPG key ID: 6525773485376D92
3 changed files with 33 additions and 9 deletions

View file

@ -8,6 +8,7 @@
#![feature(staged_api)]
// @has 'foo/fn.foo.html' '//pre' 'pub unsafe fn foo() -> u32'
// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature="foo", issue = "none")]
pub const unsafe fn foo() -> u32 { 42 }
@ -39,6 +40,7 @@ pub struct Foo;
impl Foo {
// @has 'foo/struct.Foo.html' '//div[@id="method.gated"]/code' 'pub unsafe fn gated() -> u32'
// @has - '//span[@class="since"]' '1.0.0 (const: unstable)'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature="foo", issue = "none")]
pub const unsafe fn gated() -> u32 { 42 }