blob: ebddd7014748a7579a8c92e7db14ba0bca342846 [file]
error[E0401]: can't use generic parameters from outer item
--> $DIR/bad-type-env-capture.rs:2:15
|
LL | fn foo<T>() {
| - type parameter from outer item
LL | fn bar(b: 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 bar<T>(b: T) { }
| +++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0401`.