fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #68568 - pietroalbini:stable-next, r=pietroalbini5e1a799842b

1.41.0
887 B23 linesraw
1error[E0401]: can't use generic parameters from outer function
2  --> $DIR/nested-ty-params.rs:3:16
3   |
4LL | fn hd<U>(v: Vec<U> ) -> U {
5   |       - type parameter from outer function
6LL |     fn hd1(w: [U]) -> U { return w[0]; }
7   |        ---     ^ use of generic parameter from outer function
8   |        |
9   |        help: try using a local generic parameter instead: `hd1<U>`
10
11error[E0401]: can't use generic parameters from outer function
12  --> $DIR/nested-ty-params.rs:3:23
13   |
14LL | fn hd<U>(v: Vec<U> ) -> U {
15   |       - type parameter from outer function
16LL |     fn hd1(w: [U]) -> U { return w[0]; }
17   |        ---            ^ use of generic parameter from outer function
18   |        |
19   |        help: try using a local generic parameter instead: `hd1<U>`
20
21error: aborting due to 2 previous errors
22
23For more information about this error, try `rustc --explain E0401`.