Skip to content

Commit e9f3533

Browse files
brsonthestinger
authored andcommitted
---
yaml --- r: 64692 b: refs/heads/snap-stage3 c: 8d3bb7e h: refs/heads/master v: v3
1 parent 78a6edc commit e9f3533

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7fbe8002d515b8f8730fc6502a767719854af3d8
4+
refs/heads/snap-stage3: 8d3bb7eb306993430e5f5acf3e3fbf22d7a9d97f
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/typeck/check/method.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ impl<'self> LookupContext<'self> {
194194
self.push_inherent_candidates(self_ty);
195195
self.push_extension_candidates();
196196

197-
let mut enum_dids = ~[];
198197
let mut self_ty = self_ty;
199198
let mut autoderefs = 0;
200199
loop {
@@ -236,7 +235,7 @@ impl<'self> LookupContext<'self> {
236235
}
237236

238237
// Otherwise, perform autoderef.
239-
match self.deref(self_ty, &mut enum_dids) {
238+
match self.deref(self_ty) {
240239
None => { break; }
241240
Some(ty) => {
242241
self_ty = ty;
@@ -248,20 +247,8 @@ impl<'self> LookupContext<'self> {
248247
self.search_for_autosliced_method(self_ty, autoderefs)
249248
}
250249

251-
pub fn deref(&self, ty: ty::t, enum_dids: &mut ~[ast::def_id])
250+
pub fn deref(&self, ty: ty::t)
252251
-> Option<ty::t> {
253-
match ty::get(ty).sty {
254-
ty_enum(did, _) => {
255-
// Watch out for newtype'd enums like "enum t = @T".
256-
// See discussion in typeck::check::do_autoderef().
257-
if enum_dids.iter().any(|x| x == &did) {
258-
return None;
259-
}
260-
enum_dids.push(did);
261-
}
262-
_ => {}
263-
}
264-
265252
match ty::deref(self.tcx(), ty, false) {
266253
None => None,
267254
Some(t) => {
@@ -285,7 +272,6 @@ impl<'self> LookupContext<'self> {
285272
* we'll want to find the inherent impls for `C`.
286273
*/
287274

288-
let mut enum_dids = ~[];
289275
let mut self_ty = self_ty;
290276
loop {
291277
match get(self_ty).sty {
@@ -314,7 +300,7 @@ impl<'self> LookupContext<'self> {
314300
// n.b.: Generally speaking, we only loop if we hit the
315301
// fallthrough case in the match above. The exception
316302
// would be newtype enums.
317-
self_ty = match self.deref(self_ty, &mut enum_dids) {
303+
self_ty = match self.deref(self_ty) {
318304
None => { return; }
319305
Some(ty) => { ty }
320306
}

0 commit comments

Comments
 (0)