Skip to content

Commit c5eb255

Browse files
committed
make Default Copy and Clone
1 parent 55f33ba commit c5eb255

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
@@ -86,7 +86,7 @@ enum TypeVariableValue<'tcx> {
8686

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

@@ -182,7 +182,7 @@ impl<'tcx> TypeVariableTable<'tcx> {
182182
self.eq_relations.new_key(());
183183
self.sub_relations.new_key(());
184184
let index = self.values.push(TypeVariableData {
185-
value: Bounded { default: default },
185+
value: Bounded { default },
186186
origin,
187187
diverging,
188188
});

0 commit comments

Comments
 (0)