mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-19 11:12:43 +00:00
Allow empty tuple pattern
This commit is contained in:
parent
0ee76bec0f
commit
02d82f926e
@ -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);
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user