Skip to content

Commit c05165b

Browse files
committed
Drop the impl_id field from fn_ctxt.
1 parent 5943118 commit c05165b

File tree

7 files changed

+7
-38
lines changed

7 files changed

+7
-38
lines changed

src/librustc/middle/trans/base.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,17 +1545,15 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
15451545
llfndecl: ValueRef,
15461546
id: ast::node_id,
15471547
output_type: ty::t,
1548-
impl_id: Option<ast::def_id>,
15491548
param_substs: Option<@param_substs>,
15501549
sp: Option<span>)
15511550
-> fn_ctxt {
15521551
for param_substs.iter().advance |p| { p.validate(); }
15531552

1554-
debug!("new_fn_ctxt_w_id(path=%s, id=%?, impl_id=%?, \
1553+
debug!("new_fn_ctxt_w_id(path=%s, id=%?, \
15551554
param_substs=%s)",
15561555
path_str(ccx.sess, path),
15571556
id,
1558-
impl_id,
15591557
param_substs.repr(ccx.tcx));
15601558

15611559
let llbbs = mk_standard_basic_blocks(llfndecl);
@@ -1584,7 +1582,6 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
15841582
lllocals: @mut HashMap::new(),
15851583
llupvars: @mut HashMap::new(),
15861584
id: id,
1587-
impl_id: impl_id,
15881585
param_substs: param_substs,
15891586
span: sp,
15901587
path: path,
@@ -1605,7 +1602,7 @@ pub fn new_fn_ctxt(ccx: @mut CrateContext,
16051602
output_type: ty::t,
16061603
sp: Option<span>)
16071604
-> fn_ctxt {
1608-
new_fn_ctxt_w_id(ccx, path, llfndecl, -1, output_type, None, None, sp)
1605+
new_fn_ctxt_w_id(ccx, path, llfndecl, -1, output_type, None, sp)
16091606
}
16101607

16111608
// NB: must keep 4 fns in sync:
@@ -1774,7 +1771,6 @@ pub fn trans_closure(ccx: @mut CrateContext,
17741771
self_arg: self_arg,
17751772
param_substs: Option<@param_substs>,
17761773
id: ast::node_id,
1777-
impl_id: Option<ast::def_id>,
17781774
attributes: &[ast::attribute],
17791775
output_type: ty::t,
17801776
maybe_load_env: &fn(fn_ctxt),
@@ -1792,7 +1788,6 @@ pub fn trans_closure(ccx: @mut CrateContext,
17921788
llfndecl,
17931789
id,
17941790
output_type,
1795-
impl_id,
17961791
param_substs,
17971792
Some(body.span));
17981793
let raw_llargs = create_llargs_for_fn_args(fcx, self_arg, decl.inputs);
@@ -1851,7 +1846,6 @@ pub fn trans_fn(ccx: @mut CrateContext,
18511846
self_arg: self_arg,
18521847
param_substs: Option<@param_substs>,
18531848
id: ast::node_id,
1854-
impl_id: Option<ast::def_id>,
18551849
attrs: &[ast::attribute]) {
18561850
let do_time = ccx.sess.trans_stats();
18571851
let start = if do_time { time::get_time() }
@@ -1871,7 +1865,6 @@ pub fn trans_fn(ccx: @mut CrateContext,
18711865
self_arg,
18721866
param_substs,
18731867
id,
1874-
impl_id,
18751868
attrs,
18761869
output_type,
18771870
|fcx| {
@@ -1921,7 +1914,6 @@ pub fn trans_enum_variant(ccx: @mut CrateContext,
19211914
llfndecl,
19221915
variant.node.id,
19231916
enum_ty,
1924-
None,
19251917
param_substs,
19261918
None);
19271919

@@ -2001,7 +1993,6 @@ pub fn trans_tuple_struct(ccx: @mut CrateContext,
20011993
llfndecl,
20021994
ctor_id,
20031995
tup_ty,
2004-
None,
20051996
param_substs,
20061997
None);
20071998
@@ -2081,7 +2072,6 @@ pub fn trans_item(ccx: @mut CrateContext, item: &ast::item) {
20812072
no_self,
20822073
None,
20832074
item.id,
2084-
None,
20852075
item.attrs);
20862076
} else {
20872077
for body.node.stmts.iter().advance |stmt| {

src/librustc/middle/trans/closure.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,6 @@ pub fn trans_expr_fn(bcx: block,
444444
no_self,
445445
/*bad*/ copy bcx.fcx.param_substs,
446446
user_id,
447-
None,
448447
[],
449448
real_return_type,
450449
|fcx| load_environment(fcx, cdata_ty, cap_vars,

src/librustc/middle/trans/common.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,6 @@ pub struct fn_ctxt_ {
222222
// a user-defined function.
223223
id: ast::node_id,
224224

225-
// The def_id of the impl we're inside, or None if we aren't inside one.
226-
impl_id: Option<ast::def_id>,
227-
228225
// If this function is being monomorphized, this contains the type
229226
// substitutions used.
230227
param_substs: Option<@param_substs>,

src/librustc/middle/trans/foreign.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
555555
decl,
556556
item.id,
557557
output_type,
558-
None,
559558
Some(substs),
560559
Some(item.span));
561560

@@ -1183,7 +1182,6 @@ pub fn trans_foreign_fn(ccx: @mut CrateContext,
11831182
no_self,
11841183
None,
11851184
id,
1186-
None,
11871185
[]);
11881186
return llfndecl;
11891187
}

src/librustc/middle/trans/inline.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ pub fn maybe_instantiate_inline(ccx: @mut CrateContext, fn_id: ast::def_id,
127127
self_kind,
128128
None,
129129
mth.id,
130-
Some(impl_did),
131130
[]);
132131
}
133132
local_def(mth.id)

src/librustc/middle/trans/meth.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ pub fn trans_impl(ccx: @mut CrateContext,
6868
path,
6969
*method,
7070
None,
71-
llfn,
72-
ast_util::local_def(id));
71+
llfn);
7372
}
7473
}
7574
}
@@ -90,8 +89,7 @@ pub fn trans_method(ccx: @mut CrateContext,
9089
path: path,
9190
method: &ast::method,
9291
param_substs: Option<@param_substs>,
93-
llfn: ValueRef,
94-
impl_id: ast::def_id) {
92+
llfn: ValueRef) {
9593
// figure out how self is being passed
9694
let self_arg = match method.explicit_self.node {
9795
ast::sty_static => {
@@ -127,7 +125,6 @@ pub fn trans_method(ccx: @mut CrateContext,
127125
self_arg,
128126
param_substs,
129127
method.id,
130-
Some(impl_id),
131128
[]);
132129
}
133130

src/librustc/middle/trans/monomorphize.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ pub fn monomorphic_fn(ccx: @mut CrateContext,
196196
no_self,
197197
psubsts,
198198
fn_id.node,
199-
None,
200199
[]);
201200
d
202201
}
@@ -224,27 +223,17 @@ pub fn monomorphic_fn(ccx: @mut CrateContext,
224223
}
225224
d
226225
}
227-
ast_map::node_method(mth, supplied_impl_did, _) => {
226+
ast_map::node_method(mth, _, _) => {
228227
// XXX: What should the self type be here?
229228
let d = mk_lldecl();
230229
set_inline_hint_if_appr(/*bad*/copy mth.attrs, d);
231-
232-
// Override the impl def ID if necessary.
233-
let impl_did;
234-
match impl_did_opt {
235-
None => impl_did = supplied_impl_did,
236-
Some(override_impl_did) => impl_did = override_impl_did
237-
}
238-
239-
meth::trans_method(ccx, pt, mth, psubsts, d, impl_did);
230+
meth::trans_method(ccx, pt, mth, psubsts, d);
240231
d
241232
}
242233
ast_map::node_trait_method(@ast::provided(mth), _, pt) => {
243234
let d = mk_lldecl();
244235
set_inline_hint_if_appr(/*bad*/copy mth.attrs, d);
245-
debug!("monomorphic_fn impl_did_opt is %?", impl_did_opt);
246-
meth::trans_method(ccx, /*bad*/copy *pt, mth, psubsts, d,
247-
impl_did_opt.get());
236+
meth::trans_method(ccx, /*bad*/copy *pt, mth, psubsts, d);
248237
d
249238
}
250239
ast_map::node_struct_ctor(struct_def, _, _) => {

0 commit comments

Comments
 (0)