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`.