Skip to content

Make ExprKind the first field in thir::Expr #108624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions compiler/rustc_middle/src/thir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ pub struct LocalVarId(pub hir::HirId);
/// A THIR expression.
#[derive(Clone, Debug, HashStable)]
pub struct Expr<'tcx> {
/// kind of expression
pub kind: ExprKind<'tcx>,

/// The type of this expression
pub ty: Ty<'tcx>,

Expand All @@ -246,9 +249,6 @@ pub struct Expr<'tcx> {

/// span of the expression in the source
pub span: Span,

/// kind of expression
pub kind: ExprKind<'tcx>,
}

#[derive(Clone, Debug, HashStable)]
Expand Down
18 changes: 9 additions & 9 deletions tests/ui/thir-print/thir-flat.stdout
Original file line number Diff line number Diff line change
Expand Up @@ -17,40 +17,40 @@ Thir {
],
exprs: [
Expr {
ty: (),
temp_lifetime: Some(
Node(2),
),
span: $DIR/thir-flat.rs:4:15: 4:17 (#0),
kind: Block {
block: b0,
},
},
Expr {
ty: (),
temp_lifetime: Some(
Node(2),
),
span: $DIR/thir-flat.rs:4:15: 4:17 (#0),
},
Expr {
kind: Scope {
region_scope: Node(2),
lint_level: Explicit(
HirId(DefId(0:3 ~ thir_flat[45a6]::main).2),
),
value: e0,
},
},
Expr {
ty: (),
temp_lifetime: Some(
Node(2),
),
span: $DIR/thir-flat.rs:4:15: 4:17 (#0),
},
Expr {
kind: Scope {
region_scope: Destruction(2),
lint_level: Inherited,
value: e1,
},
ty: (),
temp_lifetime: Some(
Node(2),
),
span: $DIR/thir-flat.rs:4:15: 4:17 (#0),
},
],
stmts: [],
Expand Down