]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/rfc-2632-const-trait-impl/stability.rs
1 #![feature(allow_internal_unstable)]
3 #![feature(const_trait_impl)]
4 #![feature(staged_api)]
5 #![stable(feature = "rust1", since = "1.0.0")]
7 #[stable(feature = "rust1", since = "1.0.0")]
10 #[stable(feature = "rust1", since = "1.0.0")]
11 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
12 impl const std
::ops
::Sub
for Int
{
15 fn sub(self, rhs
: Self) -> Self {
16 //~^ ERROR trait methods cannot be stable const fn
21 #[stable(feature = "rust1", since = "1.0.0")]
22 #[rustc_const_unstable(feature = "const_add", issue = "none")]
23 impl const std
::ops
::Add
for Int
{
26 fn add(self, rhs
: Self) -> Self {
31 #[stable(feature = "rust1", since = "1.0.0")]
32 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
33 pub const fn foo() -> Int
{
35 //~^ ERROR not yet stable as a const fn
39 #[stable(feature = "rust1", since = "1.0.0")]
40 #[rustc_const_unstable(feature = "bar", issue = "none")]
41 pub const fn bar() -> Int
{