]>
git.proxmox.com Git - rustc.git/blob - src/test/ui/rfc-2632-const-trait-impl/stability.rs
1 #![allow(incomplete_features)]
2 #![feature(allow_internal_unstable)]
4 #![feature(const_trait_impl)]
5 #![feature(staged_api)]
9 #[stable(feature = "rust1", since = "1.0.0")]
10 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
11 impl const std
::ops
::Sub
for Int
{
14 fn sub(self, rhs
: Self) -> Self {
15 //~^ ERROR trait methods cannot be stable const fn
20 #[rustc_const_unstable(feature = "const_add", issue = "none")]
21 impl const std
::ops
::Add
for Int
{
24 fn add(self, rhs
: Self) -> Self {
29 #[stable(feature = "rust1", since = "1.0.0")]
30 #[rustc_const_stable(feature = "rust1", since = "1.0.0")]
31 pub const fn foo() -> Int
{
33 //~^ ERROR can only call other `const fn` within a `const fn`
37 #[stable(feature = "rust1", since = "1.0.0")]
38 #[rustc_const_unstable(feature = "bar", issue = "none")]
39 pub const fn bar() -> Int
{