summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
commit018c4950b9406055dec02ef0fb52f132e2bb1e2c (patch)
treea835ebdf2088ef88fa681f8fad45f09922c1ae9a /tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.stderr
parentAdding debian version 1.75.0+dfsg1-5. (diff)
downloadrustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.tar.xz
rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.stderr')
-rw-r--r--tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.stderr79
1 files changed, 79 insertions, 0 deletions
diff --git a/tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.stderr b/tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.stderr
new file mode 100644
index 000000000..793595784
--- /dev/null
+++ b/tests/ui/suggestions/suggest-assoc-fn-call-without-receiver.stderr
@@ -0,0 +1,79 @@
+error[E0599]: no method named `hello` found for struct `A` in the current scope
+ --> $DIR/suggest-assoc-fn-call-without-receiver.rs:20:8
+ |
+LL | struct A {}
+ | -------- method `hello` not found for this struct
+...
+LL | _a.hello(1);
+ | ---^^^^^---
+ | | |
+ | | this is an associated function, not a method
+ | help: use associated function syntax instead: `A::hello(1)`
+ |
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
+note: the candidate is defined in an impl for the type `A`
+ --> $DIR/suggest-assoc-fn-call-without-receiver.rs:6:5
+ |
+LL | fn hello(_a: i32) {}
+ | ^^^^^^^^^^^^^^^^^
+
+error[E0599]: no method named `test` found for struct `A` in the current scope
+ --> $DIR/suggest-assoc-fn-call-without-receiver.rs:22:8
+ |
+LL | struct A {}
+ | -------- method `test` not found for this struct
+...
+LL | _a.test(1);
+ | ---^^^^---
+ | | |
+ | | this is an associated function, not a method
+ | help: use associated function syntax instead: `A::test(_a, 1)`
+ |
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
+note: the candidate is defined in an impl for the type `A`
+ --> $DIR/suggest-assoc-fn-call-without-receiver.rs:7:5
+ |
+LL | fn test(_a: Self, _b: i32) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0599]: no method named `hello` found for struct `B<&str>` in the current scope
+ --> $DIR/suggest-assoc-fn-call-without-receiver.rs:26:8
+ |
+LL | struct B<T> {
+ | ----------- method `hello` not found for this struct
+...
+LL | _b.hello(1);
+ | ---^^^^^---
+ | | |
+ | | this is an associated function, not a method
+ | help: use associated function syntax instead: `B::<&str>::hello(1)`
+ |
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
+note: the candidate is defined in an impl for the type `B<T>`
+ --> $DIR/suggest-assoc-fn-call-without-receiver.rs:14:5
+ |
+LL | fn hello(_a: i32) {}
+ | ^^^^^^^^^^^^^^^^^
+
+error[E0599]: no method named `test` found for struct `B<&str>` in the current scope
+ --> $DIR/suggest-assoc-fn-call-without-receiver.rs:28:8
+ |
+LL | struct B<T> {
+ | ----------- method `test` not found for this struct
+...
+LL | _b.test(1);
+ | ---^^^^---
+ | | |
+ | | this is an associated function, not a method
+ | help: use associated function syntax instead: `B::<&str>::test(_b, 1)`
+ |
+ = note: found the following associated functions; to be used as methods, functions must have a `self` parameter
+note: the candidate is defined in an impl for the type `B<T>`
+ --> $DIR/suggest-assoc-fn-call-without-receiver.rs:15:5
+ |
+LL | fn test(_a: Self, _b: i32) {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 4 previous errors
+
+For more information about this error, try `rustc --explain E0599`.