Skip to content

Commit 9d55326

Browse files
committed
resolve: Remove all the operator overloads from trait_map.
1 parent d096eef commit 9d55326

File tree

1 file changed

+0
-72
lines changed

1 file changed

+0
-72
lines changed

src/librustc/middle/resolve.rs

-72
Original file line numberDiff line numberDiff line change
@@ -5264,67 +5264,6 @@ impl Resolver {
52645264
let traits = self.search_for_traits_containing_method(ident);
52655265
self.trait_map.insert(expr.id, @RefCell::new(traits));
52665266
}
5267-
ExprBinary(_, BiAdd, _, _) | ExprAssignOp(_, BiAdd, _, _) => {
5268-
let i = self.lang_items.add_trait();
5269-
self.add_fixed_trait_for_expr(expr.id, i);
5270-
}
5271-
ExprBinary(_, BiSub, _, _) | ExprAssignOp(_, BiSub, _, _) => {
5272-
let i = self.lang_items.sub_trait();
5273-
self.add_fixed_trait_for_expr(expr.id, i);
5274-
}
5275-
ExprBinary(_, BiMul, _, _) | ExprAssignOp(_, BiMul, _, _) => {
5276-
let i = self.lang_items.mul_trait();
5277-
self.add_fixed_trait_for_expr(expr.id, i);
5278-
}
5279-
ExprBinary(_, BiDiv, _, _) | ExprAssignOp(_, BiDiv, _, _) => {
5280-
let i = self.lang_items.div_trait();
5281-
self.add_fixed_trait_for_expr(expr.id, i);
5282-
}
5283-
ExprBinary(_, BiRem, _, _) | ExprAssignOp(_, BiRem, _, _) => {
5284-
let i = self.lang_items.rem_trait();
5285-
self.add_fixed_trait_for_expr(expr.id, i);
5286-
}
5287-
ExprBinary(_, BiBitXor, _, _) | ExprAssignOp(_, BiBitXor, _, _) => {
5288-
let i = self.lang_items.bitxor_trait();
5289-
self.add_fixed_trait_for_expr(expr.id, i);
5290-
}
5291-
ExprBinary(_, BiBitAnd, _, _) | ExprAssignOp(_, BiBitAnd, _, _) => {
5292-
let i = self.lang_items.bitand_trait();
5293-
self.add_fixed_trait_for_expr(expr.id, i);
5294-
}
5295-
ExprBinary(_, BiBitOr, _, _) | ExprAssignOp(_, BiBitOr, _, _) => {
5296-
let i = self.lang_items.bitor_trait();
5297-
self.add_fixed_trait_for_expr(expr.id, i);
5298-
}
5299-
ExprBinary(_, BiShl, _, _) | ExprAssignOp(_, BiShl, _, _) => {
5300-
let i = self.lang_items.shl_trait();
5301-
self.add_fixed_trait_for_expr(expr.id, i);
5302-
}
5303-
ExprBinary(_, BiShr, _, _) | ExprAssignOp(_, BiShr, _, _) => {
5304-
let i = self.lang_items.shr_trait();
5305-
self.add_fixed_trait_for_expr(expr.id, i);
5306-
}
5307-
ExprBinary(_, BiLt, _, _) | ExprBinary(_, BiLe, _, _) |
5308-
ExprBinary(_, BiGe, _, _) | ExprBinary(_, BiGt, _, _) => {
5309-
let i = self.lang_items.ord_trait();
5310-
self.add_fixed_trait_for_expr(expr.id, i);
5311-
}
5312-
ExprBinary(_, BiEq, _, _) | ExprBinary(_, BiNe, _, _) => {
5313-
let i = self.lang_items.eq_trait();
5314-
self.add_fixed_trait_for_expr(expr.id, i);
5315-
}
5316-
ExprUnary(_, UnNeg, _) => {
5317-
let i = self.lang_items.neg_trait();
5318-
self.add_fixed_trait_for_expr(expr.id, i);
5319-
}
5320-
ExprUnary(_, UnNot, _) => {
5321-
let i = self.lang_items.not_trait();
5322-
self.add_fixed_trait_for_expr(expr.id, i);
5323-
}
5324-
ExprIndex(..) => {
5325-
let i = self.lang_items.index_trait();
5326-
self.add_fixed_trait_for_expr(expr.id, i);
5327-
}
53285267
_ => {
53295268
// Nothing to do.
53305269
}
@@ -5417,17 +5356,6 @@ impl Resolver {
54175356
found_traits.push(trait_def_id);
54185357
}
54195358

5420-
fn add_fixed_trait_for_expr(&mut self,
5421-
expr_id: NodeId,
5422-
trait_id: Option<DefId>) {
5423-
match trait_id {
5424-
Some(trait_id) => {
5425-
self.trait_map.insert(expr_id, @RefCell::new(~[trait_id]));
5426-
}
5427-
None => {}
5428-
}
5429-
}
5430-
54315359
fn record_def(&mut self, node_id: NodeId, (def, lp): (Def, LastPrivate)) {
54325360
debug!("(recording def) recording {:?} for {:?}, last private {:?}",
54335361
def, node_id, lp);

0 commit comments

Comments
 (0)