about summary refs log tree commit diff
path: root/compiler/rustc_trait_selection
diff options
context:
space:
mode:
authorJacob Pratt <jacob@jhpratt.dev>2025-08-21 01:12:22 -0400
committerGitHub <noreply@github.com>2025-08-21 01:12:22 -0400
commit0af35f6a3bb60aa4f1348bb6d69d80809ff818f9 (patch)
tree987e325d87eb1151e6d60e09270ae45e0b4e09bc /compiler/rustc_trait_selection
parent64c43edffedaee7c06c024ea7fc3f84f73cac81f (diff)
parent27e6726cb82d413f623715dfa099d2b8410e016a (diff)
downloadrust-0af35f6a3bb60aa4f1348bb6d69d80809ff818f9.tar.gz
rust-0af35f6a3bb60aa4f1348bb6d69d80809ff818f9.zip
Rollup merge of #145642 - xizheyin:145611, r=lcnr
Do not use effective_visibilities query for Adt types of a local trait while proving a where-clause

Partially fix rust-lang/rust#145611, but we should do something make cycle in this situation ICE.

Instead of using a query, call `&tcx.resolutions(()).effective_visibilities`.

r? `````@lcnr`````

cc `````@compiler-errors`````
Diffstat (limited to 'compiler/rustc_trait_selection')
-rw-r--r--compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
index bc8c8a44405..953449c6758 100644
--- a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
+++ b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs
@@ -2878,7 +2878,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
                                 // we check if `TraitB` can be reachable from `S`
                                 // to determine whether to note `TraitA` is sealed trait.
                                 if let ty::Adt(adt, _) = ty.kind() {
-                                    let visibilities = tcx.effective_visibilities(());
+                                    let visibilities = &tcx.resolutions(()).effective_visibilities;
                                     visibilities.effective_vis(local).is_none_or(|v| {
                                         v.at_level(Level::Reexported)
                                             .is_accessible_from(adt.did(), tcx)