summaryrefslogtreecommitdiffstats
path: root/tests/ui/type/type-check/missing_trait_impl.rs
blob: 0e3e703a2f5ac61d6160f168fbe42aa418d49402 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn main() {
}

fn foo<T>(x: T, y: T) {
    let z = x + y; //~ ERROR cannot add `T` to `T`
}

fn bar<T>(x: T) {
    x += x; //~ ERROR binary assignment operation `+=` cannot be applied to type `T`
}

fn baz<T>(x: T) {
    let y = -x; //~ ERROR cannot apply unary operator `-` to type `T`
    let y = !x; //~ ERROR cannot apply unary operator `!` to type `T`
    let y = *x; //~ ERROR type `T` cannot be dereferenced
}