error[E0401]: can't use generic parameters from outer function --> $DIR/E0401.rs:4:39 | LL | fn foo(x: T) { | - type parameter from outer function LL | fn bfnr, W: Fn()>(y: T) { | - ^ use of generic parameter from outer function | | | help: try using a local generic parameter instead: `T,` error[E0401]: can't use generic parameters from outer function --> $DIR/E0401.rs:9:16 | LL | fn foo(x: T) { | - type parameter from outer function ... LL | fn baz $DIR/E0401.rs:22:25 | LL | impl Iterator for A { | ---- `Self` type implicitly declared here, by this `impl` ... LL | fn helper(sel: &Self) -> u8 { | ^^^^ | | | use of generic parameter from outer function | use a type here instead error[E0282]: type annotations needed --> $DIR/E0401.rs:11:5 | LL | bfnr(x); | ^^^^ cannot infer type of the type parameter `U` declared on the function `bfnr` | help: consider specifying the generic arguments | LL | bfnr::(x); | +++++++++++ error: aborting due to 4 previous errors Some errors have detailed explanations: E0282, E0401. For more information about an error, try `rustc --explain E0282`.