2023-04-16 06:12:37 -05:00
|
|
|
// known-bug: #110395
|
|
|
|
|
2020-02-05 11:40:47 -06:00
|
|
|
#![feature(const_trait_impl)]
|
|
|
|
|
|
|
|
pub struct Int(i32);
|
|
|
|
|
2022-03-16 04:49:54 -05:00
|
|
|
impl const std::ops::Add for i32 {
|
2020-02-05 11:40:47 -06:00
|
|
|
type Output = Self;
|
|
|
|
|
|
|
|
fn add(self, rhs: Self) -> Self {
|
|
|
|
self + rhs
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-16 04:49:54 -05:00
|
|
|
impl std::ops::Add for Int {
|
2020-02-05 11:40:47 -06:00
|
|
|
type Output = Self;
|
|
|
|
|
|
|
|
fn add(self, rhs: Self) -> Self {
|
|
|
|
Int(self.0 + rhs.0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-16 04:49:54 -05:00
|
|
|
impl const std::ops::Add for Int {
|
2020-02-05 11:40:47 -06:00
|
|
|
type Output = Self;
|
|
|
|
|
|
|
|
fn add(self, rhs: Self) -> Self {
|
|
|
|
Int(self.0 + rhs.0)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|