Rename impl_defaultness
to defaultness
This commit is contained in:
parent
ba1690bedd
commit
21bc5cded4
18 changed files with 33 additions and 32 deletions
|
@ -297,8 +297,8 @@ fn associated_type_for_impl_trait_in_trait(
|
|||
// Copy visility of the containing function.
|
||||
trait_assoc_ty.visibility(tcx.visibility(fn_def_id));
|
||||
|
||||
// Copy impl_defaultness of the containing function.
|
||||
trait_assoc_ty.impl_defaultness(tcx.impl_defaultness(fn_def_id));
|
||||
// Copy defaultness of the containing function.
|
||||
trait_assoc_ty.defaultness(tcx.defaultness(fn_def_id));
|
||||
|
||||
// Copy type_of of the opaque.
|
||||
trait_assoc_ty.type_of(ty::EarlyBinder::bind(tcx.mk_opaque(
|
||||
|
@ -393,8 +393,8 @@ fn associated_type_for_impl_trait_in_impl(
|
|||
// Copy visility of the containing function.
|
||||
impl_assoc_ty.visibility(tcx.visibility(impl_fn_def_id));
|
||||
|
||||
// Copy impl_defaultness of the containing function.
|
||||
impl_assoc_ty.impl_defaultness(tcx.impl_defaultness(impl_fn_def_id));
|
||||
// Copy defaultness of the containing function.
|
||||
impl_assoc_ty.defaultness(tcx.defaultness(impl_fn_def_id));
|
||||
|
||||
// Copy generics_of the trait's associated item but the impl as the parent.
|
||||
// FIXME(-Zlower-impl-trait-in-trait-to-assoc-ty) resolves to the trait instead of the impl
|
||||
|
|
|
@ -204,7 +204,7 @@ fn resolve_associated_item<'tcx>(
|
|||
} else {
|
||||
// All other methods are default methods of the `Future` trait.
|
||||
// (this assumes that `ImplSource::Future` is only used for methods on `Future`)
|
||||
debug_assert!(tcx.impl_defaultness(trait_item_id).has_value());
|
||||
debug_assert!(tcx.defaultness(trait_item_id).has_value());
|
||||
Some(Instance::new(trait_item_id, rcvr_substs))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,13 +75,13 @@ fn sized_constraint_for_ty<'tcx>(
|
|||
result
|
||||
}
|
||||
|
||||
fn impl_defaultness(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::Defaultness {
|
||||
fn defaultness(tcx: TyCtxt<'_>, def_id: LocalDefId) -> hir::Defaultness {
|
||||
match tcx.hir().get_by_def_id(def_id) {
|
||||
hir::Node::Item(hir::Item { kind: hir::ItemKind::Impl(impl_), .. }) => impl_.defaultness,
|
||||
hir::Node::ImplItem(hir::ImplItem { defaultness, .. })
|
||||
| hir::Node::TraitItem(hir::TraitItem { defaultness, .. }) => *defaultness,
|
||||
node => {
|
||||
bug!("`impl_defaultness` called on {:?}", node);
|
||||
bug!("`defaultness` called on {:?}", node);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -574,7 +574,7 @@ pub fn provide(providers: &mut Providers) {
|
|||
param_env_reveal_all_normalized,
|
||||
instance_def_size_estimate,
|
||||
issue33140_self_ty,
|
||||
impl_defaultness,
|
||||
defaultness,
|
||||
unsizing_params_for_adt,
|
||||
..*providers
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue