about summary refs log tree commit diff
path: root/tests/ui/tuple/missing-field-access.stderr
diff options
context:
space:
mode:
Diffstat (limited to 'tests/ui/tuple/missing-field-access.stderr')
-rw-r--r--tests/ui/tuple/missing-field-access.stderr38
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/ui/tuple/missing-field-access.stderr b/tests/ui/tuple/missing-field-access.stderr
new file mode 100644
index 00000000000..711a8906d62
--- /dev/null
+++ b/tests/ui/tuple/missing-field-access.stderr
@@ -0,0 +1,38 @@
+error[E0599]: no method named `get_ref` found for struct `F` in the current scope
+  --> $DIR/missing-field-access.rs:7:15
+   |
+LL | struct F(BufReader<File>);
+   | -------- method `get_ref` not found for this struct
+...
+LL |     let x = f.get_ref();
+   |               ^^^^^^^ method not found in `F`
+   |
+help: one of the expressions' fields has a method of the same name
+   |
+LL |     let x = f.0.get_ref();
+   |               ++
+help: consider pinning the expression
+   |
+LL ~     let mut pinned = std::pin::pin!(f);
+LL ~     let x = pinned.as_ref().get_ref();
+   |
+
+error[E0599]: no method named `get_ref` found for tuple `(BufReader<File>,)` in the current scope
+  --> $DIR/missing-field-access.rs:11:15
+   |
+LL |     let x = f.get_ref();
+   |               ^^^^^^^ method not found in `(BufReader<File>,)`
+   |
+help: one of the expressions' fields has a method of the same name
+   |
+LL |     let x = f.0.get_ref();
+   |               ++
+help: consider pinning the expression
+   |
+LL ~     let mut pinned = std::pin::pin!(f);
+LL ~     let x = pinned.as_ref().get_ref();
+   |
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0599`.