diff options
| author | bors <bors@rust-lang.org> | 2024-06-01 21:13:52 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-01 21:13:52 +0000 |
| commit | f67a1acc04c7ecbf05751b17592dd8d245b75256 (patch) | |
| tree | 0b69f6fa1cf7ba0bd7bdd7ada9d8c1b4b8647fa6 /compiler/rustc_parse/src | |
| parent | 0038c021031ce9f1ec2329469c8d85d0e681ef8f (diff) | |
| parent | 89386092f19eaf4ba7a4a76fbb666e537575160a (diff) | |
| download | rust-f67a1acc04c7ecbf05751b17592dd8d245b75256.tar.gz rust-f67a1acc04c7ecbf05751b17592dd8d245b75256.zip | |
Auto merge of #125863 - fmease:rej-CVarArgs-in-parse_ty_for_where_clause, r=compiler-errors
Reject `CVarArgs` in `parse_ty_for_where_clause` Fixes #125847. This regressed in #77035 where the `parse_ty` inside `parse_ty_where_predicate` was replaced with the at the time new `parse_ty_for_where_clause` which incorrectly stated it would permit CVarArgs (maybe a copy/paste error). r? parser
Diffstat (limited to 'compiler/rustc_parse/src')
| -rw-r--r-- | compiler/rustc_parse/src/parser/ty.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs index 2df8f58507b..2033f387887 100644 --- a/compiler/rustc_parse/src/parser/ty.rs +++ b/compiler/rustc_parse/src/parser/ty.rs @@ -194,7 +194,7 @@ impl<'a> Parser<'a> { pub(super) fn parse_ty_for_where_clause(&mut self) -> PResult<'a, P<Ty>> { self.parse_ty_common( AllowPlus::Yes, - AllowCVariadic::Yes, + AllowCVariadic::No, RecoverQPath::Yes, RecoverReturnSign::OnlyFatArrow, None, @@ -344,8 +344,9 @@ impl<'a> Parser<'a> { match allow_c_variadic { AllowCVariadic::Yes => TyKind::CVarArgs, AllowCVariadic::No => { - // FIXME(Centril): Should we just allow `...` syntactically + // FIXME(c_variadic): Should we just allow `...` syntactically // anywhere in a type and use semantic restrictions instead? + // NOTE: This may regress certain MBE calls if done incorrectly. let guar = self .dcx() .emit_err(NestedCVariadicType { span: lo.to(self.prev_token.span) }); |
