Skip to content

Commit cbad76a

Browse files
committed
---
yaml --- r: 13462 b: refs/heads/master c: 87af3f3 h: refs/heads/master v: v3
1 parent ee2a06f commit cbad76a

File tree

3 files changed

+5
-39
lines changed

3 files changed

+5
-39
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: e38eaed9789a2eb9abc2f767d9487708e17ea3dd
2+
refs/heads/master: 87af3f3ccab541a59996f289c39ccf7ddad1e29f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rustc/middle/typeck.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,6 @@ type ty_table = hashmap<ast::def_id, ty::t>;
118118
type crate_ctxt = {impl_map: resolve::impl_map,
119119
method_map: method_map,
120120
vtable_map: vtable_map,
121-
// Not at all sure it's right to put these here
122-
/* node_id for the class this fn is in --
123-
none if it's not in a class */
124-
enclosing_class_id: option<ast::node_id>,
125-
/* map from node_ids for enclosing-class
126-
vars and methods to types */
127-
enclosing_class: class_map,
128121
tcx: ty::ctxt};
129122

130123
type class_map = hashmap<ast::node_id, ty::t>;
@@ -246,8 +239,6 @@ fn check_crate(tcx: ty::ctxt, impl_map: resolve::impl_map,
246239
let ccx = @{impl_map: impl_map,
247240
method_map: std::map::int_hash(),
248241
vtable_map: std::map::int_hash(),
249-
enclosing_class_id: none,
250-
enclosing_class: std::map::int_hash(),
251242
tcx: tcx};
252243
collect::collect_item_types(ccx, crate);
253244
check::check_item_types(ccx, crate);

trunk/src/rustc/middle/typeck/check.rs

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -320,26 +320,6 @@ fn check_method(ccx: @crate_ctxt, method: @ast::method, self_ty: ty::t) {
320320
check_bare_fn(ccx, method.decl, method.body, method.id, some(self_ty));
321321
}
322322

323-
fn class_types(ccx: @crate_ctxt, members: [@ast::class_member],
324-
rp: ast::region_param) -> class_map {
325-
326-
let rslt = int_hash::<ty::t>();
327-
let rs = rscope::type_rscope(rp);
328-
for members.each { |m|
329-
alt m.node {
330-
ast::instance_var(_,t,_,id,_) {
331-
rslt.insert(id, ccx.to_ty(rs, t));
332-
}
333-
ast::class_method(mth) {
334-
rslt.insert(mth.id,
335-
ty::mk_fn(ccx.tcx,
336-
collect::ty_of_method(ccx, mth, rp).fty));
337-
}
338-
}
339-
}
340-
rslt
341-
}
342-
343323
fn check_class_member(ccx: @crate_ctxt, class_t: ty::t,
344324
cm: @ast::class_member) {
345325
alt cm.node {
@@ -368,30 +348,25 @@ fn check_item(ccx: @crate_ctxt, it: @ast::item) {
368348
for ms.each {|m| check_method(ccx, m, self_ty);}
369349
}
370350
ast::item_class(tps, ifaces, members, ctor, m_dtor, rp) {
371-
let cid = some(it.id), tcx = ccx.tcx;
351+
let tcx = ccx.tcx;
372352
let class_t = ty::node_id_to_type(tcx, it.id);
373-
let members_info = class_types(ccx, members, rp);
374-
// can also ditch the enclosing_class stuff once we move to self
375-
// FIXME
376-
let class_ccx = @{enclosing_class_id:cid,
377-
enclosing_class:members_info with *ccx};
378353
// typecheck the ctor
379-
check_bare_fn(class_ccx, ctor.node.dec,
354+
check_bare_fn(ccx, ctor.node.dec,
380355
ctor.node.body, ctor.node.id,
381356
some(class_t));
382357
// Write the ctor's self's type
383358
write_ty_to_tcx(tcx, ctor.node.self_id, class_t);
384359

385360
option::iter(m_dtor) {|dtor|
386361
// typecheck the dtor
387-
check_bare_fn(class_ccx, ast_util::dtor_dec(),
362+
check_bare_fn(ccx, ast_util::dtor_dec(),
388363
dtor.node.body, dtor.node.id,
389364
some(class_t));
390365
// Write the dtor's self's type
391366
write_ty_to_tcx(tcx, dtor.node.self_id, class_t);
392367
};
393368
// typecheck the members
394-
for members.each {|m| check_class_member(class_ccx, class_t, m); }
369+
for members.each {|m| check_class_member(ccx, class_t, m); }
395370
// Check that there's at least one field
396371
let (fields,_) = split_class_items(members);
397372
if fields.len() < 1u {

0 commit comments

Comments
 (0)