1
Fork 0

rustc_middle: Remove Option from module_reexports query

This commit is contained in:
Vadim Petrochenkov 2023-04-07 19:23:12 +03:00
parent 612ddd2196
commit 9da9373bf0
7 changed files with 12 additions and 17 deletions

View file

@ -1510,7 +1510,7 @@ rustc_queries! {
desc { "getting traits in scope at a block" }
}
query module_reexports(def_id: LocalDefId) -> Option<&'tcx [ModChild]> {
query module_reexports(def_id: LocalDefId) -> &'tcx [ModChild] {
desc { |tcx| "looking up reexports of module `{}`", tcx.def_path_str(def_id.to_def_id()) }
}

View file

@ -2502,7 +2502,7 @@ pub struct DeducedParamAttrs {
pub fn provide(providers: &mut ty::query::Providers) {
providers.module_reexports =
|tcx, id| tcx.resolutions(()).reexport_map.get(&id).map(|v| &v[..]);
|tcx, id| tcx.resolutions(()).reexport_map.get(&id).map_or(&[], |v| &v[..]);
providers.maybe_unused_trait_imports =
|tcx, ()| &tcx.resolutions(()).maybe_unused_trait_imports;
providers.names_imported_by_glob_use = |tcx, id| {