rust/src/test/ui/error-codes/E0401.stderr
Esteban Küber d9ab4ff9a3 Remove blanket silencing of "type annotation needed" errors
Remove blanket check for existence of other errors before emitting
"type annotation needed" errors, and add some eager checks to avoid
adding obligations when they refer to types that reference
`[type error]` in order to reduce unneded errors.
2019-09-24 11:31:14 -07:00

45 lines
1.5 KiB
Plaintext

error[E0401]: can't use generic parameters from outer function
--> $DIR/E0401.rs:4:39
|
LL | fn foo<T>(x: T) {
| - type parameter from outer function
LL | fn bfnr<U, V: Baz<U>, W: Fn()>(y: T) {
| --------------------------- ^ use of generic parameter from outer function
| |
| help: try using a local generic parameter instead: `bfnr<U, V: Baz<U>, W: Fn(), T>`
error[E0401]: can't use generic parameters from outer function
--> $DIR/E0401.rs:9:16
|
LL | fn foo<T>(x: T) {
| - type parameter from outer function
...
LL | fn baz<U,
| --- try adding a local generic parameter in this method instead
...
LL | (y: T) {
| ^ use of generic parameter from outer function
error[E0401]: can't use generic parameters from outer function
--> $DIR/E0401.rs:22: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 function
| use a type here instead
error[E0282]: type annotations needed
--> $DIR/E0401.rs:11:5
|
LL | bfnr(x);
| ^^^^ cannot infer type for `U`
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0282, E0401.
For more information about an error, try `rustc --explain E0282`.