rust/src/test/ui/error-codes/E0401.stderr

38 lines
1.3 KiB
Plaintext
Raw Normal View History

error[E0401]: can't use generic parameters from outer function
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) {
| - type variable from outer function
2019-03-09 12:03:44 +00:00
LL | fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
| --------------------------- ^ use of generic parameter from outer function
2018-02-07 15:26:35 +00:00
| |
| help: try using a local generic parameter instead: `bfnr<U, V: Baz<U>, W: Fn(), T>`
2018-02-08 03:35:35 +00:00
error[E0401]: can't use generic parameters from outer function
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) {
| - type variable from outer function
...
LL | fn baz<U,
| --- try adding a local generic parameter in this method instead
...
2019-03-09 12:03:44 +00:00
LL | (y: T) {
| ^ use of generic parameter from outer function
2018-02-07 15:26:35 +00:00
error[E0401]: can't use generic parameters from outer function
2018-12-25 15:56:47 +00:00
--> $DIR/E0401.rs:22: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 {
| ^^^^
| |
| use of generic parameter from outer function
2018-09-05 15:39:50 +00:00
| use a type here instead
2018-02-07 15:26:35 +00:00
error: aborting due to 3 previous errors
2018-02-08 03:35:35 +00:00
2018-03-03 14:59:40 +00:00
For more information about this error, try `rustc --explain E0401`.