]> git.lizzy.rs Git - rust.git/blobdiff - src/test/ui/suggestions/as-ref.stderr
Implementation for 65853
[rust.git] / src / test / ui / suggestions / as-ref.stderr
index 8d93ac50796671182b44d57b07901d7448d80643..1efd1b317b7da25de6b895f0b7ee4a981734bc87 100644 (file)
@@ -2,33 +2,61 @@ error[E0308]: mismatched types
   --> $DIR/as-ref.rs:7:29
    |
 LL |     opt.map(|arg| takes_ref(arg));
-   |         ---                 ^^^ expected `&Foo`, found struct `Foo`
-   |         |
+   |         ---       --------- ^^^ 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:8:39
    |
 LL |     opt.and_then(|arg| Some(takes_ref(arg)));
-   |         --------                      ^^^ expected `&Foo`, found struct `Foo`
-   |         |
+   |         --------            --------- ^^^ 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:10:29
    |
 LL |     opt.map(|arg| takes_ref(arg));
-   |         ---                 ^^^ expected `&Foo`, found struct `Foo`
-   |         |
+   |         ---       --------- ^^^ 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:11:37
    |
 LL |     opt.and_then(|arg| Ok(takes_ref(arg)));
-   |         --------                    ^^^ expected `&Foo`, found struct `Foo`
-   |         |
+   |         --------          --------- ^^^ 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:13:29