From 7112d6584c355fa13df5cb672befb0f7c383cafb Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Sat, 15 Jul 2017 14:52:32 -0400 Subject: [PATCH 1/1] make `Default` Copy and Clone --- src/librustc/infer/type_variable.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/librustc/infer/type_variable.rs b/src/librustc/infer/type_variable.rs index d89625ac871..36afb8b5367 100644 --- a/src/librustc/infer/type_variable.rs +++ b/src/librustc/infer/type_variable.rs @@ -89,7 +89,7 @@ enum TypeVariableValue<'tcx> { // We will use this to store the required information to recapitulate what happened when // an error occurs. -#[derive(Clone, Debug, PartialEq, Eq, Hash)] +#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] pub struct Default<'tcx> { pub ty: Ty<'tcx>, /// The span where the default was incurred @@ -123,7 +123,7 @@ pub fn new() -> TypeVariableTable<'tcx> { pub fn default(&self, vid: ty::TyVid) -> Option> { match &self.values.get(vid.index as usize).value { &Known { .. } => None, - &Bounded { ref default, .. } => default.clone() + &Bounded { default, .. } => default, } } @@ -185,7 +185,7 @@ pub fn new_var(&mut self, self.eq_relations.new_key(()); self.sub_relations.new_key(()); let index = self.values.push(TypeVariableData { - value: Bounded { default: default }, + value: Bounded { default }, origin, diverging, }); -- 2.44.0