@@ -280,30 +280,42 @@ pub fn create_function_metadata(fcx: fn_ctxt) -> DISubprogram {
280
280
281
281
let fnitem = cx. tcx . items . get_copy ( & fcx. id ) ;
282
282
let ( ident, ret_ty, id) = match fnitem {
283
- ast_map:: node_item( ref item, _) => {
284
- match item. node {
285
- ast:: item_fn( ast:: fn_decl { output : ref ty, _} , _, _, _, _) => {
286
- ( item. ident , ty, item. id )
287
- }
288
- _ => fcx. ccx . sess . span_bug ( item. span ,
289
- "create_function_metadata: item bound to non-function" )
283
+ ast_map:: node_item( ref item, _) => {
284
+ match item. node {
285
+ ast:: item_fn( ast:: fn_decl { output : ref ty, _} , _, _, _, _) => {
286
+ ( item. ident , ty, item. id )
287
+ }
288
+ _ => fcx. ccx . sess . span_bug ( item. span ,
289
+ "create_function_metadata: item bound to non-function" )
290
+ }
290
291
}
291
- }
292
- ast_map:: node_method( @ast:: method { decl : ast:: fn_decl { output : ref ty, _ } ,
293
- id : id, ident : ident, _} , _, _) => {
294
- ( ident, ty, id)
295
- }
296
- ast_map:: node_expr( ref expr) => {
297
- match expr. node {
298
- ast:: expr_fn_block( ref decl, _) => {
299
- let name = gensym_name ( "fn" ) ;
300
- ( name, & decl. output , expr. id )
301
- }
302
- _ => fcx. ccx . sess . span_bug ( expr. span ,
303
- "create_function_metadata: expected an expr_fn_block here" )
292
+ ast_map:: node_method( @ast:: method { decl : ast:: fn_decl { output : ref ty, _ } ,
293
+ id : id, ident : ident, _} , _, _) => {
294
+ ( ident, ty, id)
304
295
}
305
- }
306
- _ => fcx. ccx . sess . bug ( "create_function_metadata: unexpected sort of node" )
296
+ ast_map:: node_expr( ref expr) => {
297
+ match expr. node {
298
+ ast:: expr_fn_block( ref decl, _) => {
299
+ let name = gensym_name ( "fn" ) ;
300
+ ( name, & decl. output , expr. id )
301
+ }
302
+ _ => fcx. ccx . sess . span_bug ( expr. span ,
303
+ "create_function_metadata: expected an expr_fn_block here" )
304
+ }
305
+ }
306
+ ast_map:: node_trait_method(
307
+ @ast:: provided(
308
+ @ast:: method {
309
+ decl : ast:: fn_decl { output : ref ty, _ } ,
310
+ id : id,
311
+ ident : ident,
312
+ _}
313
+ ) ,
314
+ _def_id,
315
+ _path) => {
316
+ ( ident, ty, id)
317
+ }
318
+ _ => fcx. ccx . sess . bug ( "create_function_metadata: unexpected sort of node" )
307
319
} ;
308
320
309
321
match dbg_cx ( cx) . created_functions . find ( & id) {
0 commit comments