diff options
| author | bors <bors@rust-lang.org> | 2020-08-10 17:12:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-08-10 17:12:42 +0000 |
| commit | 1275cc15d6aa0597f0b3bbf8aa0750239f9da7b2 (patch) | |
| tree | d324048a06cd22cdbd71c2e7d2664cbb15b9b88e /src/test/rustdoc/const-display.rs | |
| parent | 08324fe6f7ac24be4c8bfcab42b12ee447635c80 (diff) | |
| parent | 2a281e0a76d2c48a3c2fbe41c78920a1952adb17 (diff) | |
| download | rust-1275cc15d6aa0597f0b3bbf8aa0750239f9da7b2.tar.gz rust-1275cc15d6aa0597f0b3bbf8aa0750239f9da7b2.zip | |
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.
Diffstat (limited to 'src/test/rustdoc/const-display.rs')
| -rw-r--r-- | src/test/rustdoc/const-display.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/rustdoc/const-display.rs b/src/test/rustdoc/const-display.rs index 8e0d230f7d0..c5016c650e5 100644 --- a/src/test/rustdoc/const-display.rs +++ b/src/test/rustdoc/const-display.rs @@ -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 } +} |
