4 //~^ ERROR mismatched types
6 fn b(opt_str: Option<String>) {
7 let s: String = if let Some(s) = opt_str {
8 //~^ ERROR mismatched types
14 fn c() -> Option<i32> {
15 //~^ ERROR mismatched types
19 fn d(opt_str: Option<String>) {
20 let s: String = if let Some(s) = opt_str {
21 //~^ ERROR mismatched types
27 fn d2(opt_str: Option<String>) {
28 let s = if let Some(s) = opt_str {
31 //~^ ERROR `if` and `else` have incompatible types
35 fn e(opt_str: Option<String>) {
36 let s: String = match opt_str {
38 //~^ ERROR mismatched types
39 None => String::new(),
43 fn e2(opt_str: Option<String>) {
44 let s = match opt_str {
46 None => String::new(),
47 //~^ ERROR `match` arms have incompatible types