| 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 |
| | |
| = note: nested items are independent from their parent item for everything except for privacy and name resolution |
| help: try introducing a local generic parameter here |
| | |
| LL | fn bfnr<T, U, V: Baz<U>, W: Fn()>(y: T) { |
| | ++ |
| |
| error[E0401]: can't use generic parameters from outer item |
| --> $DIR/E0401.rs:9:16 |
| | |
| LL | fn foo<T>(x: T) { |
| | - type parameter from outer item |
| ... |
| LL | fn baz<U, |
| | --- generic parameter used in this inner function |
| ... |
| LL | (y: T) { |
| | ^ use of generic parameter from outer item |
| | |
| = note: nested items are independent from their parent item for everything except for privacy and name resolution |
| help: try introducing a local generic parameter here |
| | |
| LL | fn baz<T, U, |
| | ++ |
| |
| error[E0401]: can't use `Self` from outer item |
| --> $DIR/E0401.rs:22:25 |
| | |
| LL | impl<T> Iterator for A<T> { |
| | ---- `Self` type implicitly declared here, by this `impl` |
| ... |
| LL | fn helper(sel: &Self) -> u8 { |
| | ------ ^^^^ use of `Self` from outer item |
| | | |
| | `Self` used in this inner function |
| | |
| = note: nested items are independent from their parent item for everything except for privacy and name resolution |
| help: refer to the type directly here instead |
| | |
| LL - fn helper(sel: &Self) -> u8 { |
| LL + fn helper(sel: &A<T>) -> u8 { |
| | |
| |
| error: aborting due to 3 previous errors |
| |
| For more information about this error, try `rustc --explain E0401`. |