summaryrefslogtreecommitdiffstats
path: root/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.rs')
-rw-r--r--src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.rs b/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.rs
new file mode 100644
index 000000000..0474bf0a3
--- /dev/null
+++ b/src/test/ui/associated-types/trait-with-supertraits-needing-sized-self.rs
@@ -0,0 +1,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() {}