Auto merge of #74936 - GuillaumeGomez:const-rustc_const_unstable, r=jyn514

Don't print "const" keyword on non-nightly build if rustc_const_unstable is used on the item

Fixes #74579.
This commit is contained in:
bors 2020-08-10 17:12:42 +00:00
commit 1275cc15d6
2 changed files with 32 additions and 5 deletions

View file

@ -32,3 +32,12 @@ pub const unsafe fn bar2_gated() -> u32 { 42 }
// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub unsafe fn bar_not_gated() -> u32'
pub const unsafe fn bar_not_gated() -> u32 { 42 }
pub struct Foo;
impl Foo {
// @has 'foo/struct.Foo.html' '//h4[@id="method.gated"]/code' 'pub unsafe fn gated() -> u32'
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_const_unstable(feature="foo", issue = "none")]
pub const unsafe fn gated() -> u32 { 42 }
}