@@ -12,16 +12,16 @@ type path = [path_elt];
1212fn path_to_str_with_sep ( p : path , sep : str ) -> str {
1313 let strs = vec:: map ( p) { |e|
1414 alt e {
15- path_mod( s) { s }
16- path_name ( s) { s }
15+ path_mod( s) { /* FIXME: bad */ copy s }
16+ path_name ( s) { /* FIXME: bad */ copy s }
1717 }
1818 } ;
1919 str:: connect ( strs, sep)
2020}
2121
2222fn path_ident_to_str ( p : path , i : ident ) -> str {
2323 if vec:: is_empty ( p) {
24- i
24+ /* FIXME: bad */ copy i
2525 } else {
2626 #fmt[ "%s::%s" , path_to_str ( p) , i]
2727 }
@@ -59,7 +59,7 @@ type ctx = {map: map, mut path: path,
5959 mut local_id : uint , diag : span_handler } ;
6060type vt = visit:: vt < ctx > ;
6161
62- fn extend ( cx : ctx , elt : str ) -> @path {
62+ fn extend ( cx : ctx , + elt : str ) -> @path {
6363 @( cx . path + [ path_name ( elt ) ] )
6464}
6565
@@ -89,15 +89,15 @@ fn map_crate(diag: span_handler, c: crate) -> map {
8989// crate. The `path` should be the path to the item but should not include
9090// the item itself.
9191fn map_decoded_item ( diag : span_handler ,
92- map : map , path : path , ii : inlined_item ) {
92+ map : map , + path : path, ii : inlined_item ) {
9393 // I believe it is ok for the local IDs of inlined items from other crates
9494 // to overlap with the local ids from this crate, so just generate the ids
9595 // starting from 0. (In particular, I think these ids are only used in
9696 // alias analysis, which we will not be running on the inlined items, and
9797 // even if we did I think it only needs an ordering between local
9898 // variables that are simultaneously in scope).
9999 let cx = { map: map,
100- mut path: path ,
100+ mut path: /* FIXME: bad */ copy path,
101101 mut local_id: 0 u ,
102102 diag : diag } ;
103103 let v = mk_ast_map_visitor ( ) ;
@@ -123,21 +123,27 @@ fn map_decoded_item(diag: span_handler,
123123fn map_fn ( fk : visit:: fn_kind , decl : fn_decl , body : blk ,
124124 sp : codemap:: span , id : node_id , cx : ctx , v : vt ) {
125125 for decl. inputs. each { |a|
126- cx. map. insert( a. id, node_arg( a, cx. local_id) ) ;
126+ cx. map. insert( a. id, node_arg( /* FIXME: bad */ copy a, cx. local_id) ) ;
127127 cx. local_id += 1 u;
128128 }
129129 alt fk {
130130 visit : : fk_ctor ( nm, tps, self_id, parent_id) {
131- let ct = @{ node : { id : id, self_id : self_id,
132- dec : decl, body : body} ,
131+ let ct = @{ node : { id : id,
132+ self_id : self_id,
133+ dec : /* FIXME: bad */ copy decl,
134+ body : /* FIXME: bad */ copy body} ,
133135 span: sp} ;
134- cx. map . insert ( id, node_ctor ( nm, tps, class_ctor ( ct, parent_id) ,
135- @cx. path ) ) ;
136+ cx. map . insert ( id, node_ctor ( /* FIXME: bad */ copy nm,
137+ /* FIXME: bad */ copy tps,
138+ class_ctor ( ct, parent_id) ,
139+ @/* FIXME : bad * / copy cx. path ) ) ;
136140 }
137141 visit:: fk_dtor ( tps, self_id, parent_id) {
138- let dt = @{ node : { id : id, self_id : self_id, body : body} ,
139- span: sp} ;
140- cx. map . insert ( id, node_dtor ( tps, dt, parent_id, @cx. path ) ) ;
142+ let dt = @{ node : { id : id, self_id : self_id,
143+ body : /* FIXME: bad */ copy body} , span: sp} ;
144+ cx. map . insert ( id, node_dtor ( /* FIXME: bad */ copy tps, dt,
145+ parent_id,
146+ @/* FIXME : bad * / copy cx. path ) ) ;
141147 }
142148
143149 _ { }
@@ -146,7 +152,7 @@ fn map_fn(fk: visit::fn_kind, decl: fn_decl, body: blk,
146152}
147153
148154fn map_block ( b : blk , cx : ctx , v : vt ) {
149- cx. map . insert ( b. node . id , node_block ( b) ) ;
155+ cx. map . insert ( b. node . id , node_block ( /* FIXME: bad */ copy b) ) ;
150156 visit:: visit_block ( b, cx, v) ;
151157}
152158
@@ -180,25 +186,29 @@ fn map_method(impl_did: def_id, impl_path: @path,
180186}
181187
182188fn map_item ( i : @item, cx : ctx , v : vt ) {
183- let item_path = @cx. path ;
189+ let item_path = @/ * FIXME : bad * / copy cx. path ;
184190 cx. map . insert ( i. id , node_item ( i, item_path) ) ;
185191 alt i. node {
186192 item_impl ( _, _, _, _, ms) {
187193 let impl_did = ast_util:: local_def ( i. id ) ;
188194 for ms. each { |m|
189- map_method( impl_did, extend( cx, i. ident) , m, cx) ;
195+ map_method( impl_did, extend( cx, /* FIXME: bad */ copy i. ident) , m,
196+ cx) ;
190197 }
191198 }
192199 item_res ( decl, tps, _, dtor_id, ctor_id, _) {
193- cx. map . insert ( ctor_id, node_ctor ( i. ident , tps,
194- res_ctor ( decl, ctor_id, i. span ) ,
200+ cx. map . insert ( ctor_id, node_ctor ( /* FIXME: bad */ copy i. ident ,
201+ /* FIXME: bad */ copy tps,
202+ res_ctor ( /* FIXME: bad */ copy decl,
203+ ctor_id, i. span ) ,
195204 item_path) ) ;
196205 cx. map . insert ( dtor_id, node_item ( i, item_path) ) ;
197206 }
198207 item_enum ( vs, _, _) {
199208 for vs. each { |v|
200209 cx. map. insert( v. node. id, node_variant(
201- v, i, extend( cx, i. ident) ) ) ;
210+ /* FIXME: bad */ copy v, i,
211+ extend( cx, /* FIXME: bad */ copy i. ident) ) ) ;
202212 }
203213 }
204214 item_native_mod ( nm) {
@@ -207,7 +217,9 @@ fn map_item(i: @item, cx: ctx, v: vt) {
207217 either:: right ( abi) { abi }
208218 } ;
209219 for nm. items. each { |nitem|
210- cx. map. insert( nitem. id, node_native_item( nitem, abi, @cx. path) ) ;
220+ cx. map. insert( nitem. id,
221+ node_native_item( nitem, abi,
222+ @/* FIXME: bad */ copy cx. path) ) ;
211223 }
212224 }
213225 item_class ( tps, ifces, items, ctor, dtor, _) {
@@ -217,17 +229,17 @@ fn map_item(i: @item, cx: ctx, v: vt) {
217229 vec:: iter ( ifces) { |p| cx. map . insert ( p. id ,
218230 node_item ( i, item_path) ) ; } ;
219231 let d_id = ast_util:: local_def ( i. id ) ;
220- let p = extend ( cx, i. ident ) ;
232+ let p = extend ( cx, /* FIXME: bad */ copy i. ident ) ;
221233 // only need to handle methods
222234 vec:: iter ( ms) { |m| map_method ( d_id, p, m, cx) ; }
223235 }
224236 _ { }
225237 }
226238 alt i. node {
227239 item_mod ( _) | item_native_mod ( _) {
228- cx. path += [ path_mod ( i. ident ) ] ;
240+ cx. path += [ path_mod ( /* FIXME: bad */ copy i. ident ) ] ;
229241 }
230- _ { cx. path += [ path_name ( i. ident ) ] ; }
242+ _ { cx. path += [ path_name ( /* FIXME: bad */ copy i. ident ) ] ; }
231243 }
232244 visit:: visit_item ( i, cx, v) ;
233245 vec:: pop ( cx. path ) ;
@@ -238,7 +250,7 @@ fn map_view_item(vi: @view_item, cx: ctx, _v: vt) {
238250 view_item_export ( vps) {
239251 for vps. each { |vp|
240252 let ( id, name) = alt vp. node {
241- view_path_simple( nm, _, id) { ( id, nm) }
253+ view_path_simple( nm, _, id) { ( id, /* FIXME: bad */ copy nm) }
242254 view_path_glob( pth, id) | view_path_list( pth, _, id) {
243255 ( id, path_to_ident( pth) )
244256 }
0 commit comments