]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0401.stderr
Rollup merge of #97915 - tbu-:pr_os_string_fmt_write, r=joshtriplett
[rust.git] / src / test / ui / error-codes / E0401.stderr
1 error[E0401]: can't use generic parameters from outer function
2   --> $DIR/E0401.rs:4:39
3    |
4 LL | fn foo<T>(x: T) {
5    |        - type parameter from outer function
6 LL |     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
11 error[E0401]: can't use generic parameters from outer function
12   --> $DIR/E0401.rs:9:16
13    |
14 LL | fn foo<T>(x: T) {
15    |        - type parameter from outer function
16 ...
17 LL |     fn baz<U,
18    |        --- try adding a local generic parameter in this method instead
19 ...
20 LL |            (y: T) {
21    |                ^ use of generic parameter from outer function
22
23 error[E0401]: can't use generic parameters from outer function
24   --> $DIR/E0401.rs:22:25
25    |
26 LL | impl<T> Iterator for A<T> {
27    | ---- `Self` type implicitly declared here, by this `impl`
28 ...
29 LL |         fn helper(sel: &Self) -> u8 {
30    |                         ^^^^
31    |                         |
32    |                         use of generic parameter from outer function
33    |                         use a type here instead
34
35 error[E0282]: type annotations needed
36   --> $DIR/E0401.rs:11:5
37    |
38 LL |     bfnr(x);
39    |     ^^^^ cannot infer type of the type parameter `U` declared on the function `bfnr`
40    |
41 help: consider specifying the generic arguments
42    |
43 LL |     bfnr::<U, V, W>(x);
44    |         +++++++++++
45
46 error: aborting due to 4 previous errors
47
48 Some errors have detailed explanations: E0282, E0401.
49 For more information about an error, try `rustc --explain E0282`.