| error[E0401]: can't use generic parameters from outer item | |
| --> $DIR/generic-params-nested-fn-scope-error.rs:5:16 | |
| | | |
| LL | fn foo<U>(v: Vec<U>) -> U { | |
| | - type parameter from outer item | |
| LL | fn bar(w: [U]) -> U { | |
| | --- ^ 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<U>(w: [U]) -> U { | |
| | +++ | |
| error[E0401]: can't use generic parameters from outer item | |
| --> $DIR/generic-params-nested-fn-scope-error.rs:5:23 | |
| | | |
| LL | fn foo<U>(v: Vec<U>) -> U { | |
| | - type parameter from outer item | |
| LL | fn bar(w: [U]) -> U { | |
| | --- ^ 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<U>(w: [U]) -> U { | |
| | +++ | |
| error: aborting due to 2 previous errors | |
| For more information about this error, try `rustc --explain E0401`. |