提交 7112d658 编写于 作者: N Niko Matsakis 提交者: Sean Griffin

make `Default` Copy and Clone

上级 d516b263
......@@ -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<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 @@ 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,
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册