diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-06-19 16:24:21 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-06-19 19:12:02 +1000 |
| commit | 8170acb197d7658505949cefc12e01dfc4c8feab (patch) | |
| tree | cef1ddb5ba649b51982ff00ea043be2e4119cb97 /compiler/rustc_parse/src/parser/path.rs | |
| parent | 43eae4cef4f4e519641e0f0a3915b8023db92f00 (diff) | |
| download | rust-8170acb197d7658505949cefc12e01dfc4c8feab.tar.gz rust-8170acb197d7658505949cefc12e01dfc4c8feab.zip | |
Refactor `parse_expr_res`.
This removes the final `Option<AttrWrapper>` argument.
Diffstat (limited to 'compiler/rustc_parse/src/parser/path.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/path.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/path.rs b/compiler/rustc_parse/src/parser/path.rs index 9beecd9849f..da8d1194325 100644 --- a/compiler/rustc_parse/src/parser/path.rs +++ b/compiler/rustc_parse/src/parser/path.rs @@ -920,7 +920,8 @@ impl<'a> Parser<'a> { // Fall back by trying to parse a const-expr expression. If we successfully do so, // then we should report an error that it needs to be wrapped in braces. let snapshot = self.create_snapshot_for_diagnostic(); - match self.parse_expr_res(Restrictions::CONST_EXPR, None) { + let attrs = self.parse_outer_attributes()?; + match self.parse_expr_res(Restrictions::CONST_EXPR, attrs) { Ok(expr) => { return Ok(Some(self.dummy_const_arg_needs_braces( self.dcx().struct_span_err(expr.span, "invalid const generic expression"), |
