Skip to content

Commit 7d5c419

Browse files
committed
---
yaml --- r: 40283 b: refs/heads/dist-snap c: b90d7d4 h: refs/heads/master i: 40281: 604715f 40279: be03313 v: v3
1 parent f5db122 commit 7d5c419

File tree

4 files changed

+102
-63
lines changed

4 files changed

+102
-63
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: a810c03263670238bccd64cabb12a23a46e3a278
99
refs/heads/incoming: e90142e536c150df0d9b4b2f11352152177509b5
10-
refs/heads/dist-snap: 9e0c59614143abae80b155ca835758e27f286d14
10+
refs/heads/dist-snap: b90d7d4c817743234f33695837b2e0aa7bf01d3a
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/rustc/middle/typeck/check.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ use typeck::infer::{resolve_type, force_tvar};
7878
use result::{Result, Ok, Err};
7979
use syntax::print::pprust;
8080
use syntax::parse::token::special_idents;
81-
use vtable::LocationInfo;
81+
use vtable::{LocationInfo, VtableContext};
8282

8383
use std::map::HashMap;
8484

@@ -865,20 +865,20 @@ fn check_expr(fcx: @fn_ctxt, expr: @ast::expr,
865865
// declared on the impl declaration e.g., `impl<A,B> for ~[(A,B)]`
866866
// would return ($0, $1) where $0 and $1 are freshly instantiated type
867867
// variables.
868-
fn impl_self_ty(fcx: @fn_ctxt,
868+
fn impl_self_ty(vcx: &VtableContext,
869869
location_info: &LocationInfo, // (potential) receiver for
870870
// this impl
871871
did: ast::def_id) -> ty_param_substs_and_ty {
872-
let tcx = fcx.ccx.tcx;
872+
let tcx = vcx.tcx();
873873

874874
let {n_tps, region_param, raw_ty} = if did.crate == ast::local_crate {
875-
let region_param = fcx.tcx().region_paramd_items.find(did.node);
875+
let region_param = tcx.region_paramd_items.find(did.node);
876876
match tcx.items.find(did.node) {
877877
Some(ast_map::node_item(@{node: ast::item_impl(ts, _, st, _),
878878
_}, _)) => {
879879
{n_tps: ts.len(),
880880
region_param: region_param,
881-
raw_ty: fcx.ccx.to_ty(rscope::type_rscope(region_param), st)}
881+
raw_ty: vcx.ccx.to_ty(rscope::type_rscope(region_param), st)}
882882
}
883883
Some(ast_map::node_item(@{node: ast::item_class(_, ts),
884884
id: class_id, _},_)) => {
@@ -904,12 +904,12 @@ fn impl_self_ty(fcx: @fn_ctxt,
904904
};
905905

906906
let self_r = if region_param.is_some() {
907-
Some(fcx.infcx().next_region_var(location_info.span,
907+
Some(vcx.infcx.next_region_var(location_info.span,
908908
location_info.id))
909909
} else {
910910
None
911911
};
912-
let tps = fcx.infcx().next_ty_vars(n_tps);
912+
let tps = vcx.infcx.next_ty_vars(n_tps);
913913

914914
let substs = {self_r: self_r, self_ty: None, tps: tps};
915915
let substd_ty = ty::subst(tcx, &substs, raw_ty);

branches/dist-snap/src/rustc/middle/typeck/check/method.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,8 +492,12 @@ impl LookupContext {
492492
// determine the `self` of the impl with fresh
493493
// variables for each parameter:
494494
let location_info = &vtable::location_info_for_expr(self.self_expr);
495+
let vcx = VtableContext {
496+
ccx: self.fcx.ccx,
497+
infcx: self.fcx.infcx()
498+
};
495499
let {substs: impl_substs, ty: impl_ty} =
496-
impl_self_ty(self.fcx, location_info, impl_info.did);
500+
impl_self_ty(&vcx, location_info, impl_info.did);
497501

498502
let (impl_ty, impl_substs) =
499503
self.create_rcvr_ty_and_substs_for_method(

0 commit comments

Comments
 (0)