@@ -854,15 +854,16 @@ fn encode_side_tables_for_id(ecx: @e::EncodeContext,
854
854
855
855
debug!(" Encoding side tables for id %d", id);
856
856
857
- do option::iter(& tcx.def_map.find(&id)) |def| {
857
+ for tcx.def_map.find(&id).each |def| {
858
858
do ebml_w.tag(c::tag_table_def) {
859
859
ebml_w.id(id);
860
860
do ebml_w.tag(c::tag_table_val) {
861
861
(*def).encode(&ebml_w)
862
862
}
863
863
}
864
864
}
865
- do option::iter(&tcx.node_types.find(&(id as uint))) |&ty| {
865
+
866
+ for tcx.node_types.find(&(id as uint)).each |&ty| {
866
867
do ebml_w.tag(c::tag_table_node_type) {
867
868
ebml_w.id(id);
868
869
do ebml_w.tag(c::tag_table_val) {
@@ -871,7 +872,7 @@ fn encode_side_tables_for_id(ecx: @e::EncodeContext,
871
872
}
872
873
}
873
874
874
- do option::iter(& tcx.node_type_substs.find(&id)) |tys| {
875
+ for tcx.node_type_substs.find(&id).each |tys| {
875
876
do ebml_w.tag(c::tag_table_node_type_subst) {
876
877
ebml_w.id(id);
877
878
do ebml_w.tag(c::tag_table_val) {
@@ -880,7 +881,7 @@ fn encode_side_tables_for_id(ecx: @e::EncodeContext,
880
881
}
881
882
}
882
883
883
- do option::iter(& tcx.freevars.find(&id)) |fv| {
884
+ for tcx.freevars.find(&id).each |fv| {
884
885
do ebml_w.tag(c::tag_table_freevars) {
885
886
ebml_w.id(id);
886
887
do ebml_w.tag(c::tag_table_val) {
@@ -892,7 +893,7 @@ fn encode_side_tables_for_id(ecx: @e::EncodeContext,
892
893
}
893
894
894
895
let lid = ast::def_id { crate: ast::local_crate, node: id };
895
- do option::iter(& tcx.tcache.find(&lid)) |tpbt| {
896
+ for tcx.tcache.find(&lid).each |tpbt| {
896
897
do ebml_w.tag(c::tag_table_tcache) {
897
898
ebml_w.id(id);
898
899
do ebml_w.tag(c::tag_table_val) {
@@ -901,7 +902,7 @@ fn encode_side_tables_for_id(ecx: @e::EncodeContext,
901
902
}
902
903
}
903
904
904
- do option::iter(& tcx.ty_param_bounds.find(&id)) |pbs| {
905
+ for tcx.ty_param_bounds.find(&id).each |pbs| {
905
906
do ebml_w.tag(c::tag_table_param_bounds) {
906
907
ebml_w.id(id);
907
908
do ebml_w.tag(c::tag_table_val) {
@@ -915,7 +916,7 @@ fn encode_side_tables_for_id(ecx: @e::EncodeContext,
915
916
// is what we actually use in trans, all modes will have been
916
917
// resolved.
917
918
//
918
- //option::iter( tcx.inferred_modes.find(&id)) { |m|
919
+ //for tcx.inferred_modes.find(&id).each |m| {
919
920
// ebml_w.tag(c::tag_table_inferred_modes) {||
920
921
// ebml_w.id(id);
921
922
// ebml_w.tag(c::tag_table_val) {||
@@ -924,13 +925,13 @@ fn encode_side_tables_for_id(ecx: @e::EncodeContext,
924
925
// }
925
926
//}
926
927
927
- do option::iter(& maps.mutbl_map.find (&id)) |_m| {
928
+ if maps.mutbl_map.contains_key (&id) {
928
929
do ebml_w.tag(c::tag_table_mutbl) {
929
930
ebml_w.id(id);
930
931
}
931
932
}
932
933
933
- do option::iter(& maps.last_use_map.find(&id)) |m| {
934
+ for maps.last_use_map.find(&id).each |m| {
934
935
do ebml_w.tag(c::tag_table_last_use) {
935
936
ebml_w.id(id);
936
937
do ebml_w.tag(c::tag_table_val) {
@@ -941,7 +942,7 @@ fn encode_side_tables_for_id(ecx: @e::EncodeContext,
941
942
}
942
943
}
943
944
944
- do option::iter(& maps.method_map.find(&id)) |mme| {
945
+ for maps.method_map.find(&id).each |mme| {
945
946
do ebml_w.tag(c::tag_table_method_map) {
946
947
ebml_w.id(id);
947
948
do ebml_w.tag(c::tag_table_val) {
@@ -950,7 +951,7 @@ fn encode_side_tables_for_id(ecx: @e::EncodeContext,
950
951
}
951
952
}
952
953
953
- do option::iter(& maps.vtable_map.find(&id)) |dr| {
954
+ for maps.vtable_map.find(&id).each |dr| {
954
955
do ebml_w.tag(c::tag_table_vtable_map) {
955
956
ebml_w.id(id);
956
957
do ebml_w.tag(c::tag_table_val) {
@@ -959,7 +960,7 @@ fn encode_side_tables_for_id(ecx: @e::EncodeContext,
959
960
}
960
961
}
961
962
962
- do option::iter(& tcx.adjustments.find(&id)) |adj| {
963
+ for tcx.adjustments.find(&id).each |adj| {
963
964
do ebml_w.tag(c::tag_table_adjustments) {
964
965
ebml_w.id(id);
965
966
do ebml_w.tag(c::tag_table_val) {
0 commit comments