]> git.lizzy.rs Git - rust.git/blob - src/test/rustdoc/const-display.rs
Auto merge of #56962 - nivkner:fixme_fixup4, r=pnkfelix
[rust.git] / src / test / rustdoc / const-display.rs
1 // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 #![crate_name = "foo"]
12
13 #![unstable(feature = "humans",
14             reason = "who ever let humans program computers, we're apparently really bad at it",
15             issue = "0")]
16
17 #![feature(rustc_const_unstable, const_fn, foo, foo2)]
18 #![feature(staged_api)]
19
20 // @has 'foo/fn.foo.html' '//pre' 'pub unsafe fn foo() -> u32'
21 #[stable(feature = "rust1", since = "1.0.0")]
22 #[rustc_const_unstable(feature="foo")]
23 pub const unsafe fn foo() -> u32 { 42 }
24
25 // @has 'foo/fn.foo2.html' '//pre' 'pub fn foo2() -> u32'
26 #[unstable(feature = "humans", issue="0")]
27 pub const fn foo2() -> u32 { 42 }
28
29 // @has 'foo/fn.bar2.html' '//pre' 'pub const fn bar2() -> u32'
30 #[stable(feature = "rust1", since = "1.0.0")]
31 pub const fn bar2() -> u32 { 42 }
32
33 // @has 'foo/fn.foo2_gated.html' '//pre' 'pub unsafe fn foo2_gated() -> u32'
34 #[unstable(feature = "foo2", issue="0")]
35 pub const unsafe fn foo2_gated() -> u32 { 42 }
36
37 // @has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe fn bar2_gated() -> u32'
38 #[stable(feature = "rust1", since = "1.0.0")]
39 pub const unsafe fn bar2_gated() -> u32 { 42 }
40
41 // @has 'foo/fn.bar_not_gated.html' '//pre' 'pub unsafe fn bar_not_gated() -> u32'
42 pub const unsafe fn bar_not_gated() -> u32 { 42 }