]> git.lizzy.rs Git - rust.git/blob - tests/ui/type/type-check/missing_trait_impl.stderr
Make `output_filenames` a real query
[rust.git] / tests / ui / type / type-check / missing_trait_impl.stderr
1 error[E0369]: cannot add `T` to `T`
2   --> $DIR/missing_trait_impl.rs:5:15
3    |
4 LL |     let z = x + y;
5    |             - ^ - T
6    |             |
7    |             T
8    |
9 help: consider restricting type parameter `T`
10    |
11 LL | fn foo<T: std::ops::Add>(x: T, y: T) {
12    |         +++++++++++++++
13
14 error[E0368]: binary assignment operation `+=` cannot be applied to type `T`
15   --> $DIR/missing_trait_impl.rs:9:5
16    |
17 LL |     x += x;
18    |     -^^^^^
19    |     |
20    |     cannot use `+=` on type `T`
21    |
22 help: consider restricting type parameter `T`
23    |
24 LL | fn bar<T: std::ops::AddAssign>(x: T) {
25    |         +++++++++++++++++++++
26
27 error[E0600]: cannot apply unary operator `-` to type `T`
28   --> $DIR/missing_trait_impl.rs:13:13
29    |
30 LL |     let y = -x;
31    |             ^^ cannot apply unary operator `-`
32    |
33 help: consider restricting type parameter `T`
34    |
35 LL | fn baz<T: std::ops::Neg>(x: T) {
36    |         +++++++++++++++
37
38 error[E0600]: cannot apply unary operator `!` to type `T`
39   --> $DIR/missing_trait_impl.rs:14:13
40    |
41 LL |     let y = !x;
42    |             ^^ cannot apply unary operator `!`
43    |
44 help: consider restricting type parameter `T`
45    |
46 LL | fn baz<T: std::ops::Not>(x: T) {
47    |         +++++++++++++++
48
49 error[E0614]: type `T` cannot be dereferenced
50   --> $DIR/missing_trait_impl.rs:15:13
51    |
52 LL |     let y = *x;
53    |             ^^
54
55 error: aborting due to 5 previous errors
56
57 Some errors have detailed explanations: E0368, E0369, E0600, E0614.
58 For more information about an error, try `rustc --explain E0368`.