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