diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2019-08-10 13:29:39 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2019-09-28 17:38:59 +0300 |
| commit | 8a9d775888f6d413c10a823751bc14794a5a0c6d (patch) | |
| tree | 22c919937881b42270b9efaa872877c3f35ecd1b /src/libsyntax/parse/parser.rs | |
| parent | f3c8eba643a815d720e7f20699b3dca144c845c4 (diff) | |
| download | rust-8a9d775888f6d413c10a823751bc14794a5a0c6d.tar.gz rust-8a9d775888f6d413c10a823751bc14794a5a0c6d.zip | |
syntax: don't keep a redundant c_variadic flag in the AST.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index cc582819b6b..f22fd5ad703 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -1194,7 +1194,7 @@ impl<'a> Parser<'a> { } fn parse_fn_params(&mut self, named_params: bool, allow_c_variadic: bool) - -> PResult<'a, (Vec<Param> , bool)> { + -> PResult<'a, Vec<Param>> { let sp = self.token.span; let mut c_variadic = false; let (params, _): (Vec<Option<Param>>, _) = self.parse_paren_comma_seq(|p| { @@ -1218,6 +1218,8 @@ impl<'a> Parser<'a> { let span = p.token.span; p.span_err(span, "`...` must be the last argument of a C-variadic function"); + // FIXME(eddyb) this should probably still push `CVarArgs`. + // Maybe AST validation/HIR lowering should emit the above error? Ok(None) } else { Ok(Some(param)) @@ -1245,7 +1247,7 @@ impl<'a> Parser<'a> { "C-variadic function must be declared with at least one named argument"); } - Ok((params, c_variadic)) + Ok(params) } /// Returns the parsed optional self parameter and whether a self shortcut was used. @@ -1414,7 +1416,6 @@ impl<'a> Parser<'a> { Ok(P(FnDecl { inputs: fn_inputs, output: self.parse_ret_ty(true)?, - c_variadic: false })) } |
