Skip to content

Commit c7b414a

Browse files
Rename module compare_method -> compare_impl_item
1 parent 91613c5 commit c7b414a

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

compiler/rustc_hir_analysis/src/check/check.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use crate::check::intrinsicck::InlineAsmCtxt;
22
use crate::errors::LinkageType;
33

4-
use super::compare_method::check_type_bounds;
5-
use super::compare_method::{compare_impl_method, compare_impl_ty};
4+
use super::compare_impl_item::check_type_bounds;
5+
use super::compare_impl_item::{compare_impl_method, compare_impl_ty};
66
use super::*;
77
use rustc_attr as attr;
88
use rustc_errors::{Applicability, ErrorGuaranteed, MultiSpan};

compiler/rustc_hir_analysis/src/check/compare_method.rs renamed to compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub(super) fn compare_impl_method<'tcx>(
7171
return;
7272
}
7373

74-
if let Err(_) = compare_predicate_entailment(
74+
if let Err(_) = compare_method_predicate_entailment(
7575
tcx,
7676
impl_m,
7777
impl_m_span,
@@ -150,7 +150,7 @@ pub(super) fn compare_impl_method<'tcx>(
150150
/// Finally we register each of these predicates as an obligation and check that
151151
/// they hold.
152152
#[instrument(level = "debug", skip(tcx, impl_m_span, impl_trait_ref))]
153-
fn compare_predicate_entailment<'tcx>(
153+
fn compare_method_predicate_entailment<'tcx>(
154154
tcx: TyCtxt<'tcx>,
155155
impl_m: &ty::AssocItem,
156156
impl_m_span: Span,
@@ -337,7 +337,7 @@ fn compare_predicate_entailment<'tcx>(
337337
if !errors.is_empty() {
338338
match check_implied_wf {
339339
CheckImpliedWfMode::Check => {
340-
return compare_predicate_entailment(
340+
return compare_method_predicate_entailment(
341341
tcx,
342342
impl_m,
343343
impl_m_span,
@@ -374,7 +374,7 @@ fn compare_predicate_entailment<'tcx>(
374374
// becomes a hard error (i.e. ideally we'd just call `resolve_regions_and_report_errors`
375375
match check_implied_wf {
376376
CheckImpliedWfMode::Check => {
377-
return compare_predicate_entailment(
377+
return compare_method_predicate_entailment(
378378
tcx,
379379
impl_m,
380380
impl_m_span,
@@ -407,7 +407,7 @@ enum CheckImpliedWfMode {
407407
/// re-check with `Skip`, and emit a lint if it succeeds.
408408
Check,
409409
/// Skips checking implied well-formedness of the impl method, but will emit
410-
/// a lint if the `compare_predicate_entailment` succeeded. This means that
410+
/// a lint if the `compare_method_predicate_entailment` succeeded. This means that
411411
/// the reason that we had failed earlier during `Check` was due to the impl
412412
/// having stronger requirements than the trait.
413413
Skip,
@@ -550,13 +550,13 @@ pub(super) fn collect_trait_impl_trait_tys<'tcx>(
550550
// Unify the whole function signature. We need to do this to fully infer
551551
// the lifetimes of the return type, but do this after unifying just the
552552
// return types, since we want to avoid duplicating errors from
553-
// `compare_predicate_entailment`.
553+
// `compare_method_predicate_entailment`.
554554
match ocx.eq(&cause, param_env, trait_fty, impl_fty) {
555555
Ok(()) => {}
556556
Err(terr) => {
557-
// This function gets called during `compare_predicate_entailment` when normalizing a
557+
// This function gets called during `compare_method_predicate_entailment` when normalizing a
558558
// signature that contains RPITIT. When the method signatures don't match, we have to
559-
// emit an error now because `compare_predicate_entailment` will not report the error
559+
// emit an error now because `compare_method_predicate_entailment` will not report the error
560560
// when normalization fails.
561561
let emitted = report_trait_method_mismatch(
562562
infcx,
@@ -1645,7 +1645,7 @@ pub(super) fn compare_impl_ty<'tcx>(
16451645
})();
16461646
}
16471647

1648-
/// The equivalent of [compare_predicate_entailment], but for associated types
1648+
/// The equivalent of [compare_method_predicate_entailment], but for associated types
16491649
/// instead of associated functions.
16501650
fn compare_type_predicate_entailment<'tcx>(
16511651
tcx: TyCtxt<'tcx>,

compiler/rustc_hir_analysis/src/check/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ a type parameter).
6363
*/
6464

6565
mod check;
66-
mod compare_method;
66+
mod compare_impl_item;
6767
pub mod dropck;
6868
pub mod intrinsic;
6969
pub mod intrinsicck;
@@ -94,7 +94,7 @@ use std::num::NonZeroU32;
9494
use crate::require_c_abi_if_c_variadic;
9595
use crate::util::common::indenter;
9696

97-
use self::compare_method::collect_trait_impl_trait_tys;
97+
use self::compare_impl_item::collect_trait_impl_trait_tys;
9898
use self::region::region_scope_tree;
9999

100100
pub fn provide(providers: &mut Providers) {
@@ -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_impl_const: compare_method::compare_impl_const_raw,
107+
compare_impl_const: compare_impl_item::compare_impl_const_raw,
108108
..*providers
109109
};
110110
}

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

+1-1
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_method_predicate_entailment) the latter
1839+
// rustc_hir_analysis/check/compare_impl_item.rs:compare_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(|| {

0 commit comments

Comments
 (0)