about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-05-09 20:49:17 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2022-06-21 23:56:17 +0200
commit42289ff931334f5f82cec0b3e0252ce326ca165c (patch)
tree805fa7653761ea511129c795510b445d70562fd3
parent9ae2546907d8ef6d0bcd8c81f9e89457d6b79d02 (diff)
downloadrust-42289ff931334f5f82cec0b3e0252ce326ca165c.tar.gz
rust-42289ff931334f5f82cec0b3e0252ce326ca165c.zip
Inline impl_wf_check.
-rw-r--r--compiler/rustc_typeck/src/impl_wf_check.rs7
-rw-r--r--compiler/rustc_typeck/src/lib.rs4
2 files changed, 3 insertions, 8 deletions
diff --git a/compiler/rustc_typeck/src/impl_wf_check.rs b/compiler/rustc_typeck/src/impl_wf_check.rs
index c089d25d222..e968d73e95f 100644
--- a/compiler/rustc_typeck/src/impl_wf_check.rs
+++ b/compiler/rustc_typeck/src/impl_wf_check.rs
@@ -54,13 +54,6 @@ mod min_specialization;
 /// impl<'a> Trait<Foo> for Bar { type X = &'a i32; }
 /// //   ^ 'a is unused and appears in assoc type, error
 /// ```
-pub fn impl_wf_check(tcx: TyCtxt<'_>) {
-    // We will tag this as part of the WF check -- logically, it is,
-    // but it's one that we must perform earlier than the rest of
-    // WfCheck.
-    tcx.hir().for_each_module(|module| tcx.ensure().check_mod_impl_wf(module))
-}
-
 fn check_mod_impl_wf(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
     let min_specialization = tcx.features().min_specialization;
     let module = tcx.hir_module_items(module_def_id);
diff --git a/compiler/rustc_typeck/src/lib.rs b/compiler/rustc_typeck/src/lib.rs
index d613edf0ab0..95c8d15c93d 100644
--- a/compiler/rustc_typeck/src/lib.rs
+++ b/compiler/rustc_typeck/src/lib.rs
@@ -509,7 +509,9 @@ pub fn check_crate(tcx: TyCtxt<'_>) -> Result<(), ErrorGuaranteed> {
     }
 
     tcx.sess.track_errors(|| {
-        tcx.sess.time("impl_wf_inference", || impl_wf_check::impl_wf_check(tcx));
+        tcx.sess.time("impl_wf_inference", || {
+            tcx.hir().for_each_module(|module| tcx.ensure().check_mod_impl_wf(module))
+        });
     })?;
 
     tcx.sess.track_errors(|| {