Skip to content

Commit 0cfb482

Browse files
committed
---
yaml --- r: 32637 b: refs/heads/dist-snap c: 2469cba h: refs/heads/master i: 32635: 4a8d46d v: v3
1 parent e9920b3 commit 0cfb482

File tree

3 files changed

+24
-8
lines changed

3 files changed

+24
-8
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 527a6f60f14c6f38b524cfd5119c670aa0f9bef9
10+
refs/heads/dist-snap: 2469cba0b17b24d37c7bc4833c56ce027b8c1632
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ impl LookupContext {
168168
// around newtype enums. They can be further
169169
// deref'd, but they may also have intrinsic
170170
// methods hanging off of them with interior type.
171-
match self.search_for_appr_autorefd_method(self_ty,
172-
autoderefs) {
171+
match self.search_for_any_autorefd_method(self_ty,
172+
autoderefs) {
173173
Some(move mme) => { return Some(mme); }
174174
None => {}
175175
}
@@ -186,7 +186,7 @@ impl LookupContext {
186186
}
187187
}
188188

189-
self.search_for_appr_autorefd_method(self_ty, autoderefs)
189+
self.search_for_any_autorefd_method(self_ty, autoderefs)
190190
}
191191

192192
fn deref(ty: ty::t, enum_dids: &DVec<ast::def_id>) -> Option<ty::t> {
@@ -527,15 +527,13 @@ impl LookupContext {
527527
* Attempts both auto-slice and auto-ptr, as appropriate.
528528
*/
529529

530-
let tcx = self.tcx();
531-
532530
match self.search_for_autosliced_method(self_ty, autoderefs) {
533-
Some(mme) => { return mme; }
531+
Some(move mme) => { return Some(move mme); }
534532
None => {}
535533
}
536534

537535
match self.search_for_autoptrd_method(self_ty, autoderefs) {
538-
Some(mme) => { return mme; }
536+
Some(move mme) => { return Some(move mme); }
539537
None => {}
540538
}
541539

@@ -553,6 +551,7 @@ impl LookupContext {
553551
* Searches for a candidate by converting things like
554552
* `~[]` to `&[]`. */
555553

554+
let tcx = self.tcx();
556555
match ty::get(self_ty).sty {
557556
ty_evec(mt, vstore_box) |
558557
ty_evec(mt, vstore_uniq) |
@@ -593,6 +592,7 @@ impl LookupContext {
593592
* appropriate mutability.
594593
*/
595594

595+
let tcx = self.tcx();
596596
match ty::get(self_ty).sty {
597597
ty_box(*) | ty_uniq(*) | ty_rptr(*) => {
598598
// we should be fully autoderef'd
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
trait Pushable<T> {
2+
fn push_val(&mut self, +t: T);
3+
}
4+
5+
impl<T> ~[T]: Pushable<T> {
6+
fn push_val(&mut self, +t: T) {
7+
vec::push(*self, t);
8+
}
9+
}
10+
11+
fn main() {
12+
let mut v = ~[1];
13+
v.push_val(2);
14+
v.push_val(3);
15+
assert v == ~[1, 2, 3];
16+
}

0 commit comments

Comments
 (0)