Skip to content

Commit a7159be

Browse files
committed
Remove old deriving
1 parent 6439f2d commit a7159be

16 files changed

+17
-1302
lines changed

src/librustc/middle/trans/base.rs

-46
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ use util::ppaux;
5252
use util::ppaux::{ty_to_str, ty_to_short_str};
5353
use syntax::diagnostic::expect;
5454
use util::common::indenter;
55-
use ty::DerivedMethodInfo;
5655

5756
use build::*;
5857
use shape::*;
@@ -1878,10 +1877,6 @@ fn trans_item(ccx: @crate_ctxt, item: ast::item) {
18781877
}
18791878
}
18801879
ast::item_impl(tps, _, _, ms) => {
1881-
// This call will do nothing if there are no derivable methods.
1882-
deriving::trans_deriving_impl(ccx, *path, item.ident, tps,
1883-
item.id);
1884-
18851880
meth::trans_impl(ccx, *path, item.ident, ms, tps, None,
18861881
item.id);
18871882
}
@@ -2112,20 +2107,7 @@ fn get_item_val(ccx: @crate_ctxt, id: ast::node_id) -> ValueRef {
21122107
match ccx.item_vals.find(id) {
21132108
Some(v) => v,
21142109
None => {
2115-
// First, check whether we need to automatically generate a method
2116-
// via the deriving mechanism.
2117-
match ccx.tcx.automatically_derived_methods.find(local_def(id)) {
2118-
None => {} // Continue.
2119-
Some(ref derived_method_info) => {
2120-
// XXX: Mark as internal if necessary.
2121-
let llfn = register_deriving_method(
2122-
ccx, id, derived_method_info);
2123-
ccx.item_vals.insert(id, llfn);
2124-
return llfn;
2125-
}
2126-
}
21272110

2128-
// Failing that, look for an item.
21292111
let mut exprt = false;
21302112
let val = match ccx.tcx.items.get(id) {
21312113
ast_map::node_item(i, pth) => {
@@ -2273,34 +2255,6 @@ fn register_method(ccx: @crate_ctxt, id: ast::node_id, pth: @ast_map::path,
22732255
llfn
22742256
}
22752257

2276-
fn register_deriving_method(ccx: @crate_ctxt,
2277-
id: ast::node_id,
2278-
derived_method_info: &DerivedMethodInfo) ->
2279-
ValueRef {
2280-
// Find the path of the item.
2281-
let path, span;
2282-
match ccx.tcx.items.get(derived_method_info.containing_impl.node) {
2283-
ast_map::node_item(item, found_path) => {
2284-
path = found_path;
2285-
span = item.span;
2286-
}
2287-
_ => {
2288-
ccx.tcx.sess.bug(~"derived method info containing impl didn't \
2289-
refer to an item");
2290-
}
2291-
}
2292-
2293-
let path = vec::append(*path, ~[
2294-
ast_map::path_mod(
2295-
ccx.sess.parse_sess.interner.intern(@fmt!("__derived%d__", id))),
2296-
ast_map::path_name(derived_method_info.method_info.ident)
2297-
]);
2298-
let mty = ty::lookup_item_type(ccx.tcx, local_def(id)).ty;
2299-
let llfn = register_fn_full(ccx, span, path, id, mty);
2300-
// XXX: Inline hint.
2301-
llfn
2302-
}
2303-
23042258
// The constant translation pass.
23052259
fn trans_constant(ccx: @crate_ctxt, it: @ast::item) {
23062260
let _icx = ccx.insn_ctxt("trans_constant");

src/librustc/middle/trans/callee.rs

-2
Original file line numberDiff line numberDiff line change
@@ -223,8 +223,6 @@ fn trans_fn_ref_with_vtables(
223223
let must_monomorphise;
224224
if type_params.len() > 0 || opt_impl_did.is_some() {
225225
must_monomorphise = true;
226-
} else if ccx.tcx.automatically_derived_methods.contains_key(def_id) {
227-
must_monomorphise = false;
228226
} else if def_id.crate == ast::local_crate {
229227
let map_node = session::expect(
230228
ccx.sess,

0 commit comments

Comments
 (0)