Skip to content

Commit 00e2777

Browse files
committed
checkpoint non-building state for rebase.
1 parent a9a4290 commit 00e2777

File tree

4 files changed

+43
-5
lines changed

4 files changed

+43
-5
lines changed

src/librustc/middle/resolve.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,6 +1662,10 @@ impl Resolver {
16621662

16631663
new_parent.import_resolutions.insert(ident, resolution);
16641664
}
1665+
1666+
debug!("(finished reduced graph for \
1667+
external crate) building module \
1668+
%s", final_ident);
16651669
}
16661670
}
16671671
}
@@ -1744,6 +1748,7 @@ impl Resolver {
17441748
fail!("didn't expect `%?`", def);
17451749
}
17461750
}
1751+
17471752
}
17481753

17491754
/**

src/librustc/middle/typeck/check/mod.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,15 +298,22 @@ pub fn check_bare_fn(ccx: @mut CrateCtxt,
298298
id: ast::node_id,
299299
self_info: Option<SelfInfo>) {
300300
let fty = ty::node_id_to_type(ccx.tcx, id);
301+
302+
debug!("check_bare_fn decl: %? body: %? id: %? self_info: %?",
303+
decl, body, id, self_info);
304+
301305
match ty::get(fty).sty {
302306
ty::ty_bare_fn(ref fn_ty) => {
307+
debug!("check_fn");
303308
let fcx =
304309
check_fn(ccx, self_info, fn_ty.purity,
305310
&fn_ty.sig, decl, id, body, Vanilla,
306311
@Nil, blank_inherited(ccx));;
307-
312+
debug!("resolve_in_block");
308313
vtable::resolve_in_block(fcx, body);
314+
debug!("regionck_fn");
309315
regionck::regionck_fn(fcx, body);
316+
debug!("resolve_type_vars_in_fn");
310317
writeback::resolve_type_vars_in_fn(fcx, decl, body, self_info);
311318
}
312319
_ => ccx.tcx.sess.impossible_case(body.span,
@@ -538,6 +545,9 @@ pub fn check_method(ccx: @mut CrateCtxt,
538545
span: method.explicit_self.span}
539546
});
540547

548+
debug!("check_method def_id: %? ty: %? opt_self_info: %?",
549+
method_def_id, method_ty, opt_self_info);
550+
541551
check_bare_fn(
542552
ccx,
543553
&method.decl,
@@ -612,6 +622,8 @@ pub fn check_item(ccx: @mut CrateCtxt, it: @ast::item) {
612622
// bodies to check.
613623
}
614624
provided(m) => {
625+
debug!("check provided method ccx, m: %?",
626+
ccx.tcx.sess.str_of(m.ident));
615627
check_method(ccx, m);
616628
}
617629
}

src/librustc/middle/typeck/check/vtable.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ fn lookup_vtable(vcx: &VtableContext,
201201

202202
let tcx = vcx.tcx();
203203

204+
debug!("lookup_vtable fixup_ty");
204205
let ty = match fixup_ty(vcx, location_info, ty, is_early) {
205206
Some(ty) => ty,
206207
None => {
@@ -212,9 +213,11 @@ fn lookup_vtable(vcx: &VtableContext,
212213
return Some(vtable_param(0, 0));
213214
}
214215
};
216+
debug!("lookup_vtable fixup_ty => %?", ty);
215217

216218
match ty::get(ty).sty {
217219
ty::ty_param(param_ty {idx: n, def_id: did}) => {
220+
debug!("lookup_vtable sty is ty_param");
218221
let mut n_bound = 0;
219222
let type_param_def = tcx.ty_param_defs.get(&did.node);
220223
for ty::each_bound_trait_and_supertraits(
@@ -238,15 +241,27 @@ fn lookup_vtable(vcx: &VtableContext,
238241
}
239242

240243
_ => {
244+
debug!("lookup_vtable sty not ty_param");
241245
let mut found = ~[];
242246

243247
let mut impls_seen = HashSet::new();
244248

245-
match vcx.ccx.coherence_info.extension_methods.find(&trait_ref.def_id) {
249+
let def_id = &trait_ref.def_id;
250+
let ext_meths =
251+
vcx.ccx.coherence_info.extension_methods.find(def_id);
252+
debug!("lookup_vtable def_id: %? ext_meths: %?", def_id, ext_meths);
253+
match ext_meths {
246254
None => {
247255
// Nothing found. Continue.
248256
}
249257
Some(implementations) => {
258+
let len = { // FIXME(#5074): stage0 requires it
259+
let implementations: &mut ~[@Impl] = *implementations;
260+
implementations.len()
261+
};
262+
263+
debug!("lookup_vtable impls len: %?", len);
264+
250265
// implementations is the list of all impls in scope for
251266
// trait_ref. (Usually, there's just one.)
252267
for implementations.iter().advance |im| {
@@ -397,6 +412,7 @@ fn lookup_vtable(vcx: &VtableContext,
397412
}
398413
}
399414

415+
debug!("lookup_vtable found.len: %u", found.len());
400416
match found.len() {
401417
0 => { /* fallthrough */ }
402418
1 => { return Some(/*bad*/copy found[0]); }

src/libsyntax/visit.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ pub fn generics_of_fn(fk: &fn_kind) -> Generics {
7373
}
7474

7575
trait Visitor {
76-
fn visit_mod(&self, &_mod, span, node_id);
76+
#[cfg(not(stage2))]
77+
fn visit_mod(&self, m:&_mod, s:span, i:node_id);
78+
#[cfg(stage2)]
79+
fn visit_mod(&self, m:&_mod, s:span, i:node_id) {
80+
walk_mod(self, m, s, i);
81+
}
7782
fn visit_view_item(&self, @view_item);
7883
fn visit_foreign_item(&self, @foreign_item);
7984
fn visit_item(&self, @item);
@@ -687,7 +692,7 @@ fn walk_mod<V:Visitor>(v:&V, m: &_mod, _sp: span, _id: node_id) {
687692
for m.items.each |i| { v.visit_item(*i); }
688693
}
689694

690-
fn walk_view_item<V:Visitor>(v:&V, _vi: @view_item) { }
695+
fn walk_view_item<V:Visitor>(_v:&V, _vi: @view_item) { }
691696

692697
fn walk_local<V:Visitor>(v:&V, loc: @local) {
693698
v.visit_pat(loc.node.pat);
@@ -984,7 +989,7 @@ fn walk_exprs<V:Visitor>(v:&V, exprs: &[@expr]) {
984989
for exprs.each |ex| { v.visit_expr(*ex); }
985990
}
986991

987-
fn walk_mac<V:Visitor>(v:&V, _m: &mac) {
992+
fn walk_mac<V:Visitor>(_v:&V, _m: &mac) {
988993
/* no user-serviceable parts inside */
989994
}
990995

0 commit comments

Comments
 (0)