Skip to content

Commit 2a281e0

Browse files
Add test for rustc_const_unstable on methods
1 parent eb7384d commit 2a281e0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/rustdoc/const-display.rs

+9
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,12 @@ pub const unsafe fn bar2_gated() -> u32 { 42 }
3232

3333
// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub unsafe fn bar_not_gated() -> u32'
3434
pub const unsafe fn bar_not_gated() -> u32 { 42 }
35+
36+
pub struct Foo;
37+
38+
impl Foo {
39+
// @has 'foo/struct.Foo.html' '//h4[@id="method.gated"]/code' 'pub unsafe fn gated() -> u32'
40+
#[stable(feature = "rust1", since = "1.0.0")]
41+
#[rustc_const_unstable(feature="foo", issue = "none")]
42+
pub const unsafe fn gated() -> u32 { 42 }
43+
}

0 commit comments

Comments
 (0)