]>
Commit | Line | Data |
---|---|---|
ff7c6d11 | 1 | fn main() { |
ea8adc8c | 2 | } |
85aaf69f | 3 | |
ff7c6d11 | 4 | fn foo<T>(x: T, y: T) { |
dfeec247 | 5 | let z = x + y; //~ ERROR cannot add `T` to `T` |
ea8adc8c | 6 | } |
94b46f34 XL |
7 | |
8 | fn bar<T>(x: T) { | |
9 | x += x; //~ ERROR binary assignment operation `+=` cannot be applied to type `T` | |
10 | } | |
5e7ed085 FG |
11 | |
12 | fn baz<T>(x: T) { | |
13 | let y = -x; //~ ERROR cannot apply unary operator `-` to type `T` | |
14 | let y = !x; //~ ERROR cannot apply unary operator `!` to type `T` | |
15 | let y = *x; //~ ERROR type `T` cannot be dereferenced | |
16 | } |