Skip to content

Commit cba1cab

Browse files
committed
---
yaml --- r: 31694 b: refs/heads/dist-snap c: efea6f0 h: refs/heads/master v: v3
1 parent e9e7620 commit cba1cab

File tree

2 files changed

+68
-68
lines changed

2 files changed

+68
-68
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: e656261ee7ff7cfd301c0d7c31cdc969e3bdbfeb
10+
refs/heads/dist-snap: efea6f016eacf258e7b6bdaa960a39b3e7f91fa5
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: 67 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,20 @@ fn transform_self_type_for_method(fcx: @fn_ctxt,
2525
method_info: MethodInfo)
2626
-> ty::t {
2727
match method_info.self_type {
28-
sty_by_ref | sty_value => {
29-
impl_ty
30-
}
31-
sty_region(r, mutability) => {
32-
// XXX: dummy_sp is unfortunate here.
33-
let region = ast_region_to_region(fcx, fcx, dummy_sp(), r);
34-
mk_rptr(fcx.ccx.tcx, region, { ty: impl_ty, mutbl: mutability })
35-
}
36-
sty_box(mutability) => {
37-
mk_box(fcx.ccx.tcx, { ty: impl_ty, mutbl: mutability })
38-
}
39-
sty_uniq(mutability) => {
40-
mk_uniq(fcx.ccx.tcx, { ty: impl_ty, mutbl: mutability })
41-
}
28+
sty_by_ref | sty_value => {
29+
impl_ty
30+
}
31+
sty_region(r, mutability) => {
32+
// XXX: dummy_sp is unfortunate here.
33+
let region = ast_region_to_region(fcx, fcx, dummy_sp(), r);
34+
mk_rptr(fcx.ccx.tcx, region, { ty: impl_ty, mutbl: mutability })
35+
}
36+
sty_box(mutability) => {
37+
mk_box(fcx.ccx.tcx, { ty: impl_ty, mutbl: mutability })
38+
}
39+
sty_uniq(mutability) => {
40+
mk_uniq(fcx.ccx.tcx, { ty: impl_ty, mutbl: mutability })
41+
}
4242
}
4343
}
4444

@@ -96,21 +96,21 @@ class lookup {
9696
match get_base_type_def_id(self.fcx.infcx,
9797
self.self_expr.span,
9898
self.self_ty) {
99-
none => {
100-
optional_inherent_methods = none;
101-
}
102-
some(base_type_def_id) => {
103-
debug!{"(checking method) found base type"};
104-
optional_inherent_methods =
105-
self.fcx.ccx.coherence_info.inherent_methods.find
106-
(base_type_def_id);
107-
108-
if optional_inherent_methods.is_none() {
109-
debug!{"(checking method) ... no inherent methods found"};
110-
} else {
111-
debug!{"(checking method) ... inherent methods found"};
112-
}
99+
none => {
100+
optional_inherent_methods = none;
101+
}
102+
some(base_type_def_id) => {
103+
debug!{"(checking method) found base type"};
104+
optional_inherent_methods =
105+
self.fcx.ccx.coherence_info.inherent_methods.find
106+
(base_type_def_id);
107+
108+
if optional_inherent_methods.is_none() {
109+
debug!{"(checking method) ... no inherent methods found"};
110+
} else {
111+
debug!{"(checking method) ... inherent methods found"};
113112
}
113+
}
114114
}
115115

116116
loop {
@@ -462,52 +462,52 @@ class lookup {
462462

463463
// Add inherent methods.
464464
match optional_inherent_methods {
465-
none => {
466-
// Continue.
467-
}
468-
some(inherent_methods) => {
469-
debug!{"(adding inherent and extension candidates) adding \
470-
inherent candidates"};
471-
for inherent_methods.each |implementation| {
472-
debug!{"(adding inherent and extension candidates) \
473-
adding candidates from impl: %s",
474-
node_id_to_str(self.tcx().items,
475-
implementation.did.node)};
476-
self.add_candidates_from_impl(implementation,
477-
use_assignability);
478-
}
465+
none => {
466+
// Continue.
467+
}
468+
some(inherent_methods) => {
469+
debug!{"(adding inherent and extension candidates) adding \
470+
inherent candidates"};
471+
for inherent_methods.each |implementation| {
472+
debug!{"(adding inherent and extension candidates) \
473+
adding candidates from impl: %s",
474+
node_id_to_str(self.tcx().items,
475+
implementation.did.node)};
476+
self.add_candidates_from_impl(implementation,
477+
use_assignability);
479478
}
479+
}
480480
}
481481

482482
// Add trait methods.
483483
match self.fcx.ccx.trait_map.find(self.expr.id) {
484-
none => {
485-
// Should only happen for placement new right now.
486-
}
487-
some(trait_ids) => {
488-
for (*trait_ids).each |trait_id| {
489-
debug!{"(adding inherent and extension candidates) \
490-
trying trait: %s",
491-
self.def_id_to_str(trait_id)};
492-
493-
let coherence_info = self.fcx.ccx.coherence_info;
494-
match coherence_info.extension_methods.find(trait_id) {
495-
none => {
496-
// Do nothing.
497-
}
498-
some(extension_methods) => {
499-
for extension_methods.each |implementation| {
500-
debug!{"(adding inherent and extension \
501-
candidates) adding impl %s",
502-
self.def_id_to_str
503-
(implementation.did)};
504-
self.add_candidates_from_impl
505-
(implementation, use_assignability);
506-
}
507-
}
484+
none => {
485+
// Should only happen for placement new right now.
486+
}
487+
some(trait_ids) => {
488+
for (*trait_ids).each |trait_id| {
489+
debug!{"(adding inherent and extension candidates) \
490+
trying trait: %s",
491+
self.def_id_to_str(trait_id)};
492+
493+
let coherence_info = self.fcx.ccx.coherence_info;
494+
match coherence_info.extension_methods.find(trait_id) {
495+
none => {
496+
// Do nothing.
497+
}
498+
some(extension_methods) => {
499+
for extension_methods.each |implementation| {
500+
debug!{"(adding inherent and extension \
501+
candidates) adding impl %s",
502+
self.def_id_to_str
503+
(implementation.did)};
504+
self.add_candidates_from_impl
505+
(implementation, use_assignability);
508506
}
507+
}
509508
}
510509
}
510+
}
511511
}
512512
}
513513

@@ -531,7 +531,7 @@ class lookup {
531531
// required receiver type (cand.rcvr_ty). If this method is not
532532
// from an impl, this'll basically be a no-nop.
533533
match self.fcx.mk_assignty(self.self_expr, self.borrow_lb,
534-
cand.self_ty, cand.rcvr_ty) {
534+
cand.self_ty, cand.rcvr_ty) {
535535
result::ok(_) => (),
536536
result::err(_) => {
537537
self.tcx().sess.span_bug(

0 commit comments

Comments
 (0)