]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.rs
Rollup merge of #76468 - SNCPlay42:lifetime-names, r=Mark-Simulacrum
[rust.git] / src / test / ui / associated-types / trait-with-supertraits-needing-sized-self.rs
1 use std::ops::{Add, Sub, Mul, Div};
2
3 trait ArithmeticOps: Add<Output=Self> + Sub<Output=Self> + Mul<Output=Self> + Div<Output=Self> {}
4 //~^ ERROR the size for values of type `Self` cannot be known at compilation time
5
6 impl<T> ArithmeticOps for T where T: Add<Output=T> + Sub<Output=T> + Mul<Output=T> + Div<Output=T> {
7     // Nothing to implement, since T already supports the other traits.
8     // It has the functions it needs already
9 }
10
11 fn main() {}