summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.rs
blob: 0474bf0a33944f0a5fa1ae294eaa6490c3900262 (plain)
1
2
3
4
5
6
7
8
9
10
11
use std::ops::{Add, Sub, Mul, Div};

trait ArithmeticOps: Add<Output=Self> + Sub<Output=Self> + Mul<Output=Self> + Div<Output=Self> {}
//~^ ERROR the size for values of type `Self` cannot be known at compilation time

impl<T> ArithmeticOps for T where T: Add<Output=T> + Sub<Output=T> + Mul<Output=T> + Div<Output=T> {
    // Nothing to implement, since T already supports the other traits.
    // It has the functions it needs already
}

fn main() {}