File: const_trait_impl.rs

package info (click to toggle)
rust-easy-ext 1.0.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 312 kB
  • sloc: makefile: 2
file content (27 lines) | stat: -rw-r--r-- 549 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-License-Identifier: Apache-2.0 OR MIT

#![feature(const_trait_impl)]

/*
TODO: update for https://github.com/rust-lang/rust/pull/100982

// https://github.com/rust-lang/rust/issues/67792
// https://github.com/rust-lang/rust/blob/1.63.0/src/test/ui/rfc-2632-const-trait-impl/call-const-trait-method-pass.rs

use easy_ext::ext;

#[ext(Ext)]
impl const i32 {
    fn plus(self, rhs: Self) -> Self {
        self + rhs
    }
}

pub const fn add_i32(a: i32, b: i32) -> i32 {
    a.plus(b)
}

const ADD_I32: i32 = 1i32.plus(2i32);
*/

fn main() {}