summaryrefslogtreecommitdiffstats
path: root/src/test/ui/type/type-check/missing_trait_impl.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/type/type-check/missing_trait_impl.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/type/type-check/missing_trait_impl.stderr')
-rw-r--r--src/test/ui/type/type-check/missing_trait_impl.stderr58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/test/ui/type/type-check/missing_trait_impl.stderr b/src/test/ui/type/type-check/missing_trait_impl.stderr
new file mode 100644
index 000000000..2b58cd418
--- /dev/null
+++ b/src/test/ui/type/type-check/missing_trait_impl.stderr
@@ -0,0 +1,58 @@
+error[E0369]: cannot add `T` to `T`
+ --> $DIR/missing_trait_impl.rs:5:15
+ |
+LL | let z = x + y;
+ | - ^ - T
+ | |
+ | T
+ |
+help: consider restricting type parameter `T`
+ |
+LL | fn foo<T: std::ops::Add>(x: T, y: T) {
+ | +++++++++++++++
+
+error[E0368]: binary assignment operation `+=` cannot be applied to type `T`
+ --> $DIR/missing_trait_impl.rs:9:5
+ |
+LL | x += x;
+ | -^^^^^
+ | |
+ | cannot use `+=` on type `T`
+ |
+help: consider restricting type parameter `T`
+ |
+LL | fn bar<T: std::ops::AddAssign>(x: T) {
+ | +++++++++++++++++++++
+
+error[E0600]: cannot apply unary operator `-` to type `T`
+ --> $DIR/missing_trait_impl.rs:13:13
+ |
+LL | let y = -x;
+ | ^^ cannot apply unary operator `-`
+ |
+help: consider restricting type parameter `T`
+ |
+LL | fn baz<T: std::ops::Neg>(x: T) {
+ | +++++++++++++++
+
+error[E0600]: cannot apply unary operator `!` to type `T`
+ --> $DIR/missing_trait_impl.rs:14:13
+ |
+LL | let y = !x;
+ | ^^ cannot apply unary operator `!`
+ |
+help: consider restricting type parameter `T`
+ |
+LL | fn baz<T: std::ops::Not>(x: T) {
+ | +++++++++++++++
+
+error[E0614]: type `T` cannot be dereferenced
+ --> $DIR/missing_trait_impl.rs:15:13
+ |
+LL | let y = *x;
+ | ^^
+
+error: aborting due to 5 previous errors
+
+Some errors have detailed explanations: E0368, E0369, E0600, E0614.
+For more information about an error, try `rustc --explain E0368`.