Rollup merge of #125978 - fmease:cleanup-hir-ty-lowering-consolidate-assoc-item-access-checking, r=davidtwco

Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking

Use `probe_assoc_item` (for hygienically probing an assoc item and checking if it's accessible wrt. visibility and stability) for assoc item constraints, too, not just for assoc type paths and make the privacy error translatable.
This commit is contained in:
Jubilee 2024-06-12 03:57:19 -07:00 committed by GitHub
commit e7b07ea7a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 97 additions and 69 deletions

View file

@ -2,7 +2,7 @@ error[E0624]: associated type `P` is private
--> $DIR/assoc-inherent-private.rs:10:10
|
LL | type P = ();
| ------ associated type defined here
| ------ the associated type is defined here
...
LL | type U = m::T::P;
| ^^^^^^^ private associated type
@ -11,7 +11,7 @@ error[E0624]: associated type `P` is private
--> $DIR/assoc-inherent-private.rs:21:10
|
LL | pub(super) type P = bool;
| ----------------- associated type defined here
| ----------------- the associated type is defined here
...
LL | type V = n::n::T::P;
| ^^^^^^^^^^ private associated type

View file

@ -196,14 +196,17 @@ error[E0624]: associated type `A` is private
--> $DIR/item-privacy.rs:119:12
|
LL | type A = u8;
| ------ associated type defined here
| ------ the associated type is defined here
...
LL | let _: T::A;
| ^^^^ private associated type
error: associated type `A` is private
error[E0624]: associated type `A` is private
--> $DIR/item-privacy.rs:128:9
|
LL | type A = u8;
| ------ the associated type is defined here
...
LL | A = u8,
| ^^^^^^ private associated type