2023-09-10 21:06:14 +00:00
|
|
|
error[E0401]: can't use generic parameters from outer item
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/E0401.rs:4:39
|
2018-02-08 03:35:35 +00:00
|
|
|
|
|
2018-02-07 15:26:35 +00:00
|
|
|
LL | fn foo<T>(x: T) {
|
2023-09-10 21:06:14 +00:00
|
|
|
| - type parameter from outer item
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
|
2023-09-10 21:06:14 +00:00
|
|
|
| - ^ use of generic parameter from outer item
|
2022-07-14 13:09:30 +00:00
|
|
|
| |
|
2023-09-10 21:06:14 +00:00
|
|
|
| help: try introducing a local generic parameter here: `T,`
|
2018-02-08 03:35:35 +00:00
|
|
|
|
2023-09-10 21:06:14 +00:00
|
|
|
error[E0401]: can't use generic parameters from outer item
|
2018-12-25 15:56:47 +00:00
|
|
|
--> $DIR/E0401.rs:9:16
|
2018-02-07 15:26:35 +00:00
|
|
|
|
|
|
|
|
LL | fn foo<T>(x: T) {
|
2023-09-10 21:06:14 +00:00
|
|
|
| - type parameter from outer item
|
2018-02-07 15:26:35 +00:00
|
|
|
...
|
2018-03-14 05:58:45 +00:00
|
|
|
LL | fn baz<U,
|
2023-09-10 21:06:14 +00:00
|
|
|
| - help: try introducing a local generic parameter here: `T,`
|
2018-03-14 05:58:45 +00:00
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | (y: T) {
|
2023-09-10 21:06:14 +00:00
|
|
|
| ^ use of generic parameter from outer item
|
2018-02-07 15:26:35 +00:00
|
|
|
|
2023-09-10 21:06:14 +00:00
|
|
|
error[E0401]: can't use generic parameters from outer item
|
2022-10-19 15:17:19 +00:00
|
|
|
--> $DIR/E0401.rs:24:25
|
2018-02-07 15:26:35 +00:00
|
|
|
|
|
|
|
|
LL | impl<T> Iterator for A<T> {
|
2018-09-05 16:56:01 +00:00
|
|
|
| ---- `Self` type implicitly declared here, by this `impl`
|
2018-02-07 15:26:35 +00:00
|
|
|
...
|
2019-03-09 12:03:44 +00:00
|
|
|
LL | fn helper(sel: &Self) -> u8 {
|
2018-09-04 17:41:33 +00:00
|
|
|
| ^^^^
|
|
|
|
| |
|
2023-09-10 21:06:14 +00:00
|
|
|
| use of generic parameter from outer item
|
|
|
|
| refer to the type directly here instead
|
2018-02-07 15:26:35 +00:00
|
|
|
|
2023-08-14 13:09:53 +00:00
|
|
|
error[E0283]: type annotations needed
|
2019-09-24 18:05:49 +00:00
|
|
|
--> $DIR/E0401.rs:11:5
|
|
|
|
|
|
|
|
|
LL | bfnr(x);
|
2023-08-14 13:09:53 +00:00
|
|
|
| ^^^^ cannot infer type of the type parameter `V` declared on the function `bfnr`
|
|
|
|
|
|
|
|
|
= note: cannot satisfy `_: Baz<_>`
|
|
|
|
note: required by a bound in `bfnr`
|
|
|
|
--> $DIR/E0401.rs:4:19
|
2022-05-20 04:49:41 +00:00
|
|
|
|
|
2023-08-14 13:09:53 +00:00
|
|
|
LL | fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
|
|
|
|
| ^^^^^^ required by this bound in `bfnr`
|
2022-02-14 12:25:26 +00:00
|
|
|
help: consider specifying the generic arguments
|
2022-05-20 04:49:41 +00:00
|
|
|
|
|
2022-02-14 12:25:26 +00:00
|
|
|
LL | bfnr::<U, V, W>(x);
|
|
|
|
| +++++++++++
|
2019-09-24 18:05:49 +00:00
|
|
|
|
2022-10-19 15:17:19 +00:00
|
|
|
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`
|
2022-12-10 20:19:29 +00:00
|
|
|
help: consider specifying the generic arguments
|
2022-10-19 15:17:19 +00:00
|
|
|
|
|
|
|
|
LL | bfnr::<U, V, W>(x);
|
|
|
|
| +++++++++++
|
|
|
|
|
|
|
|
error: aborting due to 5 previous errors
|
2018-02-08 03:35:35 +00:00
|
|
|
|
2023-08-14 13:09:53 +00:00
|
|
|
Some errors have detailed explanations: E0283, E0401.
|
|
|
|
For more information about an error, try `rustc --explain E0283`.
|