| 1 |
// SPDX-License-Identifier: Apache-2.0 OR MIT |
| 2 |
|
| 3 |
#![feature(const_trait_impl)] |
| 4 |
|
| 5 |
/* |
| 6 |
TODO: update for https://github.com/rust-lang/rust/pull/100982 |
| 7 |
|
| 8 |
// https://github.com/rust-lang/rust/issues/67792 |
| 9 |
// https://github.com/rust-lang/rust/blob/1.63.0/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs |
| 10 |
|
| 11 |
use easy_ext::ext; |
| 12 |
|
| 13 |
#[ext(Ext)] |
| 14 |
impl const i32 { |
| 15 |
fn plus(self, rhs: Self) -> Self { |
| 16 |
self + rhs |
| 17 |
} |
| 18 |
} |
| 19 |
|
| 20 |
pub const fn add_i32(a: i32, b: i32) -> i32 { |
| 21 |
a.plus(b) |
| 22 |
} |
| 23 |
|
| 24 |
const ADD_I32: i32 = 1i32.plus(2i32); |
| 25 |
*/ |
| 26 |
|
| 27 |
fn main() {} |