about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-07-28 20:22:42 +0000
committerbors <bors@rust-lang.org>2019-07-28 20:22:42 +0000
commitc7312fe4ff85ada30103cea58db25d83e0bec4b0 (patch)
treec45aed285c4e04591ea7d6e8bc6c90b3461671a6 /src/libsyntax/parse/parser.rs
parent4560cb830fce63fcffdc4558f4281aaac6a3a1ba (diff)
parent29c377882f545e24b9cc6e1198ee4f72c20d5449 (diff)
downloadrust-c7312fe4ff85ada30103cea58db25d83e0bec4b0.tar.gz
rust-c7312fe4ff85ada30103cea58db25d83e0bec4b0.zip
Auto merge of #63090 - Centril:rollup-xnjwm2h, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #61856 (Lint attributes on function arguments)
 - #62360 (Document that ManuallyDrop::drop should not called more than once)
 - #62392 (Update minifier-rs version)
 - #62871 (Explicit error message for async recursion.)
 - #62995 (Avoid ICE when suggestion span is at Eof)
 - #63053 (SystemTime docs: recommend Instant for elapsed time)
 - #63081 (tidy: Cleanup the directory whitelist)
 - #63088 (Remove anonymous_parameters from unrelated test)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 8f8ed411180..6cb965bf817 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -1515,6 +1515,7 @@ impl<'a> Parser<'a> {
     where
         F: Fn(&token::Token) -> bool
     {
+        let lo = self.token.span;
         let attrs = self.parse_arg_attributes()?;
         if let Some(mut arg) = self.parse_self_arg()? {
             arg.attrs = attrs.into();
@@ -1578,11 +1579,14 @@ impl<'a> Parser<'a> {
             }
         };
 
-        Ok(Arg { attrs: attrs.into(), id: ast::DUMMY_NODE_ID, pat, ty })
+        let span = lo.to(self.token.span);
+
+        Ok(Arg { attrs: attrs.into(), id: ast::DUMMY_NODE_ID, pat, span, ty })
     }
 
     /// Parses an argument in a lambda header (e.g., `|arg, arg|`).
     fn parse_fn_block_arg(&mut self) -> PResult<'a, Arg> {
+        let lo = self.token.span;
         let attrs = self.parse_arg_attributes()?;
         let pat = self.parse_pat(Some("argument name"))?;
         let t = if self.eat(&token::Colon) {
@@ -1594,10 +1598,12 @@ impl<'a> Parser<'a> {
                 span: self.prev_span,
             })
         };
+        let span = lo.to(self.token.span);
         Ok(Arg {
             attrs: attrs.into(),
             ty: t,
             pat,
+            span,
             id: ast::DUMMY_NODE_ID
         })
     }