diff options
| author | bors <bors@rust-lang.org> | 2022-08-15 18:27:37 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-08-15 18:27:37 +0000 |
| commit | 40336865fe7d4a01139a3336639c6971647e885c (patch) | |
| tree | c4a707523bfd7a0b4c4cc5f9da41862e2a885975 /compiler/rustc_parse/src/parser/mod.rs | |
| parent | 9b4ea391a132ec5f5de40079597ab7ff2fd691ad (diff) | |
| parent | e65de39763cc516a92c768c5644d7f86e973fb24 (diff) | |
| download | rust-40336865fe7d4a01139a3336639c6971647e885c.tar.gz rust-40336865fe7d4a01139a3336639c6971647e885c.zip | |
Auto merge of #100595 - matthiaskrgr:rollup-f1zur58, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - #100031 (improve "try ignoring the field" diagnostic) - #100325 (Rustdoc-Json: Don't remove impls for items imported from private modules) - #100377 (Replace - with _ in fluent slugs to improve developer workflows) - #100458 (Adjust span of fn argument declaration) - #100514 (Delay span bug when failing to normalize negative coherence impl subject due to other malformed impls) - #100528 (Support 1st group of RISC-V Bitmanip backend target features) - #100559 (Parser simplifications) - #100568 (Fix STD build for ESP-IDF) - #100582 ([rustdoc] Fix handling of stripped enum variant in JSON output format) - #100586 (Reland changes replacing num_cpus with available_parallelism ) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser/mod.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs index c088b6e1e0e..d61da7b6cc0 100644 --- a/compiler/rustc_parse/src/parser/mod.rs +++ b/compiler/rustc_parse/src/parser/mod.rs @@ -1116,10 +1116,14 @@ impl<'a> Parser<'a> { let (attrs, blk) = self.parse_inner_attrs_and_block()?; let anon_const = AnonConst { id: DUMMY_NODE_ID, - value: self.mk_expr(blk.span, ExprKind::Block(blk, None), AttrVec::new()), + value: self.mk_expr(blk.span, ExprKind::Block(blk, None)), }; let blk_span = anon_const.value.span; - Ok(self.mk_expr(span.to(blk_span), ExprKind::ConstBlock(anon_const), AttrVec::from(attrs))) + Ok(self.mk_expr_with_attrs( + span.to(blk_span), + ExprKind::ConstBlock(anon_const), + AttrVec::from(attrs), + )) } /// Parses mutability (`mut` or nothing). |
