Skip to content

Commit 3c71973

Browse files
committed
---
yaml --- r: 27883 b: refs/heads/try c: 2b3c86c h: refs/heads/master i: 27881: 3d922f9 27879: b57b80a v: v3
1 parent 9f6bbac commit 3c71973

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
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: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
5-
refs/heads/try: 6f441e8fde85aac3321b1aad42eaa25d88d0a716
5+
refs/heads/try: 2b3c86cb02803e569d4f5b6891d439c9daa0b90a
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,11 @@ struct lookup {
174174
(optional_inherent_methods, subtyping_mode);
175175

176176
// if we found anything, stop before trying borrows
177-
if self.candidates.len() > 0u { break; }
177+
if self.candidates.len() > 0u {
178+
debug!{"(checking method) found at least one inherent \
179+
method; giving up looking now"};
180+
break;
181+
}
178182

179183
// Again, look for inherent and extension methods, this time using
180184
// assignability.
@@ -198,7 +202,11 @@ struct lookup {
198202
(optional_inherent_methods, mutable_reference_mode);
199203

200204
// if we found anything, stop before attempting auto-deref.
201-
if self.candidates.len() > 0u { break; }
205+
if self.candidates.len() > 0u {
206+
debug!{"(checking method) found at least one inherent \
207+
method; giving up looking now"};
208+
break;
209+
}
202210

203211
// check whether we can autoderef and if so loop around again.
204212
match ty::deref(self.tcx(), self.self_ty, false) {
@@ -210,7 +218,11 @@ struct lookup {
210218
}
211219
}
212220

213-
if self.candidates.len() == 0u { return none; }
221+
if self.candidates.len() == 0u {
222+
debug!{"(checking method) couldn't find any candidate methods; \
223+
returning none"};
224+
return none;
225+
}
214226

215227
if self.candidates.len() > 1u {
216228
self.tcx().sess.span_err(
@@ -270,7 +282,7 @@ struct lookup {
270282
}
271283

272284
fn add_candidates_from_param(n: uint, did: ast::def_id) {
273-
debug!{"candidates_from_param"};
285+
debug!{"add_candidates_from_param"};
274286

275287
let tcx = self.tcx();
276288
let mut trait_bnd_idx = 0u; // count only trait bounds
@@ -320,7 +332,7 @@ struct lookup {
320332

321333
fn add_candidates_from_trait(did: ast::def_id, trait_substs: ty::substs) {
322334

323-
debug!{"method_from_trait"};
335+
debug!{"add_candidates_from_trait"};
324336

325337
let ms = *ty::trait_methods(self.tcx(), did);
326338
for ms.eachi |i, m| {
@@ -355,7 +367,7 @@ struct lookup {
355367

356368
fn add_candidates_from_class(did: ast::def_id, class_substs: ty::substs) {
357369

358-
debug!{"method_from_class"};
370+
debug!{"add_candidates_from_class"};
359371

360372
let ms = *ty::trait_methods(self.tcx(), did);
361373

0 commit comments

Comments
 (0)