fcx.infcx().type_error_message_str_with_expected(pat.span,
|expected, actual| {
expected.map_or("".to_string(), |e| {
- format_strbuf!("mismatched types: expected `{}` but \
- found {}",
- e,
- actual)
+ format!("mismatched types: expected `{}` but found {}",
+ e, actual)
})},
Some(expected),
"a structure pattern".to_string(),
|expected, actual| {
expected.map_or("".to_string(),
|e| {
- format_strbuf!("mismatched types: expected `{}` but \
- found {}",
- e,
- actual)
+ format!("mismatched types: expected `{}` but found {}",
+ e, actual)
})
},
Some(expected),
|expected, actual| {
expected.map_or("".to_string(),
|e| {
- format_strbuf!("mismatched types: expected \
- `{}` but found {}",
- e,
- actual)
+ format!("mismatched types: expected \
+ `{}` but found {}", e, actual)
})},
Some(expected),
"a structure pattern".to_string(),
|expected,
actual| {
expected.map_or("".to_string(), |e| {
- format_strbuf!("mismatched types: expected `{}` \
- but found {}",
- e,
- actual)
+ format!("mismatched types: expected `{}` \
+ but found {}", e, actual)
}
)},
Some(expected),
|expected, actual| {
expected.map_or("".to_string(),
|e| {
- format_strbuf!("mismatched types: expected `{}` but \
- found {}",
- e,
- actual)
+ format!("mismatched types: expected `{}` but found {}",
+ e, actual)
})
},
Some(expected),
span,
|expected, actual| {
expected.map_or("".to_string(), |e| {
- format_strbuf!("mismatched types: expected `{}` but \
- found {}",
- e,
- actual)
+ format!("mismatched types: expected `{}` but found {}",
+ e, actual)
})
},
Some(expected),
- format_strbuf!("{} pattern", match pointer_kind {
+ format!("{} pattern", match pointer_kind {
Send => "a box",
Borrowed => "an `&`-pointer",
}),