@@ -4,11 +4,13 @@ error[E0401]: can't use generic parameters from outer item
44LL | fn outer<T: Tr>() { // outer function
55 | - type parameter from outer item
66LL | const K: u32 = T::C;
7- | - ^^^^ use of generic parameter from outer item
8- | |
9- | help: try introducing a local generic parameter here: `<T>`
7+ | ^^^^ use of generic parameter from outer item
108 |
119 = note: a `const` is a separate item from the item that contains it
10+ help: try introducing a local generic parameter here
11+ |
12+ LL | const K<T>: u32 = T::C;
13+ | +++
1214
1315error[E0401]: can't use generic parameters from outer item
1416 --> $DIR/generic-params-from-outer-item-in-const-item.rs:19:24
@@ -17,23 +19,27 @@ LL | impl<T> Tr for T { // outer impl block
1719 | - type parameter from outer item
1820LL | const C: u32 = {
1921LL | const I: u32 = T::C;
20- | - ^^^^ use of generic parameter from outer item
21- | |
22- | help: try introducing a local generic parameter here: `<T>`
22+ | ^^^^ use of generic parameter from outer item
2323 |
2424 = note: a `const` is a separate item from the item that contains it
25+ help: try introducing a local generic parameter here
26+ |
27+ LL | const I<T>: u32 = T::C;
28+ | +++
2529
2630error[E0401]: can't use generic parameters from outer item
2731 --> $DIR/generic-params-from-outer-item-in-const-item.rs:27:20
2832 |
2933LL | struct S<T: Tr>(U32<{ // outer struct
3034 | - type parameter from outer item
3135LL | const _: u32 = T::C;
32- | - ^^^^ use of generic parameter from outer item
33- | |
34- | help: try introducing a local generic parameter here: `<T>`
36+ | ^^^^ use of generic parameter from outer item
3537 |
3638 = note: a `const` is a separate item from the item that contains it
39+ help: try introducing a local generic parameter here
40+ |
41+ LL | const _<T>: u32 = T::C;
42+ | +++
3743
3844error: aborting due to 3 previous errors
3945
0 commit comments