Skip to content

Commit 6e14c03

Browse files
committed
---
yaml --- r: 144264 b: refs/heads/try2 c: ad6eeb8 h: refs/heads/master v: v3
1 parent d6da62f commit 6e14c03

File tree

3 files changed

+33
-4
lines changed

3 files changed

+33
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 97d2b44f8749479fdf1ba92d1cada6ae8594cf54
8+
refs/heads/try2: ad6eeb843b3f21bd51bc6d89d58a75367b7439df
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

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

939939
// static methods should never have gotten this far:
940940
assert!(candidate.method_ty.explicit_self != sty_static);
941-
let transformed_self_ty =
942-
ty::subst(tcx, &candidate.rcvr_substs,
943-
candidate.method_ty.transformed_self_ty.unwrap());
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+
};
944953

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

branches/try2/src/test/run-pass/trait-object-generics.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,26 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
// test for #8664
12+
13+
pub trait Trait2<A> {
14+
fn doit(&self);
15+
}
16+
17+
pub struct Impl<A1, A2, A3> {
18+
/*
19+
* With A2 we get the ICE:
20+
* task <unnamed> failed at 'index out of bounds: the len is 1 but the index is 1', /home/tortue/rust_compiler_newest/src/librustc/middle/subst.rs:58
21+
*/
22+
t: ~Trait2<A2>
23+
}
24+
25+
impl<A1, A2, A3> Impl<A1, A2, A3> {
26+
pub fn step(&self) {
27+
self.t.doit()
28+
}
29+
}
30+
1131
// test for #8601
1232

1333
enum Type<T> { Constant }

0 commit comments

Comments
 (0)