summaryrefslogtreecommitdiffstats
path: root/tests/ui/suggestions/call-on-missing.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:18:58 +0000
commita4b7ed7a42c716ab9f05e351f003d589124fd55d (patch)
treeb620cd3f223850b28716e474e80c58059dca5dd4 /tests/ui/suggestions/call-on-missing.stderr
parentAdding upstream version 1.67.1+dfsg1. (diff)
downloadrustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz
rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/suggestions/call-on-missing.stderr')
-rw-r--r--tests/ui/suggestions/call-on-missing.stderr75
1 files changed, 75 insertions, 0 deletions
diff --git a/tests/ui/suggestions/call-on-missing.stderr b/tests/ui/suggestions/call-on-missing.stderr
new file mode 100644
index 000000000..ca9abc7e9
--- /dev/null
+++ b/tests/ui/suggestions/call-on-missing.stderr
@@ -0,0 +1,75 @@
+error[E0599]: no method named `bar` found for fn item `fn() -> Foo {foo}` in the current scope
+ --> $DIR/call-on-missing.rs:12:9
+ |
+LL | foo.bar();
+ | ^^^ method not found in `fn() -> Foo {foo}`
+ |
+help: use parentheses to call this function
+ |
+LL | foo().bar();
+ | ++
+
+error[E0609]: no field `i` on type `fn() -> Foo {foo}`
+ --> $DIR/call-on-missing.rs:16:9
+ |
+LL | foo.i;
+ | ^
+ |
+help: use parentheses to call this function
+ |
+LL | foo().i;
+ | ++
+
+error[E0599]: no method named `bar` found for struct `Box<dyn Fn() -> Foo>` in the current scope
+ --> $DIR/call-on-missing.rs:22:14
+ |
+LL | callable.bar();
+ | ^^^ method not found in `Box<dyn Fn() -> Foo>`
+ |
+help: use parentheses to call this trait object
+ |
+LL | callable().bar();
+ | ++
+
+error[E0609]: no field `i` on type `Box<dyn Fn() -> Foo>`
+ --> $DIR/call-on-missing.rs:26:14
+ |
+LL | callable.i;
+ | ^ unknown field
+ |
+help: use parentheses to call this trait object
+ |
+LL | callable().i;
+ | ++
+
+error[E0599]: no method named `bar` found for type parameter `T` in the current scope
+ --> $DIR/call-on-missing.rs:32:7
+ |
+LL | fn type_param<T: Fn() -> Foo>(t: T) {
+ | - method `bar` not found for this type parameter
+LL | t.bar();
+ | ^^^ method not found in `T`
+ |
+help: use parentheses to call this type parameter
+ |
+LL | t().bar();
+ | ++
+
+error[E0609]: no field `i` on type `T`
+ --> $DIR/call-on-missing.rs:36:7
+ |
+LL | fn type_param<T: Fn() -> Foo>(t: T) {
+ | - type parameter 'T' declared here
+...
+LL | t.i;
+ | ^
+ |
+help: use parentheses to call this type parameter
+ |
+LL | t().i;
+ | ++
+
+error: aborting due to 6 previous errors
+
+Some errors have detailed explanations: E0599, E0609.
+For more information about an error, try `rustc --explain E0599`.