about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2022-04-16 19:15:02 +0000
committerbors <bors@rust-lang.org>2022-04-16 19:15:02 +0000
commit878c7833f6c1ff10e2fd89074e5bd4ef5ff15936 (patch)
tree3775849e21447f36051ce13cbfa6620fba74fa8e /compiler/rustc_parse/src
parent2fa9789f596dd7639e1a242d466637b53179f4d1 (diff)
parent10e0db5666c15ed58abb47aca1ee453e371c406f (diff)
downloadrust-878c7833f6c1ff10e2fd89074e5bd4ef5ff15936.tar.gz
rust-878c7833f6c1ff10e2fd89074e5bd4ef5ff15936.zip
Auto merge of #96123 - Dylan-DPC:rollup-qjog6n1, r=Dylan-DPC
Rollup of 7 pull requests

Successful merges:

 - #94985 (Parse inner attributes on inline const block)
 - #95006 (Reject `#[thread_local]` attribute on non-static items)
 - #95426 (Include Refs in Valtree Creation)
 - #95908 (Inline `shallow_resolve_ty` into `ShallowResolver`)
 - #96058 (separate flock implementations into separate modules)
 - #96088 (Update mdbook)
 - #96118 (rustdoc: Rename `def_id` into `item_id` when the type is `ItemId` for readability)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index f1956fb695b..cb6be8f412c 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -1125,13 +1125,13 @@ impl<'a> Parser<'a> {
             self.sess.gated_spans.gate(sym::inline_const, span);
         }
         self.eat_keyword(kw::Const);
-        let blk = self.parse_block()?;
+        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()),
         };
         let blk_span = anon_const.value.span;
-        Ok(self.mk_expr(span.to(blk_span), ExprKind::ConstBlock(anon_const), AttrVec::new()))
+        Ok(self.mk_expr(span.to(blk_span), ExprKind::ConstBlock(anon_const), AttrVec::from(attrs)))
     }
 
     /// Parses mutability (`mut` or nothing).