hir: Remove the generic type parameter from MaybeOwned
It's only ever used with a reference to `OwnerInfo` as an argument.
This commit is contained in:
@@ -127,12 +127,11 @@ pub fn provide(providers: &mut Providers) {
|
||||
providers.hir_crate_items = map::hir_crate_items;
|
||||
providers.crate_hash = map::crate_hash;
|
||||
providers.hir_module_items = map::hir_module_items;
|
||||
providers.opt_local_def_id_to_hir_id = |tcx, id| {
|
||||
let owner = tcx.hir_crate(()).owners[id].map(|_| ());
|
||||
Some(match owner {
|
||||
MaybeOwner::Owner(_) => HirId::make_owner(id),
|
||||
MaybeOwner::Phantom => bug!("No HirId for {:?}", id),
|
||||
providers.opt_local_def_id_to_hir_id = |tcx, def_id| {
|
||||
Some(match tcx.hir_crate(()).owners[def_id] {
|
||||
MaybeOwner::Owner(_) => HirId::make_owner(def_id),
|
||||
MaybeOwner::NonOwner(hir_id) => hir_id,
|
||||
MaybeOwner::Phantom => bug!("No HirId for {:?}", def_id),
|
||||
})
|
||||
};
|
||||
providers.opt_hir_owner_nodes =
|
||||
|
||||
@@ -185,8 +185,8 @@ impl EraseType for Option<ty::EarlyBinder<Ty<'_>>> {
|
||||
type Result = [u8; size_of::<Option<ty::EarlyBinder<Ty<'static>>>>()];
|
||||
}
|
||||
|
||||
impl<T> EraseType for rustc_hir::MaybeOwner<&'_ T> {
|
||||
type Result = [u8; size_of::<rustc_hir::MaybeOwner<&'static ()>>()];
|
||||
impl EraseType for rustc_hir::MaybeOwner<'_> {
|
||||
type Result = [u8; size_of::<rustc_hir::MaybeOwner<'static>>()];
|
||||
}
|
||||
|
||||
impl<T: EraseType> EraseType for ty::EarlyBinder<T> {
|
||||
|
||||
Reference in New Issue
Block a user