mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 18:53:39 +00:00
make Default
Copy and Clone
This commit is contained in:
parent
d516b263c6
commit
7112d6584c
@ -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,
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user