mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-15 20:45:45 +03:00
Merge pull request #1875 from topecongiro/empty-tuple-pattern
Allow empty tuple pattern
This commit is contained in:
+1
-1
@@ -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 @@ fn mutate_fragment(&mut self, fragment: &mut Fragment) {
|
||||
fn issue_1319() {
|
||||
if let (Event { .. }, .. ) = ev_state {}
|
||||
}
|
||||
|
||||
fn issue_1874() {
|
||||
if let Some(()) = x {
|
||||
y
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,3 +57,9 @@ fn mutate_fragment(&mut self, fragment: &mut Fragment) {
|
||||
fn issue_1319() {
|
||||
if let (Event { .. }, ..) = ev_state {}
|
||||
}
|
||||
|
||||
fn issue_1874() {
|
||||
if let Some(()) = x {
|
||||
y
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user