resolve: Remove all the operator overloads from trait_map.
This commit is contained in:
parent
d096eefd80
commit
9d5532618f
|
@ -5264,67 +5264,6 @@ impl Resolver {
|
|||
let traits = self.search_for_traits_containing_method(ident);
|
||||
self.trait_map.insert(expr.id, @RefCell::new(traits));
|
||||
}
|
||||
ExprBinary(_, BiAdd, _, _) | ExprAssignOp(_, BiAdd, _, _) => {
|
||||
let i = self.lang_items.add_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprBinary(_, BiSub, _, _) | ExprAssignOp(_, BiSub, _, _) => {
|
||||
let i = self.lang_items.sub_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprBinary(_, BiMul, _, _) | ExprAssignOp(_, BiMul, _, _) => {
|
||||
let i = self.lang_items.mul_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprBinary(_, BiDiv, _, _) | ExprAssignOp(_, BiDiv, _, _) => {
|
||||
let i = self.lang_items.div_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprBinary(_, BiRem, _, _) | ExprAssignOp(_, BiRem, _, _) => {
|
||||
let i = self.lang_items.rem_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprBinary(_, BiBitXor, _, _) | ExprAssignOp(_, BiBitXor, _, _) => {
|
||||
let i = self.lang_items.bitxor_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprBinary(_, BiBitAnd, _, _) | ExprAssignOp(_, BiBitAnd, _, _) => {
|
||||
let i = self.lang_items.bitand_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprBinary(_, BiBitOr, _, _) | ExprAssignOp(_, BiBitOr, _, _) => {
|
||||
let i = self.lang_items.bitor_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprBinary(_, BiShl, _, _) | ExprAssignOp(_, BiShl, _, _) => {
|
||||
let i = self.lang_items.shl_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprBinary(_, BiShr, _, _) | ExprAssignOp(_, BiShr, _, _) => {
|
||||
let i = self.lang_items.shr_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprBinary(_, BiLt, _, _) | ExprBinary(_, BiLe, _, _) |
|
||||
ExprBinary(_, BiGe, _, _) | ExprBinary(_, BiGt, _, _) => {
|
||||
let i = self.lang_items.ord_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprBinary(_, BiEq, _, _) | ExprBinary(_, BiNe, _, _) => {
|
||||
let i = self.lang_items.eq_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprUnary(_, UnNeg, _) => {
|
||||
let i = self.lang_items.neg_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprUnary(_, UnNot, _) => {
|
||||
let i = self.lang_items.not_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
ExprIndex(..) => {
|
||||
let i = self.lang_items.index_trait();
|
||||
self.add_fixed_trait_for_expr(expr.id, i);
|
||||
}
|
||||
_ => {
|
||||
// Nothing to do.
|
||||
}
|
||||
|
@ -5417,17 +5356,6 @@ impl Resolver {
|
|||
found_traits.push(trait_def_id);
|
||||
}
|
||||
|
||||
fn add_fixed_trait_for_expr(&mut self,
|
||||
expr_id: NodeId,
|
||||
trait_id: Option<DefId>) {
|
||||
match trait_id {
|
||||
Some(trait_id) => {
|
||||
self.trait_map.insert(expr_id, @RefCell::new(~[trait_id]));
|
||||
}
|
||||
None => {}
|
||||
}
|
||||
}
|
||||
|
||||
fn record_def(&mut self, node_id: NodeId, (def, lp): (Def, LastPrivate)) {
|
||||
debug!("(recording def) recording {:?} for {:?}, last private {:?}",
|
||||
def, node_id, lp);
|
||||
|
|
Loading…
Reference in New Issue