summaryrefslogtreecommitdiffstats
path: root/src/test/ui/suggestions/as-ref.stderr
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/suggestions/as-ref.stderr62
1 files changed, 61 insertions, 1 deletions
diff --git a/src/test/ui/suggestions/as-ref.stderr b/src/test/ui/suggestions/as-ref.stderr
index 1efd1b317..deafa9f48 100644
--- a/src/test/ui/suggestions/as-ref.stderr
+++ b/src/test/ui/suggestions/as-ref.stderr
@@ -97,6 +97,66 @@ LL | let y: Result<&usize, usize> = x;
= note: expected enum `Result<&usize, usize>`
found reference `&Result<usize, usize>`
-error: aborting due to 7 previous errors
+error[E0308]: mismatched types
+ --> $DIR/as-ref.rs:22:42
+ |
+LL | multiple_ref_opt.map(|arg| takes_ref(arg));
+ | --- --------- ^^^ expected `&Foo`, found struct `Foo`
+ | | |
+ | | arguments to this function are incorrect
+ | help: consider using `as_ref` instead: `as_ref().map`
+ |
+note: function defined here
+ --> $DIR/as-ref.rs:3:4
+ |
+LL | fn takes_ref(_: &Foo) {}
+ | ^^^^^^^^^ -------
+
+error[E0308]: mismatched types
+ --> $DIR/as-ref.rs:23:52
+ |
+LL | multiple_ref_opt.and_then(|arg| Some(takes_ref(arg)));
+ | -------- --------- ^^^ expected `&Foo`, found struct `Foo`
+ | | |
+ | | arguments to this function are incorrect
+ | help: consider using `as_ref` instead: `as_ref().and_then`
+ |
+note: function defined here
+ --> $DIR/as-ref.rs:3:4
+ |
+LL | fn takes_ref(_: &Foo) {}
+ | ^^^^^^^^^ -------
+
+error[E0308]: mismatched types
+ --> $DIR/as-ref.rs:25:45
+ |
+LL | multiple_ref_result.map(|arg| takes_ref(arg));
+ | --- --------- ^^^ expected `&Foo`, found struct `Foo`
+ | | |
+ | | arguments to this function are incorrect
+ | help: consider using `as_ref` instead: `as_ref().map`
+ |
+note: function defined here
+ --> $DIR/as-ref.rs:3:4
+ |
+LL | fn takes_ref(_: &Foo) {}
+ | ^^^^^^^^^ -------
+
+error[E0308]: mismatched types
+ --> $DIR/as-ref.rs:26:53
+ |
+LL | multiple_ref_result.and_then(|arg| Ok(takes_ref(arg)));
+ | -------- --------- ^^^ expected `&Foo`, found struct `Foo`
+ | | |
+ | | arguments to this function are incorrect
+ | help: consider using `as_ref` instead: `as_ref().and_then`
+ |
+note: function defined here
+ --> $DIR/as-ref.rs:3:4
+ |
+LL | fn takes_ref(_: &Foo) {}
+ | ^^^^^^^^^ -------
+
+error: aborting due to 11 previous errors
For more information about this error, try `rustc --explain E0308`.