rust/src/test/ui/suggestions/as-ref.stderr
Esteban Küber 99f2977031 Modify structured suggestion output
* On suggestions that include deletions, use a diff inspired output format
* When suggesting addition, use `+` as underline
* Color highlight modified span
2021-08-11 09:46:24 +00:00

75 lines
2.5 KiB
Plaintext

error[E0308]: mismatched types
--> $DIR/as-ref.rs:7:29
|
LL | opt.map(|arg| takes_ref(arg));
| --- ^^^ expected `&Foo`, found struct `Foo`
| |
| help: consider using `as_ref` instead: `as_ref().map`
error[E0308]: mismatched types
--> $DIR/as-ref.rs:8:39
|
LL | opt.and_then(|arg| Some(takes_ref(arg)));
| -------- ^^^ expected `&Foo`, found struct `Foo`
| |
| help: consider using `as_ref` instead: `as_ref().and_then`
error[E0308]: mismatched types
--> $DIR/as-ref.rs:10:29
|
LL | opt.map(|arg| takes_ref(arg));
| --- ^^^ expected `&Foo`, found struct `Foo`
| |
| help: consider using `as_ref` instead: `as_ref().map`
error[E0308]: mismatched types
--> $DIR/as-ref.rs:11:37
|
LL | opt.and_then(|arg| Ok(takes_ref(arg)));
| -------- ^^^ expected `&Foo`, found struct `Foo`
| |
| help: consider using `as_ref` instead: `as_ref().and_then`
error[E0308]: mismatched types
--> $DIR/as-ref.rs:13:29
|
LL | let y: Option<&usize> = x;
| -------------- ^
| | |
| | expected enum `Option`, found `&Option<usize>`
| | help: you can convert from `&Option<T>` to `Option<&T>` using `.as_ref()`: `x.as_ref()`
| expected due to this
|
= note: expected enum `Option<&usize>`
found reference `&Option<usize>`
error[E0308]: mismatched types
--> $DIR/as-ref.rs:15:37
|
LL | let y: Result<&usize, &usize> = x;
| ---------------------- ^ expected enum `Result`, found reference
| |
| expected due to this
|
= note: expected enum `Result<&usize, &usize>`
found reference `&Result<usize, usize>`
help: you can convert from `&Result<T, E>` to `Result<&T, &E>` using `.as_ref()`
|
LL | let y: Result<&usize, &usize> = x.as_ref();
| ~~~~~~~~~~
error[E0308]: mismatched types
--> $DIR/as-ref.rs:19:36
|
LL | let y: Result<&usize, usize> = x;
| --------------------- ^ expected enum `Result`, found reference
| |
| expected due to this
|
= note: expected enum `Result<&usize, usize>`
found reference `&Result<usize, usize>`
error: aborting due to 7 previous errors
For more information about this error, try `rustc --explain E0308`.