Allow empty tuple pattern

This commit is contained in:
topecongiro 2017-08-12 15:59:35 +09:00
parent 0ee76bec0f
commit 02d82f926e
3 changed files with 13 additions and 1 deletions

View File

@ -288,7 +288,7 @@ fn rewrite_tuple_pat(
}
if pat_vec.is_empty() {
return Some(format!("{}()", try_opt!(path_str)));
return Some(format!("{}()", path_str.unwrap_or(String::new())));
}
let wildcard_suffix_len = count_wildcard_suffix_len(context, &pat_vec, span, shape);

View File

@ -42,3 +42,9 @@ impl<'a,'b> ResolveGeneratedContentFragmentMutator<'a,'b> {
fn issue_1319() {
if let (Event { .. }, .. ) = ev_state {}
}
fn issue_1874() {
if let Some(()) = x {
y
}
}

View File

@ -57,3 +57,9 @@ impl<'a, 'b> ResolveGeneratedContentFragmentMutator<'a, 'b> {
fn issue_1319() {
if let (Event { .. }, ..) = ev_state {}
}
fn issue_1874() {
if let Some(()) = x {
y
}
}