Files
rust/tests/ui/traits
Stuart Cook c10e1e4122 Rollup merge of #148370 - estebank:outer-param, r=JonathanBrouwer
Point at inner item when it uses generic type param from outer item or `Self`

Partially address rust-lang/rust#37892.

In E0401 generated in resolve:
```
error[E0401]: can't use generic parameters from outer item
  --> $DIR/E0401.rs:4:39
   |
LL | fn foo<T>(x: T) {
   |        - type parameter from outer item
LL |     fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
   |        ----                           ^ use of generic parameter from outer item
   |        |
   |        generic parameter used in this inner function
   |
help: try introducing a local generic parameter here
   |
LL |     fn bfnr<T, U, V: Baz<U>, W: Fn()>(y: T) {
   |             ++
```
In E0401 generated in hir_typeck:
```
error[E0401]: can't reference `Self` constructor from outer item
  --> $DIR/do-not-ice-on-note_and_explain.rs:6:13
   |
LL | impl<B> A<B> {
   | ------------ the inner item doesn't inherit generics from this impl, so `Self` is invalid to reference
LL |     fn d() {
LL |         fn d() {
   |            - `Self` used in this inner item
LL |             Self(1)
   |             ^^^^ help: replace `Self` with the actual type: `A`
```
2025-11-03 11:52:41 +11:00
..
2025-11-02 20:12:26 +00:00
2025-07-25 20:38:54 +05:00
2025-06-08 11:25:09 +05:00
2024-10-18 00:33:50 +02:00
2025-08-09 16:27:20 +05:00
2025-07-31 21:25:49 +05:00
2025-08-05 19:34:46 +05:00
2025-08-19 21:27:10 +02:00
2025-08-09 16:27:20 +05:00
2024-04-07 17:38:07 -03:00
2024-03-03 16:30:48 -03:00
2024-03-03 16:30:48 -03:00
2024-03-03 16:30:48 -03:00
2023-04-20 15:06:17 -03:00
2023-10-13 19:18:46 +00:00
2025-02-03 10:39:32 -05:00
2023-12-05 17:15:46 +00:00
2025-08-09 16:27:20 +05:00
2025-06-30 11:50:19 +05:00
2025-06-30 11:50:19 +05:00
2024-01-05 10:00:59 +00:00
2025-08-05 19:34:46 +05:00
2025-08-05 19:34:46 +05:00