Simplify attribute handling in rustc_ast_lowering
Given that attributes is stored in a separate BTreeMap, it's not necessary to pass it in when constructing `hir::Expr`. We can just construct `hir::Expr` and then call `self.lower_attrs` later if it needs attributes. As most desugaring code don't use attributes, this allows some code cleanup.
This commit is contained in:
@@ -2291,7 +2291,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
|
||||
/// has no attributes and is not targeted by a `break`.
|
||||
fn lower_block_expr(&mut self, b: &Block) -> hir::Expr<'hir> {
|
||||
let block = self.lower_block(b, false);
|
||||
self.expr_block(block, AttrVec::new())
|
||||
self.expr_block(block)
|
||||
}
|
||||
|
||||
fn lower_array_length(&mut self, c: &AnonConst) -> hir::ArrayLen {
|
||||
|
||||
Reference in New Issue
Block a user