1
Fork 0

Rollup merge of #112165 - fee1-dead-contrib:rn-defualtness, r=compiler-errors

Rename `impl_defaultness` to `defaultness`

Since this isn't just about the `impl`.
This commit is contained in:
Matthias Krüger 2023-06-02 18:12:45 +02:00 committed by GitHub
commit f121f77d8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 33 additions and 32 deletions

View file

@ -1475,8 +1475,9 @@ rustc_queries! {
desc { "getting traits in scope at a block" }
}
query impl_defaultness(def_id: DefId) -> hir::Defaultness {
desc { |tcx| "looking up whether `{}` is a default impl", tcx.def_path_str(def_id) }
/// Returns whether the impl or associated function has the `default` keyword.
query defaultness(def_id: DefId) -> hir::Defaultness {
desc { |tcx| "looking up whether `{}` has `default`", tcx.def_path_str(def_id) }
separate_provide_extern
feedable
}

View file

@ -228,7 +228,7 @@ impl<'tcx> Ancestors<'tcx> {
if let Some(item) = node.item(tcx, trait_item_def_id) {
if finalizing_node.is_none() {
let is_specializable = item.defaultness(tcx).is_default()
|| tcx.impl_defaultness(node.def_id()).is_default();
|| tcx.defaultness(node.def_id()).is_default();
if !is_specializable {
finalizing_node = Some(node);

View file

@ -48,7 +48,7 @@ impl AssocItem {
///
/// [`type_of`]: crate::ty::TyCtxt::type_of
pub fn defaultness(&self, tcx: TyCtxt<'_>) -> hir::Defaultness {
tcx.impl_defaultness(self.def_id)
tcx.defaultness(self.def_id)
}
#[inline]