diff --git a/src/librustc/middle/cstore.rs b/src/librustc/middle/cstore.rs index e708950c69ef..305b64f3320c 100644 --- a/src/librustc/middle/cstore.rs +++ b/src/librustc/middle/cstore.rs @@ -336,121 +336,123 @@ pub struct DummyCrateStore; #[allow(unused_variables)] impl<'tcx> CrateStore<'tcx> for DummyCrateStore { // item info - fn stability(&self, def: DefId) -> Option { unimplemented!() } - fn deprecation(&self, def: DefId) -> Option { unimplemented!() } - fn visibility(&self, def: DefId) -> hir::Visibility { unimplemented!() } + fn stability(&self, def: DefId) -> Option { bug!("stability") } + fn deprecation(&self, def: DefId) -> Option { bug!("deprecation") } + fn visibility(&self, def: DefId) -> hir::Visibility { bug!("visibility") } fn closure_kind(&self, tcx: &TyCtxt<'tcx>, def_id: DefId) - -> ty::ClosureKind { unimplemented!() } + -> ty::ClosureKind { bug!("closure_kind") } fn closure_ty(&self, tcx: &TyCtxt<'tcx>, def_id: DefId) - -> ty::ClosureTy<'tcx> { unimplemented!() } - fn item_variances(&self, def: DefId) -> ty::ItemVariances { unimplemented!() } - fn repr_attrs(&self, def: DefId) -> Vec { unimplemented!() } + -> ty::ClosureTy<'tcx> { bug!("closure_ty") } + fn item_variances(&self, def: DefId) -> ty::ItemVariances { bug!("item_variances") } + fn repr_attrs(&self, def: DefId) -> Vec { bug!("repr_attrs") } fn item_type(&self, tcx: &TyCtxt<'tcx>, def: DefId) - -> ty::TypeScheme<'tcx> { unimplemented!() } - fn relative_item_path(&self, def: DefId) -> Vec { unimplemented!() } + -> ty::TypeScheme<'tcx> { bug!("item_type") } + fn relative_item_path(&self, def: DefId) + -> Vec { bug!("relative_item_path") } fn visible_parent_map<'a>(&'a self) -> ::std::cell::RefMut<'a, DefIdMap> { - unimplemented!() + bug!("visible_parent_map") } - fn extern_item_path(&self, def: DefId) -> Vec { unimplemented!() } - fn item_name(&self, def: DefId) -> ast::Name { unimplemented!() } + fn extern_item_path(&self, def: DefId) -> Vec { bug!("extern_item_path") } + fn item_name(&self, def: DefId) -> ast::Name { bug!("item_name") } fn item_predicates(&self, tcx: &TyCtxt<'tcx>, def: DefId) - -> ty::GenericPredicates<'tcx> { unimplemented!() } + -> ty::GenericPredicates<'tcx> { bug!("item_predicates") } fn item_super_predicates(&self, tcx: &TyCtxt<'tcx>, def: DefId) - -> ty::GenericPredicates<'tcx> { unimplemented!() } - fn item_attrs(&self, def_id: DefId) -> Vec { unimplemented!() } - fn item_symbol(&self, def: DefId) -> String { unimplemented!() } + -> ty::GenericPredicates<'tcx> { bug!("item_super_predicates") } + fn item_attrs(&self, def_id: DefId) -> Vec { bug!("item_attrs") } + fn item_symbol(&self, def: DefId) -> String { bug!("item_symbol") } fn trait_def(&self, tcx: &TyCtxt<'tcx>, def: DefId)-> ty::TraitDef<'tcx> - { unimplemented!() } + { bug!("trait_def") } fn adt_def(&self, tcx: &TyCtxt<'tcx>, def: DefId) -> ty::AdtDefMaster<'tcx> - { unimplemented!() } - fn method_arg_names(&self, did: DefId) -> Vec { unimplemented!() } + { bug!("adt_def") } + fn method_arg_names(&self, did: DefId) -> Vec { bug!("method_arg_names") } fn inherent_implementations_for_type(&self, def_id: DefId) -> Vec { vec![] } // trait info fn implementations_of_trait(&self, def_id: DefId) -> Vec { vec![] } fn provided_trait_methods(&self, tcx: &TyCtxt<'tcx>, def: DefId) - -> Vec>> { unimplemented!() } + -> Vec>> { bug!("provided_trait_methods") } fn trait_item_def_ids(&self, def: DefId) - -> Vec { unimplemented!() } + -> Vec { bug!("trait_item_def_ids") } // impl info fn impl_items(&self, impl_def_id: DefId) -> Vec - { unimplemented!() } + { bug!("impl_items") } fn impl_trait_ref(&self, tcx: &TyCtxt<'tcx>, def: DefId) - -> Option> { unimplemented!() } - fn impl_polarity(&self, def: DefId) -> Option { unimplemented!() } + -> Option> { bug!("impl_trait_ref") } + fn impl_polarity(&self, def: DefId) -> Option { bug!("impl_polarity") } fn custom_coerce_unsized_kind(&self, def: DefId) -> Option - { unimplemented!() } + { bug!("custom_coerce_unsized_kind") } fn associated_consts(&self, tcx: &TyCtxt<'tcx>, def: DefId) - -> Vec>> { unimplemented!() } - fn impl_parent(&self, def: DefId) -> Option { unimplemented!() } + -> Vec>> { bug!("associated_consts") } + fn impl_parent(&self, def: DefId) -> Option { bug!("impl_parent") } // trait/impl-item info fn trait_of_item(&self, tcx: &TyCtxt<'tcx>, def_id: DefId) - -> Option { unimplemented!() } + -> Option { bug!("trait_of_item") } fn impl_or_trait_item(&self, tcx: &TyCtxt<'tcx>, def: DefId) - -> Option> { unimplemented!() } + -> Option> { bug!("impl_or_trait_item") } // flags - fn is_const_fn(&self, did: DefId) -> bool { unimplemented!() } - fn is_defaulted_trait(&self, did: DefId) -> bool { unimplemented!() } - fn is_impl(&self, did: DefId) -> bool { unimplemented!() } - fn is_default_impl(&self, impl_did: DefId) -> bool { unimplemented!() } - fn is_extern_item(&self, tcx: &TyCtxt<'tcx>, did: DefId) -> bool { unimplemented!() } - fn is_static_method(&self, did: DefId) -> bool { unimplemented!() } + fn is_const_fn(&self, did: DefId) -> bool { bug!("is_const_fn") } + fn is_defaulted_trait(&self, did: DefId) -> bool { bug!("is_defaulted_trait") } + fn is_impl(&self, did: DefId) -> bool { bug!("is_impl") } + fn is_default_impl(&self, impl_did: DefId) -> bool { bug!("is_default_impl") } + fn is_extern_item(&self, tcx: &TyCtxt<'tcx>, did: DefId) -> bool { bug!("is_extern_item") } + fn is_static_method(&self, did: DefId) -> bool { bug!("is_static_method") } fn is_statically_included_foreign_item(&self, id: ast::NodeId) -> bool { false } - fn is_typedef(&self, did: DefId) -> bool { unimplemented!() } + fn is_typedef(&self, did: DefId) -> bool { bug!("is_typedef") } // crate metadata fn dylib_dependency_formats(&self, cnum: ast::CrateNum) -> Vec<(ast::CrateNum, LinkagePreference)> - { unimplemented!() } + { bug!("dylib_dependency_formats") } fn lang_items(&self, cnum: ast::CrateNum) -> Vec<(DefIndex, usize)> - { unimplemented!() } + { bug!("lang_items") } fn missing_lang_items(&self, cnum: ast::CrateNum) -> Vec - { unimplemented!() } - fn is_staged_api(&self, cnum: ast::CrateNum) -> bool { unimplemented!() } - fn is_explicitly_linked(&self, cnum: ast::CrateNum) -> bool { unimplemented!() } - fn is_allocator(&self, cnum: ast::CrateNum) -> bool { unimplemented!() } - fn extern_crate(&self, cnum: ast::CrateNum) -> Option { unimplemented!() } + { bug!("missing_lang_items") } + fn is_staged_api(&self, cnum: ast::CrateNum) -> bool { bug!("is_staged_api") } + fn is_explicitly_linked(&self, cnum: ast::CrateNum) -> bool { bug!("is_explicitly_linked") } + fn is_allocator(&self, cnum: ast::CrateNum) -> bool { bug!("is_allocator") } + fn extern_crate(&self, cnum: ast::CrateNum) -> Option { bug!("extern_crate") } fn crate_attrs(&self, cnum: ast::CrateNum) -> Vec - { unimplemented!() } - fn crate_name(&self, cnum: ast::CrateNum) -> InternedString { unimplemented!() } + { bug!("crate_attrs") } + fn crate_name(&self, cnum: ast::CrateNum) -> InternedString { bug!("crate_name") } fn original_crate_name(&self, cnum: ast::CrateNum) -> InternedString { - unimplemented!() + bug!("original_crate_name") } - fn crate_hash(&self, cnum: ast::CrateNum) -> Svh { unimplemented!() } - fn crate_disambiguator(&self, cnum: ast::CrateNum) -> InternedString { unimplemented!() } + fn crate_hash(&self, cnum: ast::CrateNum) -> Svh { bug!("crate_hash") } + fn crate_disambiguator(&self, cnum: ast::CrateNum) + -> InternedString { bug!("crate_disambiguator") } fn crate_struct_field_attrs(&self, cnum: ast::CrateNum) -> FnvHashMap> - { unimplemented!() } + { bug!("crate_struct_field_attrs") } fn plugin_registrar_fn(&self, cnum: ast::CrateNum) -> Option - { unimplemented!() } + { bug!("plugin_registrar_fn") } fn native_libraries(&self, cnum: ast::CrateNum) -> Vec<(NativeLibraryKind, String)> - { unimplemented!() } - fn reachable_ids(&self, cnum: ast::CrateNum) -> Vec { unimplemented!() } + { bug!("native_libraries") } + fn reachable_ids(&self, cnum: ast::CrateNum) -> Vec { bug!("reachable_ids") } // resolve - fn def_key(&self, def: DefId) -> hir_map::DefKey { unimplemented!() } - fn relative_def_path(&self, def: DefId) -> hir_map::DefPath { unimplemented!() } - fn variant_kind(&self, def_id: DefId) -> Option { unimplemented!() } + fn def_key(&self, def: DefId) -> hir_map::DefKey { bug!("def_key") } + fn relative_def_path(&self, def: DefId) -> hir_map::DefPath { bug!("relative_def_path") } + fn variant_kind(&self, def_id: DefId) -> Option { bug!("variant_kind") } fn struct_ctor_def_id(&self, struct_def_id: DefId) -> Option - { unimplemented!() } + { bug!("struct_ctor_def_id") } fn tuple_struct_definition_if_ctor(&self, did: DefId) -> Option - { unimplemented!() } - fn struct_field_names(&self, def: DefId) -> Vec { unimplemented!() } - fn item_children(&self, did: DefId) -> Vec { unimplemented!() } + { bug!("tuple_struct_definition_if_ctor") } + fn struct_field_names(&self, def: DefId) -> Vec { bug!("struct_field_names") } + fn item_children(&self, did: DefId) -> Vec { bug!("item_children") } fn crate_top_level_items(&self, cnum: ast::CrateNum) -> Vec - { unimplemented!() } + { bug!("crate_top_level_items") } // misc. metadata fn maybe_get_item_ast(&'tcx self, tcx: &TyCtxt<'tcx>, def: DefId) - -> FoundAst<'tcx> { unimplemented!() } + -> FoundAst<'tcx> { bug!("maybe_get_item_ast") } fn maybe_get_item_mir(&self, tcx: &TyCtxt<'tcx>, def: DefId) - -> Option> { unimplemented!() } + -> Option> { bug!("maybe_get_item_mir") } fn is_item_mir_available(&self, def: DefId) -> bool { - unimplemented!() + bug!("is_item_mir_available") } // This is basically a 1-based range of ints, which is a little @@ -460,18 +462,18 @@ impl<'tcx> CrateStore<'tcx> for DummyCrateStore { fn used_link_args(&self) -> Vec { vec![] } // utility functions - fn metadata_filename(&self) -> &str { unimplemented!() } - fn metadata_section_name(&self, target: &Target) -> &str { unimplemented!() } + fn metadata_filename(&self) -> &str { bug!("metadata_filename") } + fn metadata_section_name(&self, target: &Target) -> &str { bug!("metadata_section_name") } fn encode_type(&self, tcx: &TyCtxt<'tcx>, ty: Ty<'tcx>, def_id_to_string: fn(&TyCtxt<'tcx>, DefId) -> String) -> Vec { - unimplemented!() + bug!("encode_type") } fn used_crates(&self, prefer: LinkagePreference) -> Vec<(ast::CrateNum, Option)> { vec![] } - fn used_crate_source(&self, cnum: ast::CrateNum) -> CrateSource { unimplemented!() } + fn used_crate_source(&self, cnum: ast::CrateNum) -> CrateSource { bug!("used_crate_source") } fn extern_mod_stmt_cnum(&self, emod_id: ast::NodeId) -> Option { None } fn encode_metadata(&self, tcx: &TyCtxt<'tcx>, @@ -481,7 +483,7 @@ impl<'tcx> CrateStore<'tcx> for DummyCrateStore { reachable: &NodeSet, mir_map: &MirMap<'tcx>, krate: &hir::Crate) -> Vec { vec![] } - fn metadata_encoding_version(&self) -> &[u8] { unimplemented!() } + fn metadata_encoding_version(&self) -> &[u8] { bug!("metadata_encoding_version") } } diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index 7b16d682809f..d3757629d30d 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -822,7 +822,7 @@ fn early_bound_lifetime_names(generics: &hir::Generics) -> Vec { collector.visit_lifetime(bound); } } - &hir::WherePredicate::EqPredicate(_) => unimplemented!() + &hir::WherePredicate::EqPredicate(_) => bug!("unimplemented") } } }