@@ -25,20 +25,20 @@ fn transform_self_type_for_method(fcx: @fn_ctxt,
25
25
method_info : MethodInfo )
26
26
-> ty:: t {
27
27
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
+ }
42
42
}
43
43
}
44
44
@@ -96,21 +96,21 @@ class lookup {
96
96
match get_base_type_def_id ( self . fcx . infcx ,
97
97
self . self_expr . span ,
98
98
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" } ;
113
112
}
113
+ }
114
114
}
115
115
116
116
loop {
@@ -462,52 +462,52 @@ class lookup {
462
462
463
463
// Add inherent methods.
464
464
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) ;
479
478
}
479
+ }
480
480
}
481
481
482
482
// Add trait methods.
483
483
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) ;
508
506
}
507
+ }
509
508
}
510
509
}
510
+ }
511
511
}
512
512
}
513
513
@@ -531,7 +531,7 @@ class lookup {
531
531
// required receiver type (cand.rcvr_ty). If this method is not
532
532
// from an impl, this'll basically be a no-nop.
533
533
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 ) {
535
535
result:: ok( _) => ( ) ,
536
536
result:: err( _) => {
537
537
self . tcx ( ) . sess . span_bug (
0 commit comments