]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type/type-check/missing_trait_impl.rs
New upstream version 1.61.0+dfsg1
[rustc.git] / src / test / ui / type / type-check / missing_trait_impl.rs
CommitLineData
ff7c6d11 1fn main() {
ea8adc8c 2}
85aaf69f 3
ff7c6d11 4fn foo<T>(x: T, y: T) {
dfeec247 5 let z = x + y; //~ ERROR cannot add `T` to `T`
ea8adc8c 6}
94b46f34
XL
7
8fn bar<T>(x: T) {
9 x += x; //~ ERROR binary assignment operation `+=` cannot be applied to type `T`
10}
ee023bcb
FG
11
12fn 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}