@@ -336,121 +336,123 @@ pub struct DummyCrateStore;
336
336
#[ allow( unused_variables) ]
337
337
impl < ' tcx > CrateStore < ' tcx > for DummyCrateStore {
338
338
// item info
339
- fn stability ( & self , def : DefId ) -> Option < attr:: Stability > { unimplemented ! ( ) }
340
- fn deprecation ( & self , def : DefId ) -> Option < attr:: Deprecation > { unimplemented ! ( ) }
341
- fn visibility ( & self , def : DefId ) -> hir:: Visibility { unimplemented ! ( ) }
339
+ fn stability ( & self , def : DefId ) -> Option < attr:: Stability > { bug ! ( "stability" ) }
340
+ fn deprecation ( & self , def : DefId ) -> Option < attr:: Deprecation > { bug ! ( "deprecation" ) }
341
+ fn visibility ( & self , def : DefId ) -> hir:: Visibility { bug ! ( "visibility" ) }
342
342
fn closure_kind ( & self , tcx : & TyCtxt < ' tcx > , def_id : DefId )
343
- -> ty:: ClosureKind { unimplemented ! ( ) }
343
+ -> ty:: ClosureKind { bug ! ( "closure_kind" ) }
344
344
fn closure_ty ( & self , tcx : & TyCtxt < ' tcx > , def_id : DefId )
345
- -> ty:: ClosureTy < ' tcx > { unimplemented ! ( ) }
346
- fn item_variances ( & self , def : DefId ) -> ty:: ItemVariances { unimplemented ! ( ) }
347
- fn repr_attrs ( & self , def : DefId ) -> Vec < attr:: ReprAttr > { unimplemented ! ( ) }
345
+ -> ty:: ClosureTy < ' tcx > { bug ! ( "closure_ty" ) }
346
+ fn item_variances ( & self , def : DefId ) -> ty:: ItemVariances { bug ! ( "item_variances" ) }
347
+ fn repr_attrs ( & self , def : DefId ) -> Vec < attr:: ReprAttr > { bug ! ( "repr_attrs" ) }
348
348
fn item_type ( & self , tcx : & TyCtxt < ' tcx > , def : DefId )
349
- -> ty:: TypeScheme < ' tcx > { unimplemented ! ( ) }
350
- fn relative_item_path ( & self , def : DefId ) -> Vec < hir_map:: PathElem > { unimplemented ! ( ) }
349
+ -> ty:: TypeScheme < ' tcx > { bug ! ( "item_type" ) }
350
+ fn relative_item_path ( & self , def : DefId )
351
+ -> Vec < hir_map:: PathElem > { bug ! ( "relative_item_path" ) }
351
352
fn visible_parent_map < ' a > ( & ' a self ) -> :: std:: cell:: RefMut < ' a , DefIdMap < DefId > > {
352
- unimplemented ! ( )
353
+ bug ! ( "visible_parent_map" )
353
354
}
354
- fn extern_item_path ( & self , def : DefId ) -> Vec < hir_map:: PathElem > { unimplemented ! ( ) }
355
- fn item_name ( & self , def : DefId ) -> ast:: Name { unimplemented ! ( ) }
355
+ fn extern_item_path ( & self , def : DefId ) -> Vec < hir_map:: PathElem > { bug ! ( "extern_item_path" ) }
356
+ fn item_name ( & self , def : DefId ) -> ast:: Name { bug ! ( "item_name" ) }
356
357
fn item_predicates ( & self , tcx : & TyCtxt < ' tcx > , def : DefId )
357
- -> ty:: GenericPredicates < ' tcx > { unimplemented ! ( ) }
358
+ -> ty:: GenericPredicates < ' tcx > { bug ! ( "item_predicates" ) }
358
359
fn item_super_predicates ( & self , tcx : & TyCtxt < ' tcx > , def : DefId )
359
- -> ty:: GenericPredicates < ' tcx > { unimplemented ! ( ) }
360
- fn item_attrs ( & self , def_id : DefId ) -> Vec < ast:: Attribute > { unimplemented ! ( ) }
361
- fn item_symbol ( & self , def : DefId ) -> String { unimplemented ! ( ) }
360
+ -> ty:: GenericPredicates < ' tcx > { bug ! ( "item_super_predicates" ) }
361
+ fn item_attrs ( & self , def_id : DefId ) -> Vec < ast:: Attribute > { bug ! ( "item_attrs" ) }
362
+ fn item_symbol ( & self , def : DefId ) -> String { bug ! ( "item_symbol" ) }
362
363
fn trait_def ( & self , tcx : & TyCtxt < ' tcx > , def : DefId ) -> ty:: TraitDef < ' tcx >
363
- { unimplemented ! ( ) }
364
+ { bug ! ( "trait_def" ) }
364
365
fn adt_def ( & self , tcx : & TyCtxt < ' tcx > , def : DefId ) -> ty:: AdtDefMaster < ' tcx >
365
- { unimplemented ! ( ) }
366
- fn method_arg_names ( & self , did : DefId ) -> Vec < String > { unimplemented ! ( ) }
366
+ { bug ! ( "adt_def" ) }
367
+ fn method_arg_names ( & self , did : DefId ) -> Vec < String > { bug ! ( "method_arg_names" ) }
367
368
fn inherent_implementations_for_type ( & self , def_id : DefId ) -> Vec < DefId > { vec ! [ ] }
368
369
369
370
// trait info
370
371
fn implementations_of_trait ( & self , def_id : DefId ) -> Vec < DefId > { vec ! [ ] }
371
372
fn provided_trait_methods ( & self , tcx : & TyCtxt < ' tcx > , def : DefId )
372
- -> Vec < Rc < ty:: Method < ' tcx > > > { unimplemented ! ( ) }
373
+ -> Vec < Rc < ty:: Method < ' tcx > > > { bug ! ( "provided_trait_methods" ) }
373
374
fn trait_item_def_ids ( & self , def : DefId )
374
- -> Vec < ty:: ImplOrTraitItemId > { unimplemented ! ( ) }
375
+ -> Vec < ty:: ImplOrTraitItemId > { bug ! ( "trait_item_def_ids" ) }
375
376
376
377
// impl info
377
378
fn impl_items ( & self , impl_def_id : DefId ) -> Vec < ty:: ImplOrTraitItemId >
378
- { unimplemented ! ( ) }
379
+ { bug ! ( "impl_items" ) }
379
380
fn impl_trait_ref ( & self , tcx : & TyCtxt < ' tcx > , def : DefId )
380
- -> Option < ty:: TraitRef < ' tcx > > { unimplemented ! ( ) }
381
- fn impl_polarity ( & self , def : DefId ) -> Option < hir:: ImplPolarity > { unimplemented ! ( ) }
381
+ -> Option < ty:: TraitRef < ' tcx > > { bug ! ( "impl_trait_ref" ) }
382
+ fn impl_polarity ( & self , def : DefId ) -> Option < hir:: ImplPolarity > { bug ! ( "impl_polarity" ) }
382
383
fn custom_coerce_unsized_kind ( & self , def : DefId )
383
384
-> Option < ty:: adjustment:: CustomCoerceUnsized >
384
- { unimplemented ! ( ) }
385
+ { bug ! ( "custom_coerce_unsized_kind" ) }
385
386
fn associated_consts ( & self , tcx : & TyCtxt < ' tcx > , def : DefId )
386
- -> Vec < Rc < ty:: AssociatedConst < ' tcx > > > { unimplemented ! ( ) }
387
- fn impl_parent ( & self , def : DefId ) -> Option < DefId > { unimplemented ! ( ) }
387
+ -> Vec < Rc < ty:: AssociatedConst < ' tcx > > > { bug ! ( "associated_consts" ) }
388
+ fn impl_parent ( & self , def : DefId ) -> Option < DefId > { bug ! ( "impl_parent" ) }
388
389
389
390
// trait/impl-item info
390
391
fn trait_of_item ( & self , tcx : & TyCtxt < ' tcx > , def_id : DefId )
391
- -> Option < DefId > { unimplemented ! ( ) }
392
+ -> Option < DefId > { bug ! ( "trait_of_item" ) }
392
393
fn impl_or_trait_item ( & self , tcx : & TyCtxt < ' tcx > , def : DefId )
393
- -> Option < ty:: ImplOrTraitItem < ' tcx > > { unimplemented ! ( ) }
394
+ -> Option < ty:: ImplOrTraitItem < ' tcx > > { bug ! ( "impl_or_trait_item" ) }
394
395
395
396
// flags
396
- fn is_const_fn ( & self , did : DefId ) -> bool { unimplemented ! ( ) }
397
- fn is_defaulted_trait ( & self , did : DefId ) -> bool { unimplemented ! ( ) }
398
- fn is_impl ( & self , did : DefId ) -> bool { unimplemented ! ( ) }
399
- fn is_default_impl ( & self , impl_did : DefId ) -> bool { unimplemented ! ( ) }
400
- fn is_extern_item ( & self , tcx : & TyCtxt < ' tcx > , did : DefId ) -> bool { unimplemented ! ( ) }
401
- fn is_static_method ( & self , did : DefId ) -> bool { unimplemented ! ( ) }
397
+ fn is_const_fn ( & self , did : DefId ) -> bool { bug ! ( "is_const_fn" ) }
398
+ fn is_defaulted_trait ( & self , did : DefId ) -> bool { bug ! ( "is_defaulted_trait" ) }
399
+ fn is_impl ( & self , did : DefId ) -> bool { bug ! ( "is_impl" ) }
400
+ fn is_default_impl ( & self , impl_did : DefId ) -> bool { bug ! ( "is_default_impl" ) }
401
+ fn is_extern_item ( & self , tcx : & TyCtxt < ' tcx > , did : DefId ) -> bool { bug ! ( "is_extern_item" ) }
402
+ fn is_static_method ( & self , did : DefId ) -> bool { bug ! ( "is_static_method" ) }
402
403
fn is_statically_included_foreign_item ( & self , id : ast:: NodeId ) -> bool { false }
403
- fn is_typedef ( & self , did : DefId ) -> bool { unimplemented ! ( ) }
404
+ fn is_typedef ( & self , did : DefId ) -> bool { bug ! ( "is_typedef" ) }
404
405
405
406
// crate metadata
406
407
fn dylib_dependency_formats ( & self , cnum : ast:: CrateNum )
407
408
-> Vec < ( ast:: CrateNum , LinkagePreference ) >
408
- { unimplemented ! ( ) }
409
+ { bug ! ( "dylib_dependency_formats" ) }
409
410
fn lang_items ( & self , cnum : ast:: CrateNum ) -> Vec < ( DefIndex , usize ) >
410
- { unimplemented ! ( ) }
411
+ { bug ! ( "lang_items" ) }
411
412
fn missing_lang_items ( & self , cnum : ast:: CrateNum ) -> Vec < lang_items:: LangItem >
412
- { unimplemented ! ( ) }
413
- fn is_staged_api ( & self , cnum : ast:: CrateNum ) -> bool { unimplemented ! ( ) }
414
- fn is_explicitly_linked ( & self , cnum : ast:: CrateNum ) -> bool { unimplemented ! ( ) }
415
- fn is_allocator ( & self , cnum : ast:: CrateNum ) -> bool { unimplemented ! ( ) }
416
- fn extern_crate ( & self , cnum : ast:: CrateNum ) -> Option < ExternCrate > { unimplemented ! ( ) }
413
+ { bug ! ( "missing_lang_items" ) }
414
+ fn is_staged_api ( & self , cnum : ast:: CrateNum ) -> bool { bug ! ( "is_staged_api" ) }
415
+ fn is_explicitly_linked ( & self , cnum : ast:: CrateNum ) -> bool { bug ! ( "is_explicitly_linked" ) }
416
+ fn is_allocator ( & self , cnum : ast:: CrateNum ) -> bool { bug ! ( "is_allocator" ) }
417
+ fn extern_crate ( & self , cnum : ast:: CrateNum ) -> Option < ExternCrate > { bug ! ( "extern_crate" ) }
417
418
fn crate_attrs ( & self , cnum : ast:: CrateNum ) -> Vec < ast:: Attribute >
418
- { unimplemented ! ( ) }
419
- fn crate_name ( & self , cnum : ast:: CrateNum ) -> InternedString { unimplemented ! ( ) }
419
+ { bug ! ( "crate_attrs" ) }
420
+ fn crate_name ( & self , cnum : ast:: CrateNum ) -> InternedString { bug ! ( "crate_name" ) }
420
421
fn original_crate_name ( & self , cnum : ast:: CrateNum ) -> InternedString {
421
- unimplemented ! ( )
422
+ bug ! ( "original_crate_name" )
422
423
}
423
- fn crate_hash ( & self , cnum : ast:: CrateNum ) -> Svh { unimplemented ! ( ) }
424
- fn crate_disambiguator ( & self , cnum : ast:: CrateNum ) -> InternedString { unimplemented ! ( ) }
424
+ fn crate_hash ( & self , cnum : ast:: CrateNum ) -> Svh { bug ! ( "crate_hash" ) }
425
+ fn crate_disambiguator ( & self , cnum : ast:: CrateNum )
426
+ -> InternedString { bug ! ( "crate_disambiguator" ) }
425
427
fn crate_struct_field_attrs ( & self , cnum : ast:: CrateNum )
426
428
-> FnvHashMap < DefId , Vec < ast:: Attribute > >
427
- { unimplemented ! ( ) }
429
+ { bug ! ( "crate_struct_field_attrs" ) }
428
430
fn plugin_registrar_fn ( & self , cnum : ast:: CrateNum ) -> Option < DefId >
429
- { unimplemented ! ( ) }
431
+ { bug ! ( "plugin_registrar_fn" ) }
430
432
fn native_libraries ( & self , cnum : ast:: CrateNum ) -> Vec < ( NativeLibraryKind , String ) >
431
- { unimplemented ! ( ) }
432
- fn reachable_ids ( & self , cnum : ast:: CrateNum ) -> Vec < DefId > { unimplemented ! ( ) }
433
+ { bug ! ( "native_libraries" ) }
434
+ fn reachable_ids ( & self , cnum : ast:: CrateNum ) -> Vec < DefId > { bug ! ( "reachable_ids" ) }
433
435
434
436
// resolve
435
- fn def_key ( & self , def : DefId ) -> hir_map:: DefKey { unimplemented ! ( ) }
436
- fn relative_def_path ( & self , def : DefId ) -> hir_map:: DefPath { unimplemented ! ( ) }
437
- fn variant_kind ( & self , def_id : DefId ) -> Option < VariantKind > { unimplemented ! ( ) }
437
+ fn def_key ( & self , def : DefId ) -> hir_map:: DefKey { bug ! ( "def_key" ) }
438
+ fn relative_def_path ( & self , def : DefId ) -> hir_map:: DefPath { bug ! ( "relative_def_path" ) }
439
+ fn variant_kind ( & self , def_id : DefId ) -> Option < VariantKind > { bug ! ( "variant_kind" ) }
438
440
fn struct_ctor_def_id ( & self , struct_def_id : DefId ) -> Option < DefId >
439
- { unimplemented ! ( ) }
441
+ { bug ! ( "struct_ctor_def_id" ) }
440
442
fn tuple_struct_definition_if_ctor ( & self , did : DefId ) -> Option < DefId >
441
- { unimplemented ! ( ) }
442
- fn struct_field_names ( & self , def : DefId ) -> Vec < ast:: Name > { unimplemented ! ( ) }
443
- fn item_children ( & self , did : DefId ) -> Vec < ChildItem > { unimplemented ! ( ) }
443
+ { bug ! ( "tuple_struct_definition_if_ctor" ) }
444
+ fn struct_field_names ( & self , def : DefId ) -> Vec < ast:: Name > { bug ! ( "struct_field_names" ) }
445
+ fn item_children ( & self , did : DefId ) -> Vec < ChildItem > { bug ! ( "item_children" ) }
444
446
fn crate_top_level_items ( & self , cnum : ast:: CrateNum ) -> Vec < ChildItem >
445
- { unimplemented ! ( ) }
447
+ { bug ! ( "crate_top_level_items" ) }
446
448
447
449
// misc. metadata
448
450
fn maybe_get_item_ast ( & ' tcx self , tcx : & TyCtxt < ' tcx > , def : DefId )
449
- -> FoundAst < ' tcx > { unimplemented ! ( ) }
451
+ -> FoundAst < ' tcx > { bug ! ( "maybe_get_item_ast" ) }
450
452
fn maybe_get_item_mir ( & self , tcx : & TyCtxt < ' tcx > , def : DefId )
451
- -> Option < Mir < ' tcx > > { unimplemented ! ( ) }
453
+ -> Option < Mir < ' tcx > > { bug ! ( "maybe_get_item_mir" ) }
452
454
fn is_item_mir_available ( & self , def : DefId ) -> bool {
453
- unimplemented ! ( )
455
+ bug ! ( "is_item_mir_available" )
454
456
}
455
457
456
458
// This is basically a 1-based range of ints, which is a little
@@ -460,18 +462,18 @@ impl<'tcx> CrateStore<'tcx> for DummyCrateStore {
460
462
fn used_link_args ( & self ) -> Vec < String > { vec ! [ ] }
461
463
462
464
// utility functions
463
- fn metadata_filename ( & self ) -> & str { unimplemented ! ( ) }
464
- fn metadata_section_name ( & self , target : & Target ) -> & str { unimplemented ! ( ) }
465
+ fn metadata_filename ( & self ) -> & str { bug ! ( "metadata_filename" ) }
466
+ fn metadata_section_name ( & self , target : & Target ) -> & str { bug ! ( "metadata_section_name" ) }
465
467
fn encode_type ( & self ,
466
468
tcx : & TyCtxt < ' tcx > ,
467
469
ty : Ty < ' tcx > ,
468
470
def_id_to_string : fn ( & TyCtxt < ' tcx > , DefId ) -> String )
469
471
-> Vec < u8 > {
470
- unimplemented ! ( )
472
+ bug ! ( "encode_type" )
471
473
}
472
474
fn used_crates ( & self , prefer : LinkagePreference ) -> Vec < ( ast:: CrateNum , Option < PathBuf > ) >
473
475
{ vec ! [ ] }
474
- fn used_crate_source ( & self , cnum : ast:: CrateNum ) -> CrateSource { unimplemented ! ( ) }
476
+ fn used_crate_source ( & self , cnum : ast:: CrateNum ) -> CrateSource { bug ! ( "used_crate_source" ) }
475
477
fn extern_mod_stmt_cnum ( & self , emod_id : ast:: NodeId ) -> Option < ast:: CrateNum > { None }
476
478
fn encode_metadata ( & self ,
477
479
tcx : & TyCtxt < ' tcx > ,
@@ -481,7 +483,7 @@ impl<'tcx> CrateStore<'tcx> for DummyCrateStore {
481
483
reachable : & NodeSet ,
482
484
mir_map : & MirMap < ' tcx > ,
483
485
krate : & hir:: Crate ) -> Vec < u8 > { vec ! [ ] }
484
- fn metadata_encoding_version ( & self ) -> & [ u8 ] { unimplemented ! ( ) }
486
+ fn metadata_encoding_version ( & self ) -> & [ u8 ] { bug ! ( "metadata_encoding_version" ) }
485
487
}
486
488
487
489
0 commit comments