Skip to content

Commit b3820dd

Browse files
nikomatsakissgrif
authored andcommitted
make Default Copy and Clone
1 parent b491b35 commit b3820dd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/librustc/infer/type_variable.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ enum TypeVariableValue<'tcx> {
8989

9090
// We will use this to store the required information to recapitulate what happened when
9191
// an error occurs.
92-
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
92+
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)]
9393
pub struct Default<'tcx> {
9494
pub ty: Ty<'tcx>,
9595
/// The span where the default was incurred
@@ -123,7 +123,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
123123
pub fn default(&self, vid: ty::TyVid) -> Option<Default<'tcx>> {
124124
match &self.values.get(vid.index as usize).value {
125125
&Known { .. } => None,
126-
&Bounded { ref default, .. } => default.clone()
126+
&Bounded { default, .. } => default,
127127
}
128128
}
129129

@@ -185,7 +185,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
185185
self.eq_relations.new_key(());
186186
self.sub_relations.new_key(());
187187
let index = self.values.push(TypeVariableData {
188-
value: Bounded { default: default },
188+
value: Bounded { default },
189189
origin,
190190
diverging,
191191
});

0 commit comments

Comments
 (0)