diff --git a/compiler/rustc_mir_build/src/build/expr/stmt.rs b/compiler/rustc_mir_build/src/build/expr/stmt.rs index 8e907a40f43..470a3eaaa3c 100644 --- a/compiler/rustc_mir_build/src/build/expr/stmt.rs +++ b/compiler/rustc_mir_build/src/build/expr/stmt.rs @@ -21,7 +21,6 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let source_info = this.source_info(expr.span); // Handle a number of expressions that don't need a destination at all. This // avoids needing a mountain of temporary `()` variables. - let expr2 = expr.clone(); match &expr.kind { ExprKind::Scope { region_scope, lint_level, value } => { this.in_scope((*region_scope, source_info), *lint_level, |this| { @@ -35,7 +34,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { // is better for borrowck interaction with overloaded // operators like x[j] = x[i]. - debug!("stmt_expr Assign block_context.push(SubExpr) : {:?}", expr2); + debug!("stmt_expr Assign block_context.push(SubExpr) : {:?}", expr); this.block_context.push(BlockFrame::SubExpr); // Generate better code for things that don't need to be @@ -64,7 +63,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { let lhs_ty = lhs.ty; - debug!("stmt_expr AssignOp block_context.push(SubExpr) : {:?}", expr2); + debug!("stmt_expr AssignOp block_context.push(SubExpr) : {:?}", expr); this.block_context.push(BlockFrame::SubExpr); // As above, RTL. @@ -102,7 +101,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { this.break_scope(block, value.as_deref(), BreakableTarget::Return, source_info) } ExprKind::LlvmInlineAsm { asm, outputs, inputs } => { - debug!("stmt_expr LlvmInlineAsm block_context.push(SubExpr) : {:?}", expr2); + debug!("stmt_expr LlvmInlineAsm block_context.push(SubExpr) : {:?}", expr); this.block_context.push(BlockFrame::SubExpr); let outputs = outputs .into_iter() diff --git a/compiler/rustc_mir_build/src/thir/mod.rs b/compiler/rustc_mir_build/src/thir/mod.rs index f934dd32c53..6e7094307b1 100644 --- a/compiler/rustc_mir_build/src/thir/mod.rs +++ b/compiler/rustc_mir_build/src/thir/mod.rs @@ -32,7 +32,7 @@ crate enum LintLevel { Explicit(hir::HirId), } -#[derive(Clone, Debug)] +#[derive(Debug)] crate struct Block<'tcx> { crate targeted_by_break: bool, crate region_scope: region::Scope, @@ -51,13 +51,13 @@ crate enum BlockSafety { PopUnsafe, } -#[derive(Clone, Debug)] +#[derive(Debug)] crate struct Stmt<'tcx> { crate kind: StmtKind<'tcx>, crate opt_destruction_scope: Option, } -#[derive(Clone, Debug)] +#[derive(Debug)] crate enum StmtKind<'tcx> { Expr { /// scope for this statement; may be used as lifetime of temporaries @@ -107,7 +107,7 @@ rustc_data_structures::static_assert_size!(Expr<'_>, 160); /// MIR simplifications are already done in the impl of `Thir`. For /// example, method calls and overloaded operators are absent: they are /// expected to be converted into `Expr::Call` instances. -#[derive(Clone, Debug)] +#[derive(Debug)] crate struct Expr<'tcx> { /// type of this expression crate ty: Ty<'tcx>, @@ -123,7 +123,7 @@ crate struct Expr<'tcx> { crate kind: ExprKind<'tcx>, } -#[derive(Clone, Debug)] +#[derive(Debug)] crate enum ExprKind<'tcx> { Scope { region_scope: region::Scope, @@ -312,19 +312,19 @@ crate enum ExprKind<'tcx> { }, } -#[derive(Clone, Debug)] +#[derive(Debug)] crate struct FieldExpr<'tcx> { crate name: Field, crate expr: Expr<'tcx>, } -#[derive(Clone, Debug)] +#[derive(Debug)] crate struct FruInfo<'tcx> { crate base: Box>, crate field_types: Vec>, } -#[derive(Clone, Debug)] +#[derive(Debug)] crate struct Arm<'tcx> { crate pattern: Pat<'tcx>, crate guard: Option>, @@ -334,7 +334,7 @@ crate struct Arm<'tcx> { crate span: Span, } -#[derive(Clone, Debug)] +#[derive(Debug)] crate enum Guard<'tcx> { If(Box>), IfLet(Pat<'tcx>, Box>), @@ -346,7 +346,7 @@ crate enum LogicalOp { Or, } -#[derive(Clone, Debug)] +#[derive(Debug)] crate enum InlineAsmOperand<'tcx> { In { reg: InlineAsmRegOrRegClass,