summaryrefslogtreecommitdiffstats
path: root/src/test/ui/ufcs/ufcs-qpath-self-mismatch.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/ufcs/ufcs-qpath-self-mismatch.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/ufcs/ufcs-qpath-self-mismatch.stderr')
-rw-r--r--src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
new file mode 100644
index 000000000..c6f9b3661
--- /dev/null
+++ b/src/test/ui/ufcs/ufcs-qpath-self-mismatch.stderr
@@ -0,0 +1,58 @@
+error[E0277]: cannot add `u32` to `i32`
+ --> $DIR/ufcs-qpath-self-mismatch.rs:4:5
+ |
+LL | <i32 as Add<u32>>::add(1, 2);
+ | ^^^^^^^^^^^^^^^^^^^^^^ no implementation for `i32 + u32`
+ |
+ = help: the trait `Add<u32>` is not implemented for `i32`
+ = help: the following other types implement trait `Add<Rhs>`:
+ <&'a f32 as Add<f32>>
+ <&'a f64 as Add<f64>>
+ <&'a i128 as Add<i128>>
+ <&'a i16 as Add<i16>>
+ <&'a i32 as Add<i32>>
+ <&'a i64 as Add<i64>>
+ <&'a i8 as Add<i8>>
+ <&'a isize as Add<isize>>
+ and 48 others
+
+error[E0308]: mismatched types
+ --> $DIR/ufcs-qpath-self-mismatch.rs:6:28
+ |
+LL | <i32 as Add<i32>>::add(1u32, 2);
+ | ---------------------- ^^^^ expected `i32`, found `u32`
+ | |
+ | arguments to this function are incorrect
+ |
+note: associated function defined here
+ --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ |
+LL | fn add(self, rhs: Rhs) -> Self::Output;
+ | ^^^
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | <i32 as Add<i32>>::add(1i32, 2);
+ | ~~~
+
+error[E0308]: mismatched types
+ --> $DIR/ufcs-qpath-self-mismatch.rs:8:31
+ |
+LL | <i32 as Add<i32>>::add(1, 2u32);
+ | ---------------------- ^^^^ expected `i32`, found `u32`
+ | |
+ | arguments to this function are incorrect
+ |
+note: associated function defined here
+ --> $SRC_DIR/core/src/ops/arith.rs:LL:COL
+ |
+LL | fn add(self, rhs: Rhs) -> Self::Output;
+ | ^^^
+help: change the type of the numeric literal from `u32` to `i32`
+ |
+LL | <i32 as Add<i32>>::add(1, 2i32);
+ | ~~~
+
+error: aborting due to 3 previous errors
+
+Some errors have detailed explanations: E0277, E0308.
+For more information about an error, try `rustc --explain E0277`.