about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeSeulArtichaut <leseulartichaut@gmail.com>2021-03-03 18:07:57 +0100
committerLeSeulArtichaut <leseulartichaut@gmail.com>2021-03-09 20:13:59 +0100
commita9f4dfc8fa90420548bb96d2df4b0d76eea9c862 (patch)
treea3b9f41c4fc37846a103a82eecc936be57cebc72
parent2a2b4d72578a531ec95ca7a5ab17e4136d9756fc (diff)
downloadrust-a9f4dfc8fa90420548bb96d2df4b0d76eea9c862.tar.gz
rust-a9f4dfc8fa90420548bb96d2df4b0d76eea9c862.zip
Remove `Clone` impl for `thir::Expr`
-rw-r--r--compiler/rustc_mir_build/src/build/expr/stmt.rs7
-rw-r--r--compiler/rustc_mir_build/src/thir/mod.rs20
2 files changed, 13 insertions, 14 deletions
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<region::Scope>,
 }
 
-#[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<Expr<'tcx>>,
     crate field_types: Vec<Ty<'tcx>>,
 }
 
-#[derive(Clone, Debug)]
+#[derive(Debug)]
 crate struct Arm<'tcx> {
     crate pattern: Pat<'tcx>,
     crate guard: Option<Guard<'tcx>>,
@@ -334,7 +334,7 @@ crate struct Arm<'tcx> {
     crate span: Span,
 }
 
-#[derive(Clone, Debug)]
+#[derive(Debug)]
 crate enum Guard<'tcx> {
     If(Box<Expr<'tcx>>),
     IfLet(Pat<'tcx>, Box<Expr<'tcx>>),
@@ -346,7 +346,7 @@ crate enum LogicalOp {
     Or,
 }
 
-#[derive(Clone, Debug)]
+#[derive(Debug)]
 crate enum InlineAsmOperand<'tcx> {
     In {
         reg: InlineAsmRegOrRegClass,