summaryrefslogtreecommitdiffstats
path: root/tests/ui/error-codes/E0401.stderr
blob: 928c8d11d2030ab0963345bfc131bc89e660377b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
error[E0401]: can't use generic parameters from outer item
  --> $DIR/E0401.rs:4:39
   |
LL | fn foo<T>(x: T) {
   |        - type parameter from outer item
LL |     fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
   |             -                         ^ use of generic parameter from outer item
   |             |
   |             help: try introducing a local generic parameter here: `T,`

error[E0401]: can't use generic parameters from outer item
  --> $DIR/E0401.rs:9:16
   |
LL | fn foo<T>(x: T) {
   |        - type parameter from outer item
...
LL |     fn baz<U,
   |            - help: try introducing a local generic parameter here: `T,`
...
LL |            (y: T) {
   |                ^ use of generic parameter from outer item

error[E0401]: can't use generic parameters from outer item
  --> $DIR/E0401.rs:24:25
   |
LL | impl<T> Iterator for A<T> {
   | ---- `Self` type implicitly declared here, by this `impl`
...
LL |         fn helper(sel: &Self) -> u8 {
   |                         ^^^^
   |                         |
   |                         use of generic parameter from outer item
   |                         refer to the type directly here instead

error[E0282]: type annotations needed
  --> $DIR/E0401.rs:11:5
   |
LL |     bfnr(x);
   |     ^^^^ cannot infer type of the type parameter `U` declared on the function `bfnr`
   |
help: consider specifying the generic arguments
   |
LL |     bfnr::<U, V, W>(x);
   |         +++++++++++

error[E0283]: type annotations needed
  --> $DIR/E0401.rs:11:5
   |
LL |     bfnr(x);
   |     ^^^^ cannot infer type of the type parameter `W` declared on the function `bfnr`
   |
   = note: multiple `impl`s satisfying `_: Fn<()>` found in the following crates: `alloc`, `core`:
           - impl<A, F> Fn<A> for &F
             where A: Tuple, F: Fn<A>, F: ?Sized;
           - impl<Args, F, A> Fn<Args> for Box<F, A>
             where Args: Tuple, F: Fn<Args>, A: Allocator, F: ?Sized;
note: required by a bound in `bfnr`
  --> $DIR/E0401.rs:4:30
   |
LL |     fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
   |                              ^^^^ required by this bound in `bfnr`
help: consider specifying the generic arguments
   |
LL |     bfnr::<U, V, W>(x);
   |         +++++++++++

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0282, E0283, E0401.
For more information about an error, try `rustc --explain E0282`.