summaryrefslogtreecommitdiffstats
path: root/tests/ui/typeck/issue-89856.stderr
blob: 5fa1ae1a54f722591a341779584652c702b3aef2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
error[E0308]: mismatched types
  --> $DIR/issue-89856.rs:6:20
   |
LL |     take_str_maybe(option);
   |     -------------- ^^^^^^ expected `str`, found struct `String`
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected enum `Option<&str>`
              found enum `Option<&String>`
note: function defined here
  --> $DIR/issue-89856.rs:1:4
   |
LL | fn take_str_maybe(x: Option<&str>) -> Option<&str> { None }
   |    ^^^^^^^^^^^^^^ ---------------
help: try converting the passed type into a `&str`
   |
LL |     take_str_maybe(option.map(|x| &**x));
   |                          ++++++++++++++

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.