|
| 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(min_const_unsafe_fn)] |
| 19 | +#![feature(staged_api)] |
| 20 | + |
| 21 | +// @has 'foo/fn.foo.html' '//pre' 'pub unsafe fn foo() -> u32' |
| 22 | +#[stable(feature = "rust1", since = "1.0.0")] |
| 23 | +#[rustc_const_unstable(feature="foo")] |
| 24 | +pub const unsafe fn foo() -> u32 { 42 } |
| 25 | + |
| 26 | +// @has 'foo/fn.foo2.html' '//pre' 'pub fn foo2() -> u32' |
| 27 | +#[unstable(feature = "humans", issue="0")] |
| 28 | +pub const fn foo2() -> u32 { 42 } |
| 29 | + |
| 30 | +// @has 'foo/fn.bar2.html' '//pre' 'pub const fn bar2() -> u32' |
| 31 | +#[stable(feature = "rust1", since = "1.0.0")] |
| 32 | +pub const fn bar2() -> u32 { 42 } |
| 33 | + |
| 34 | +// @has 'foo/fn.foo2_gated.html' '//pre' 'pub unsafe fn foo2_gated() -> u32' |
| 35 | +#[unstable(feature = "foo2", issue="0")] |
| 36 | +pub const unsafe fn foo2_gated() -> u32 { 42 } |
| 37 | + |
| 38 | +// @has 'foo/fn.bar2_gated.html' '//pre' 'pub const unsafe fn bar2_gated() -> u32' |
| 39 | +#[stable(feature = "rust1", since = "1.0.0")] |
| 40 | +pub const unsafe fn bar2_gated() -> u32 { 42 } |
| 41 | + |
| 42 | +// @has 'foo/fn.bar_not_gated.html' '//pre' 'pub unsafe fn bar_not_gated() -> u32' |
| 43 | +pub const unsafe fn bar_not_gated() -> u32 { 42 } |
0 commit comments