Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- #[derive(Debug)] struct Foo { vec: Vec<(bool, u128)> } impl Foo { fn bar(&self) { let (mut a, mut b) = (0, 0); let mut iter = self.vec.iter(); loop { let _ = b.checked_sub(a); match iter.next() { Some(&(false, n)) => a = n, Some(&(true, n)) => b = n, None => break }; } } }
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error[E0689]: can't call method `checked_sub` on ambiguous numeric type `{integer}`
- --> src/main.rs:6:169
- |
- 6 | #[derive(Debug)] struct Foo { vec: Vec<(bool, u128)> } impl Foo { fn bar(&self) { let (mut a, mut b) = (0, 0); let mut iter = self.vec.iter(); loop { let _ = b.checked_sub(a); match iter.next() { Some(&(false, n)) => a = n, Some(&(true, n)) => b = n, None => break }; } } }
- | ----- you must specify a type for this binding, like `i32` ^^^^^^^^^^^
- error: aborting due to previous error
- For more information about this error, try `rustc --explain E0689`.
- error: Could not compile `playground`.
- To learn more, run the command again with --verbose.
- */
- /* ~~~~=== stdout ===~~~~
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement