@@ -231,11 +231,11 @@ fn ensure_trait_methods(ccx: @crate_ctxt, id: ast::node_id, trait_ty: ty::t) {
231
231
let trait_bounds = ty_param_bounds ( ccx, params) ;
232
232
let ty_m = trait_method_to_ty_method ( * m) ;
233
233
let method_ty = ty_of_ty_method ( ccx, ty_m, region_paramd, def_id) ;
234
- if ty_m. self_ty . node == ast:: sty_static {
235
- make_static_method_ty ( ccx, ty_m, region_paramd,
236
- method_ty, trait_ty,
237
- trait_bounds) ;
238
- }
234
+ if ty_m. self_ty . node == ast:: sty_static {
235
+ make_static_method_ty ( ccx, ty_m, region_paramd,
236
+ method_ty, trait_ty,
237
+ trait_bounds) ;
238
+ }
239
239
method_ty
240
240
} ) ;
241
241
}
@@ -423,21 +423,21 @@ fn check_methods_against_trait(ccx: @crate_ctxt,
423
423
let (did, tpt) = instantiate_trait_ref(ccx, a_trait_ty, rp);
424
424
425
425
if did.crate == ast::local_crate {
426
- // NB: This is subtle. We need to do this on the type of the trait
427
- // item *itself*, not on the type that includes the parameter
428
- // substitutions provided by the programmer at this particular
429
- // trait ref. Otherwise, we will potentially overwrite the types of
430
- // the methods within the trait with bogus results. (See issue #3903.)
431
-
432
- match tcx.items.find(did.node) {
433
- Some(ast_map::node_item(item, _)) => {
434
- let tpt = ty_of_item(ccx, item);
435
- ensure_trait_methods(ccx, did.node, tpt.ty);
436
- }
437
- _ => {
438
- tcx.sess.bug(~"trait ref didn' t resolve to trait ");
439
- }
440
- }
426
+ // NB: This is subtle. We need to do this on the type of the trait
427
+ // item *itself*, not on the type that includes the parameter
428
+ // substitutions provided by the programmer at this particular
429
+ // trait ref. Otherwise, we will potentially overwrite the types of
430
+ // the methods within the trait with bogus results. (See issue #3903.)
431
+
432
+ match tcx.items.find(did.node) {
433
+ Some(ast_map::node_item(item, _)) => {
434
+ let tpt = ty_of_item(ccx, item);
435
+ ensure_trait_methods(ccx, did.node, tpt.ty);
436
+ }
437
+ _ => {
438
+ tcx.sess.bug(~"trait ref didn' t resolve to trait ");
439
+ }
440
+ }
441
441
}
442
442
443
443
for vec::each(*ty::trait_methods(tcx, did)) |trait_m| {
0 commit comments