diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2017-07-15 14:52:32 -0400 |
|---|---|---|
| committer | Sean Griffin <sean@seantheprogrammer.com> | 2018-03-01 08:04:26 -0700 |
| commit | 7112d6584c355fa13df5cb672befb0f7c383cafb (patch) | |
| tree | 9f4530925b1ef07a7a256d4aa3ac305255896cbd | |
| parent | d516b263c6bda687bc5ca52e6940cd5f5bd40149 (diff) | |
make `Default` Copy and Clone
| -rw-r--r-- | src/librustc/infer/type_variable.rs | 6 |
1 files 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 @@ impl<'tcx> TypeVariableTable<'tcx> { pub fn default(&self, vid: ty::TyVid) -> Option<Default<'tcx>> { match &self.values.get(vid.index as usize).value { &Known { .. } => None, - &Bounded { ref default, .. } => default.clone() + &Bounded { default, .. } => default, } } @@ -185,7 +185,7 @@ impl<'tcx> TypeVariableTable<'tcx> { 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, }); |
