about summary refs log tree commit diff
path: root/src/librustc_parse/parser
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-01-03 17:56:30 +0900
committerGitHub <noreply@github.com>2020-01-03 17:56:30 +0900
commitb0649c0c5f11a2b902fdeda145e4f86015f5844a (patch)
treefc6f2846eae521f14dd3c69bc7c8c46762804257 /src/librustc_parse/parser
parent09c7a9beb2e199320697e576f1836909990c01b6 (diff)
parentdd8f07223346b06da723c25a3ac42f874e6c945c (diff)
downloadrust-b0649c0c5f11a2b902fdeda145e4f86015f5844a.tar.gz
rust-b0649c0c5f11a2b902fdeda145e4f86015f5844a.zip
Rollup merge of #67807 - lzutao:toilet-closure, r=Centril
Use drop instead of the toilet closure `|_| ()`
Diffstat (limited to 'src/librustc_parse/parser')
-rw-r--r--src/librustc_parse/parser/diagnostics.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_parse/parser/diagnostics.rs b/src/librustc_parse/parser/diagnostics.rs
index bf03f731c9f..94785e9eff3 100644
--- a/src/librustc_parse/parser/diagnostics.rs
+++ b/src/librustc_parse/parser/diagnostics.rs
@@ -848,7 +848,7 @@ impl<'a> Parser<'a> {
         let appl = Applicability::MachineApplicable;
         if self.token.span == DUMMY_SP || self.prev_span == DUMMY_SP {
             // Likely inside a macro, can't provide meaninful suggestions.
-            return self.expect(&token::Semi).map(|_| ());
+            return self.expect(&token::Semi).map(drop);
         } else if !sm.is_multiline(self.prev_span.until(self.token.span)) {
             // The current token is in the same line as the prior token, not recoverable.
         } else if self.look_ahead(1, |t| {
@@ -887,7 +887,7 @@ impl<'a> Parser<'a> {
                 .emit();
             return Ok(());
         }
-        self.expect(&token::Semi).map(|_| ()) // Error unconditionally
+        self.expect(&token::Semi).map(drop) // Error unconditionally
     }
 
     pub(super) fn parse_semi_or_incorrect_foreign_fn_body(