Created
March 14, 2017 03:12
-
-
Save eevee/f184be39325f800f4ba6ee04d319b563 to your computer and use it in GitHub Desktop.
weird-ass rust problem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum IResult<I, O, E = u32> { | |
| Done(I, O), | |
| Error(E), | |
| } | |
| fn foo(input: &[u8]) { | |
| if let IResult::Done(i, o) = IResult::Done(input, input) {} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ rustc --crate-type lib lib-minimal.rs -Ltarget/debug/deps | |
| error[E0282]: unable to infer enough type information about `E` | |
| --> lib-minimal.rs:7:34 | |
| | | |
| 7 | if let IResult::Done(i, o) = IResult::Done(input, input) {} | |
| | ^^^^^^^^^^^^^ cannot infer type for `E` | |
| | | |
| = note: type annotations or generic parameter binding required | |
| error: aborting due to previous error | |
| $ rustc --version | |
| rustc 1.15.1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment