]>
Commit | Line | Data |
---|---|---|
0731742a XL |
1 | #![crate_name = "foo"] |
2 | ||
3 | #![unstable(feature = "humans", | |
4 | reason = "who ever let humans program computers, we're apparently really bad at it", | |
dfeec247 | 5 | issue = "none")] |
0731742a | 6 | |
60c5eb7d | 7 | #![feature(foo, foo2)] |
0731742a XL |
8 | #![feature(staged_api)] |
9 | ||
10 | // @has 'foo/fn.foo.html' '//pre' 'pub unsafe fn foo() -> u32' | |
11 | #[stable(feature = "rust1", since = "1.0.0")] | |
dfeec247 | 12 | #[rustc_const_unstable(feature="foo", issue = "none")] |
0731742a XL |
13 | pub const unsafe fn foo() -> u32 { 42 } |
14 | ||
1b1a35ee | 15 | // @has 'foo/fn.foo2.html' '//pre' 'pub const fn foo2() -> u32' |
dfeec247 | 16 | #[unstable(feature = "humans", issue = "none")] |
0731742a XL |
17 | pub const fn foo2() -> u32 { 42 } |
18 | ||
19 | // @has 'foo/fn.bar2.html' '//pre' 'pub const fn bar2() -> u32' | |
fc512014 | 20 | // @has - //span '1.0.0 (const: 1.0.0)' |
0731742a | 21 | #[stable(feature = "rust1", since = "1.0.0")] |
60c5eb7d | 22 | #[rustc_const_stable(feature = "rust1", since = "1.0.0")] |
0731742a XL |
23 | pub const fn bar2() -> u32 { 42 } |
24 | ||
1b1a35ee | 25 | // @has 'foo/fn.foo2_gated.html' '//pre' 'pub const unsafe fn foo2_gated() -> u32' |
dfeec247 | 26 | #[unstable(feature = "foo2", issue = "none")] |
0731742a XL |
27 | pub const unsafe fn foo2_gated() -> u32 { 42 } |
28 | ||
29 | // @has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe fn bar2_gated() -> u32' | |
fc512014 | 30 | // @has - '//span[@class="since"]' '1.0.0 (const: 1.0.0)' |
0731742a | 31 | #[stable(feature = "rust1", since = "1.0.0")] |
60c5eb7d | 32 | #[rustc_const_stable(feature = "rust1", since = "1.0.0")] |
0731742a XL |
33 | pub const unsafe fn bar2_gated() -> u32 { 42 } |
34 | ||
1b1a35ee | 35 | // @has 'foo/fn.bar_not_gated.html' '//pre' 'pub const unsafe fn bar_not_gated() -> u32' |
0731742a | 36 | pub const unsafe fn bar_not_gated() -> u32 { 42 } |
3dfed10e XL |
37 | |
38 | pub struct Foo; | |
39 | ||
40 | impl Foo { | |
17df50a5 XL |
41 | // @has 'foo/struct.Foo.html' '//div[@id="method.gated"]/h4[@class="code-header"]' 'pub fn gated() -> u32' |
42 | #[stable(feature = "rust1", since = "1.0.0")] | |
43 | #[rustc_const_unstable(feature="foo", issue = "none")] | |
44 | pub const fn gated() -> u32 { 42 } | |
45 | ||
3dfed10e XL |
46 | #[stable(feature = "rust1", since = "1.0.0")] |
47 | #[rustc_const_unstable(feature="foo", issue = "none")] | |
48 | pub const unsafe fn gated() -> u32 { 42 } | |
fc512014 | 49 | |
17df50a5 | 50 | // @has 'foo/struct.Foo.html' '//div[@id="method.stable_impl"]/h4[@class="code-header"]' 'pub const fn stable_impl() -> u32' |
fc512014 XL |
51 | // @has - '//span[@class="since"]' '1.0.0 (const: 1.2.0)' |
52 | #[stable(feature = "rust1", since = "1.0.0")] | |
53 | #[rustc_const_stable(feature = "rust1", since = "1.2.0")] | |
54 | pub const fn stable_impl() -> u32 { 42 } | |
3dfed10e | 55 | } |