summaryrefslogtreecommitdiffstats
path: root/src/test/ui/ufcs/ufcs-explicit-self-bad.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-explicit-self-bad.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-explicit-self-bad.stderr')
-rw-r--r--src/test/ui/ufcs/ufcs-explicit-self-bad.stderr107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/test/ui/ufcs/ufcs-explicit-self-bad.stderr b/src/test/ui/ufcs/ufcs-explicit-self-bad.stderr
new file mode 100644
index 000000000..f325d1d81
--- /dev/null
+++ b/src/test/ui/ufcs/ufcs-explicit-self-bad.stderr
@@ -0,0 +1,107 @@
+error[E0307]: invalid `self` parameter type: isize
+ --> $DIR/ufcs-explicit-self-bad.rs:8:18
+ |
+LL | fn foo(self: isize, x: isize) -> isize {
+ | ^^^^^
+ |
+ = note: type of `self` must be `Self` or a type that dereferences to it
+ = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
+
+error[E0307]: invalid `self` parameter type: Bar<isize>
+ --> $DIR/ufcs-explicit-self-bad.rs:19:18
+ |
+LL | fn foo(self: Bar<isize>, x: isize) -> isize {
+ | ^^^^^^^^^^
+ |
+ = note: type of `self` must be `Self` or a type that dereferences to it
+ = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
+
+error[E0307]: invalid `self` parameter type: &Bar<usize>
+ --> $DIR/ufcs-explicit-self-bad.rs:23:18
+ |
+LL | fn bar(self: &Bar<usize>, x: isize) -> isize {
+ | ^^^^^^^^^^^
+ |
+ = note: type of `self` must be `Self` or a type that dereferences to it
+ = help: consider changing to `self`, `&self`, `&mut self`, `self: Box<Self>`, `self: Rc<Self>`, `self: Arc<Self>`, or `self: Pin<P>` (where P is one of the previous types except `Self`)
+
+error[E0308]: mismatched `self` parameter type
+ --> $DIR/ufcs-explicit-self-bad.rs:37:21
+ |
+LL | fn dummy2(self: &Bar<T>) {}
+ | ^^^^^^^ lifetime mismatch
+ |
+ = note: expected reference `&'a Bar<T>`
+ found reference `&Bar<T>`
+note: the anonymous lifetime defined here...
+ --> $DIR/ufcs-explicit-self-bad.rs:37:21
+ |
+LL | fn dummy2(self: &Bar<T>) {}
+ | ^^^^^^^
+note: ...does not necessarily outlive the lifetime `'a` as defined here
+ --> $DIR/ufcs-explicit-self-bad.rs:35:6
+ |
+LL | impl<'a, T> SomeTrait for &'a Bar<T> {
+ | ^^
+
+error[E0308]: mismatched `self` parameter type
+ --> $DIR/ufcs-explicit-self-bad.rs:37:21
+ |
+LL | fn dummy2(self: &Bar<T>) {}
+ | ^^^^^^^ lifetime mismatch
+ |
+ = note: expected reference `&'a Bar<T>`
+ found reference `&Bar<T>`
+note: the lifetime `'a` as defined here...
+ --> $DIR/ufcs-explicit-self-bad.rs:35:6
+ |
+LL | impl<'a, T> SomeTrait for &'a Bar<T> {
+ | ^^
+note: ...does not necessarily outlive the anonymous lifetime defined here
+ --> $DIR/ufcs-explicit-self-bad.rs:37:21
+ |
+LL | fn dummy2(self: &Bar<T>) {}
+ | ^^^^^^^
+
+error[E0308]: mismatched `self` parameter type
+ --> $DIR/ufcs-explicit-self-bad.rs:39:21
+ |
+LL | fn dummy3(self: &&Bar<T>) {}
+ | ^^^^^^^^ lifetime mismatch
+ |
+ = note: expected reference `&'a Bar<T>`
+ found reference `&Bar<T>`
+note: the anonymous lifetime defined here...
+ --> $DIR/ufcs-explicit-self-bad.rs:39:22
+ |
+LL | fn dummy3(self: &&Bar<T>) {}
+ | ^^^^^^^
+note: ...does not necessarily outlive the lifetime `'a` as defined here
+ --> $DIR/ufcs-explicit-self-bad.rs:35:6
+ |
+LL | impl<'a, T> SomeTrait for &'a Bar<T> {
+ | ^^
+
+error[E0308]: mismatched `self` parameter type
+ --> $DIR/ufcs-explicit-self-bad.rs:39:21
+ |
+LL | fn dummy3(self: &&Bar<T>) {}
+ | ^^^^^^^^ lifetime mismatch
+ |
+ = note: expected reference `&'a Bar<T>`
+ found reference `&Bar<T>`
+note: the lifetime `'a` as defined here...
+ --> $DIR/ufcs-explicit-self-bad.rs:35:6
+ |
+LL | impl<'a, T> SomeTrait for &'a Bar<T> {
+ | ^^
+note: ...does not necessarily outlive the anonymous lifetime defined here
+ --> $DIR/ufcs-explicit-self-bad.rs:39:22
+ |
+LL | fn dummy3(self: &&Bar<T>) {}
+ | ^^^^^^^
+
+error: aborting due to 7 previous errors
+
+Some errors have detailed explanations: E0307, E0308.
+For more information about an error, try `rustc --explain E0307`.