fork/rust

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

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
1.3 KiB37 linesraw
1error[E0401]: can't use generic parameters from outer function
2  --> $DIR/E0401.rs:4:39
3   |
4LL | fn foo<T>(x: T) {
5   |        - type parameter from outer function
6LL |     fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
7   |        ---------------------------    ^ use of generic parameter from outer function
8   |        |
9   |        help: try using a local generic parameter instead: `bfnr<U, V: Baz<U>, W: Fn(), T>`
10
11error[E0401]: can't use generic parameters from outer function
12  --> $DIR/E0401.rs:9:16
13   |
14LL | fn foo<T>(x: T) {
15   |        - type parameter from outer function
16...
17LL |     fn baz<U,
18   |        --- try adding a local generic parameter in this method instead
19...
20LL |            (y: T) {
21   |                ^ use of generic parameter from outer function
22
23error[E0401]: can't use generic parameters from outer function
24  --> $DIR/E0401.rs:22:25
25   |
26LL | impl<T> Iterator for A<T> {
27   | ---- `Self` type implicitly declared here, by this `impl`
28...
29LL |         fn helper(sel: &Self) -> u8 {
30   |                         ^^^^
31   |                         |
32   |                         use of generic parameter from outer function
33   |                         use a type here instead
34
35error: aborting due to 3 previous errors
36
37For more information about this error, try `rustc --explain E0401`.