Skip to content

Commit 07cf4b4

Browse files
committed
Rollup merge of rust-lang#37577 - nnethercote:shrink-Expr-slightly, r=eddyb
Shrink `hir::Expr` slightly r? @eddyb
2 parents 638436e + 43452a3 commit 07cf4b4

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/librustc/hir/lowering.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1233,7 +1233,7 @@ impl<'a> LoweringContext<'a> {
12331233
hir::ExprInlineAsm(P(hir_asm), outputs, inputs)
12341234
}
12351235
ExprKind::Struct(ref path, ref fields, ref maybe_expr) => {
1236-
hir::ExprStruct(self.lower_path(path),
1236+
hir::ExprStruct(P(self.lower_path(path)),
12371237
fields.iter().map(|x| self.lower_field(x)).collect(),
12381238
maybe_expr.as_ref().map(|x| self.lower_expr(x)))
12391239
}
@@ -1737,7 +1737,7 @@ impl<'a> LoweringContext<'a> {
17371737
e: Option<P<hir::Expr>>,
17381738
attrs: ThinVec<Attribute>) -> P<hir::Expr> {
17391739
let def = self.resolver.resolve_generated_global_path(&path, false);
1740-
let expr = self.expr(sp, hir::ExprStruct(path, fields, e), attrs);
1740+
let expr = self.expr(sp, hir::ExprStruct(P(path), fields, e), attrs);
17411741
self.resolver.record_resolution(expr.id, def);
17421742
expr
17431743
}

src/librustc/hir/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -840,8 +840,8 @@ pub enum UnsafeSource {
840840
#[derive(Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash)]
841841
pub struct Expr {
842842
pub id: NodeId,
843-
pub node: Expr_,
844843
pub span: Span,
844+
pub node: Expr_,
845845
pub attrs: ThinVec<Attribute>,
846846
}
847847

@@ -946,7 +946,7 @@ pub enum Expr_ {
946946
///
947947
/// For example, `Foo {x: 1, y: 2}`, or
948948
/// `Foo {x: 1, .. base}`, where `base` is the `Option<Expr>`.
949-
ExprStruct(Path, HirVec<Field>, Option<P<Expr>>),
949+
ExprStruct(P<Path>, HirVec<Field>, Option<P<Expr>>),
950950

951951
/// An array literal constructed from one repeated element.
952952
///

src/librustc_const_eval/eval.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ pub fn const_expr_to_pat<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
314314
},
315315
}))
316316
.collect::<Result<_, _>>()?;
317-
PatKind::Struct(path.clone(), field_pats, false)
317+
PatKind::Struct((**path).clone(), field_pats, false)
318318
}
319319

320320
hir::ExprArray(ref exprs) => {

0 commit comments

Comments
 (0)