Skip to content

Commit 6161758

Browse files
Rename some compare_method functions
1 parent 7e4f466 commit 6161758

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::check::intrinsicck::InlineAsmCtxt;
22
use crate::errors::LinkageType;
33

44
use super::compare_method::check_type_bounds;
5-
use super::compare_method::{compare_impl_method, compare_ty_impl};
5+
use super::compare_method::{compare_impl_method, compare_impl_ty};
66
use super::*;
77
use rustc_attr as attr;
88
use rustc_errors::{Applicability, ErrorGuaranteed, MultiSpan};
@@ -774,7 +774,7 @@ fn check_impl_items_against_trait<'tcx>(
774774
let impl_item_full = tcx.hir().impl_item(impl_item.id);
775775
match impl_item_full.kind {
776776
hir::ImplItemKind::Const(..) => {
777-
let _ = tcx.compare_assoc_const_impl_item_with_trait_item((
777+
let _ = tcx.compare_impl_const((
778778
impl_item.id.owner_id.def_id,
779779
ty_impl_item.trait_item_def_id.unwrap(),
780780
));
@@ -791,7 +791,7 @@ fn check_impl_items_against_trait<'tcx>(
791791
}
792792
hir::ImplItemKind::Type(impl_ty) => {
793793
let opt_trait_span = tcx.hir().span_if_local(ty_trait_item.def_id);
794-
compare_ty_impl(
794+
compare_impl_ty(
795795
tcx,
796796
&ty_impl_item,
797797
impl_ty.span,

compiler/rustc_hir_analysis/src/check/compare_method.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1516,8 +1516,8 @@ fn compare_generic_param_kinds<'tcx>(
15161516
Ok(())
15171517
}
15181518

1519-
/// Use `tcx.compare_assoc_const_impl_item_with_trait_item` instead
1520-
pub(crate) fn raw_compare_const_impl(
1519+
/// Use `tcx.compare_impl_const` instead
1520+
pub(crate) fn compare_impl_const_raw(
15211521
tcx: TyCtxt<'_>,
15221522
(impl_const_item_def, trait_const_item_def): (LocalDefId, DefId),
15231523
) -> Result<(), ErrorGuaranteed> {
@@ -1623,7 +1623,7 @@ pub(crate) fn raw_compare_const_impl(
16231623
Ok(())
16241624
}
16251625

1626-
pub(crate) fn compare_ty_impl<'tcx>(
1626+
pub(crate) fn compare_impl_ty<'tcx>(
16271627
tcx: TyCtxt<'tcx>,
16281628
impl_ty: &ty::AssocItem,
16291629
impl_ty_span: Span,

compiler/rustc_hir_analysis/src/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub fn provide(providers: &mut Providers) {
104104
check_mod_item_types,
105105
region_scope_tree,
106106
collect_trait_impl_trait_tys,
107-
compare_assoc_const_impl_item_with_trait_item: compare_method::raw_compare_const_impl,
107+
compare_impl_const: compare_method::compare_impl_const_raw,
108108
..*providers
109109
};
110110
}

compiler/rustc_infer/src/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1836,7 +1836,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
18361836

18371837
// In some (most?) cases cause.body_id points to actual body, but in some cases
18381838
// it's an actual definition. According to the comments (e.g. in
1839-
// rustc_hir_analysis/check/compare_method.rs:compare_predicate_entailment) the latter
1839+
// rustc_hir_analysis/check/compare_method.rs:compare_method_predicate_entailment) the latter
18401840
// is relied upon by some other code. This might (or might not) need cleanup.
18411841
let body_owner_def_id =
18421842
self.tcx.hir().opt_local_def_id(cause.body_id).unwrap_or_else(|| {

compiler/rustc_middle/src/query/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2117,7 +2117,7 @@ rustc_queries! {
21172117
desc { "checking to see if `{}` permits being left zeroed", key.ty }
21182118
}
21192119

2120-
query compare_assoc_const_impl_item_with_trait_item(
2120+
query compare_impl_const(
21212121
key: (LocalDefId, DefId)
21222122
) -> Result<(), ErrorGuaranteed> {
21232123
desc { |tcx| "checking assoc const `{}` has the same type as trait item", tcx.def_path_str(key.0.to_def_id()) }

compiler/rustc_ty_utils/src/instance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ fn resolve_associated_item<'tcx>(
194194
&& trait_item_id != leaf_def.item.def_id
195195
&& let Some(leaf_def_item) = leaf_def.item.def_id.as_local()
196196
{
197-
tcx.compare_assoc_const_impl_item_with_trait_item((
197+
tcx.compare_impl_const((
198198
leaf_def_item,
199199
trait_item_id,
200200
))?;

0 commit comments

Comments
 (0)