]> git.lizzy.rs Git - rust.git/blob - tests/ui/typeck/issue-89856.stderr
Rollup merge of #107355 - JohnTitor:issue-60755, r=compiler-errors
[rust.git] / tests / ui / typeck / issue-89856.stderr
1 error[E0308]: mismatched types
2   --> $DIR/issue-89856.rs:6:20
3    |
4 LL |     take_str_maybe(option);
5    |     -------------- ^^^^^^ expected `str`, found struct `String`
6    |     |
7    |     arguments to this function are incorrect
8    |
9    = note: expected enum `Option<&str>`
10               found enum `Option<&String>`
11 note: function defined here
12   --> $DIR/issue-89856.rs:1:4
13    |
14 LL | fn take_str_maybe(x: Option<&str>) -> Option<&str> { None }
15    |    ^^^^^^^^^^^^^^ ---------------
16 help: try converting the passed type into a `&str`
17    |
18 LL |     take_str_maybe(option.map(|x| &**x));
19    |                          ++++++++++++++
20
21 error: aborting due to previous error
22
23 For more information about this error, try `rustc --explain E0308`.