Skip to content

Commit b26dbe7

Browse files
committed
---
yaml --- r: 78700 b: refs/heads/try c: b7cbd8a h: refs/heads/master v: v3
1 parent 4cb8d5b commit b26dbe7

File tree

18 files changed

+1178
-148
lines changed

18 files changed

+1178
-148
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 25ed29a0edb3d48fef843a0b818ee68faf2252da
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 60fba4d7d677ec098e6a43014132fe99f7547363
5-
refs/heads/try: 23bfa600a0f91f1ea62ea3f3783c358a7cb7da45
5+
refs/heads/try: b7cbd8a8fd69d7a2b540e3b4f9e808810fc1ddc0
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/librustc/middle/liveness.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,7 @@ impl Liveness {
16171617

16181618
pub fn should_warn(&self, var: Variable) -> Option<@str> {
16191619
let name = self.ir.variable_name(var);
1620-
if name.len() == 0 || name[0] == ('_' as u8) { None } else { Some(name) }
1620+
if name[0] == ('_' as u8) { None } else { Some(name) }
16211621
}
16221622

16231623
pub fn warn_about_unused_args(&self, decl: &fn_decl, entry_ln: LiveNode) {

branches/try/src/librustc/middle/trans/meth.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -577,23 +577,20 @@ fn emit_vtable_methods(bcx: @mut Block,
577577

578578
let trait_method_def_ids = ty::trait_method_def_ids(tcx, trt_id);
579579
do trait_method_def_ids.map |method_def_id| {
580-
let ident = ty::method(tcx, *method_def_id).ident;
581-
// The substitutions we have are on the impl, so we grab
582-
// the method type from the impl to substitute into.
583-
let m_id = method_with_name(ccx, impl_id, ident);
584-
let m = ty::method(tcx, m_id);
585-
debug!("(making impl vtable) emitting method %s at subst %s",
586-
m.repr(tcx),
587-
substs.repr(tcx));
580+
let im = ty::method(tcx, *method_def_id);
588581
let fty = ty::subst_tps(tcx,
589582
substs,
590583
None,
591-
ty::mk_bare_fn(tcx, m.fty.clone()));
592-
if m.generics.has_type_params() || ty::type_has_self(fty) {
584+
ty::mk_bare_fn(tcx, im.fty.clone()));
585+
if im.generics.has_type_params() || ty::type_has_self(fty) {
593586
debug!("(making impl vtable) method has self or type params: %s",
594-
tcx.sess.str_of(ident));
587+
tcx.sess.str_of(im.ident));
595588
C_null(Type::nil().ptr_to())
596589
} else {
590+
debug!("(making impl vtable) adding method to vtable: %s",
591+
tcx.sess.str_of(im.ident));
592+
let m_id = method_with_name(ccx, impl_id, im.ident);
593+
597594
trans_fn_ref_with_vtables(bcx, m_id, 0,
598595
substs, Some(vtables)).llfn
599596
}

branches/try/src/librustc/middle/typeck/check/method.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -938,18 +938,9 @@ impl<'self> LookupContext<'self> {
938938

939939
// static methods should never have gotten this far:
940940
assert!(candidate.method_ty.explicit_self != sty_static);
941-
942-
let transformed_self_ty = match candidate.origin {
943-
method_object(*) => {
944-
// For annoying reasons, we've already handled the
945-
// substitution for object calls.
946-
candidate.method_ty.transformed_self_ty.unwrap()
947-
}
948-
_ => {
949-
ty::subst(tcx, &candidate.rcvr_substs,
950-
candidate.method_ty.transformed_self_ty.unwrap())
951-
}
952-
};
941+
let transformed_self_ty =
942+
ty::subst(tcx, &candidate.rcvr_substs,
943+
candidate.method_ty.transformed_self_ty.unwrap());
953944

954945
// Determine the values for the type parameters of the method.
955946
// If they were not explicitly supplied, just construct fresh

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3092,6 +3092,7 @@ pub fn ty_param_bounds_and_ty_for_def(fcx: @mut FnCtxt,
30923092
sp: span,
30933093
defn: ast::def)
30943094
-> ty_param_bounds_and_ty {
3095+
30953096
match defn {
30963097
ast::def_arg(nid, _) | ast::def_local(nid, _) | ast::def_self(nid, _) |
30973098
ast::def_binding(nid, _) => {
@@ -3148,8 +3149,7 @@ pub fn instantiate_path(fcx: @mut FnCtxt,
31483149
let ty_param_count = tpt.generics.type_param_defs.len();
31493150
let ty_substs_len = pth.types.len();
31503151

3151-
debug!("tpt=%s ty_param_count=%? ty_substs_len=%?",
3152-
tpt.repr(fcx.tcx()),
3152+
debug!("ty_param_count=%? ty_substs_len=%?",
31533153
ty_param_count,
31543154
ty_substs_len);
31553155

branches/try/src/librustc/middle/typeck/collect.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -346,10 +346,9 @@ pub fn ensure_trait_methods(ccx: &CrateCtxt,
346346
let substd_type_param_defs = m.generics.type_param_defs.subst(tcx, &substs);
347347
new_type_param_defs.push_all(*substd_type_param_defs);
348348

349-
debug!("static method %s type_param_defs=%s ty=%s, substs=%s",
349+
debug!("static method %s type_param_defs=%s substs=%s",
350350
m.def_id.repr(tcx),
351351
new_type_param_defs.repr(tcx),
352-
ty.repr(tcx),
353352
substs.repr(tcx));
354353

355354
tcx.tcache.insert(m.def_id,
@@ -894,8 +893,8 @@ pub fn convert(ccx: &CrateCtxt, it: &ast::item) {
894893
}
895894
ast::item_trait(ref generics, _, ref trait_methods) => {
896895
let _trait_def = trait_def_of_item(ccx, it);
896+
ensure_trait_methods(ccx, it.id);
897897

898-
// Run convert_methods on the provided methods.
899898
let (_, provided_methods) =
900899
split_trait_methods(*trait_methods);
901900
let untransformed_rcvr_ty = ty::mk_self(tcx, local_def(it.id));
@@ -905,11 +904,6 @@ pub fn convert(ccx: &CrateCtxt, it: &ast::item) {
905904
untransformed_rcvr_ty,
906905
&ty_generics, generics,
907906
it.vis);
908-
909-
// We need to do this *after* converting methods, since
910-
// convert_methods produces a tcache entry that is wrong for
911-
// static trait methods. This is somewhat unfortunate.
912-
ensure_trait_methods(ccx, it.id);
913907
}
914908
ast::item_struct(struct_def, ref generics) => {
915909
ensure_no_ty_param_bounds(ccx, it.span, generics, "structure");

branches/try/src/librustpkg/tests.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,6 @@ fn rustpkg_local_pkg() {
678678
}
679679
680680
#[test]
681-
#[ignore (reason = "test makes bogus assumptions about build directory layout: issue #8690")]
682681
fn package_script_with_default_build() {
683682
let dir = create_local_package(&PkgId::new("fancy-lib"));
684683
debug!("dir = %s", dir.to_str());

0 commit comments

Comments
 (0)