@@ -1680,7 +1680,7 @@ fn make_cmp_glue(cx: &@block_ctxt, lhs0: ValueRef, rhs0: ValueRef, t: &ty::t,
1680
1680
}
1681
1681
1682
1682
1683
- // Used only for creating scalar comparsion glue.
1683
+ // Used only for creating scalar comparison glue.
1684
1684
tag scalar_type { nil_type; signed_int; unsigned_int; floating_point; }
1685
1685
1686
1686
@@ -5662,19 +5662,14 @@ fn trans_anon_obj(bcx: @block_ctxt, sp: &span, anon_obj: &ast::anon_obj,
5662
5662
let vtbl;
5663
5663
alt anon_obj. inner_obj {
5664
5664
none. {
5665
- // If there's no inner_obj -- that is, if we're just adding new
5666
- // fields rather than extending an existing object -- then we just
5667
- // pass the outer object to create_vtbl(). Our vtable won't need
5668
- // to have any forwarding slots.
5669
-
5670
5665
// We need a dummy inner_obj_ty for setting up the object body
5671
5666
// later.
5672
5667
inner_obj_ty = ty:: mk_type ( ccx. tcx ) ;
5673
5668
5674
- // This seems a little strange, because it'll come into
5675
- // create_vtbl() with no "additional methods". What's happening
5676
- // is that, since *all* of the methods are "additional", we can
5677
- // get away with acting like none of them are .
5669
+ // If there's no inner_obj -- that is, if we're just adding new
5670
+ // fields rather than extending an existing object -- then we just
5671
+ // pass the outer object to create_vtbl(). Our vtable won't need
5672
+ // to have any forwarding slots .
5678
5673
vtbl =
5679
5674
create_vtbl ( bcx. fcx . lcx , sp, outer_obj_ty, wrapper_obj, ~[ ] , none,
5680
5675
additional_field_tys) ;
@@ -6770,19 +6765,19 @@ fn create_vtbl(cx: @local_ctxt, sp: &span, outer_obj_ty: ty::t,
6770
6765
some( inner_obj_ty) {
6771
6766
// Handle forwarding slots.
6772
6767
6773
- // If this vtable is being created for an extended object, then
6774
- // the vtable needs to contain 'forwarding slots' for methods that
6775
- // were on the original object and are not being overloaded by the
6776
- // extended one. So, to find the set of methods that we need
6777
- // forwarding slots for, we need to take the set difference of
6778
- // inner_obj_methods (methods on the original object) and
6779
- // ob.methods (methods on the object being added).
6768
+ // If this vtable is being created for an extended object, then the
6769
+ // vtable needs to contain 'forwarding slots' for methods that were on
6770
+ // the original object and are not being overloaded by the extended
6771
+ // one. So, to find the set of methods that we need forwarding slots
6772
+ // for, we need to take the set difference of inner_obj_methods
6773
+ // (methods on the original object) and ob.methods (methods on the
6774
+ // object being added).
6780
6775
6781
- // If we're here, then inner_obj_ty and llinner_obj_ty are the type
6782
- // of the inner object, and "ob" is the wrapper object. We need
6783
- // to take apart inner_obj_ty (it had better have an object type
6784
- // with methods!) and put those original methods onto the list of
6785
- // methods we need forwarding methods for.
6776
+ // If we're here, then inner_obj_ty and llinner_obj_ty are the type of
6777
+ // the inner object, and "ob" is the wrapper object. We need to take
6778
+ // apart inner_obj_ty (it had better have an object type with
6779
+ // methods!) and put those original methods onto the list of methods
6780
+ // we need forwarding methods for.
6786
6781
6787
6782
// Gather up methods on the original object in 'meths'.
6788
6783
alt ty:: struct ( cx. ccx . tcx , inner_obj_ty) {
@@ -6806,12 +6801,11 @@ fn create_vtbl(cx: @local_ctxt, sp: &span, outer_obj_ty: ty::t,
6806
6801
6807
6802
alt m {
6808
6803
fwding_mthd( fm) {
6809
- // Since fm is a fwding_mthd, and we're checking to
6810
- // see if it's in addtl_meths (which only contains
6811
- // normal_mthds), we can't just check if fm is a
6812
- // member of addtl_meths. Instead, we have to go
6813
- // through addtl_meths and see if there's some method
6814
- // in it that has the same name as fm.
6804
+ // Since fm is a fwding_mthd, and we're checking to see if
6805
+ // it's in addtl_meths (which only contains normal_mthds), we
6806
+ // can't just check if fm is a member of addtl_meths.
6807
+ // Instead, we have to go through addtl_meths and see if
6808
+ // there's some method in it that has the same name as fm.
6815
6809
for am: @ast:: method in addtl_meths {
6816
6810
if str:: eq ( am. node . ident , fm. ident ) { ret none; }
6817
6811
}
@@ -6828,8 +6822,8 @@ fn create_vtbl(cx: @local_ctxt, sp: &span, outer_obj_ty: ty::t,
6828
6822
meths = std:: ivec:: filter_map[ vtbl_mthd, vtbl_mthd] ( f, meths) ;
6829
6823
6830
6824
6831
- // And now add the additional ones (both replacements and entirely
6832
- // new ones). These'll just be normal methods.
6825
+ // And now add the additional ones (both replacements and entirely new
6826
+ // ones). These'll just be normal methods.
6833
6827
for m: @ast:: method in ob. methods { meths += ~[ normal_mthd ( m) ] ; }
6834
6828
}
6835
6829
}
0 commit comments