Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unreachable_code)]
- fn main() {
- println!("{:?}", {
- use std::mem::replace; pub fn fibonacci() -> impl Iterator<Item=u128> { let mut (a, b) = (0, 1); std::iter::from_fn(|| replace(&mut a, replace(&mut b, a + b))) }
- });
- }
- /* ~~~~=== stderr ===~~~~
- Compiling playground v0.0.1 (/playground)
- error: expected identifier, found `(`
- --> src/main.rs:6:89
- |
- 6 | use std::mem::replace; pub fn fibonacci() -> impl Iterator<Item=u128> { let mut (a, b) = (0, 1); std::iter::from_fn(|| replace(&mut a, replace(&mut b, a + b))) }
- | ^ expected identifier
- warning: unused import: `std::mem::replace`
- --> src/main.rs:6:13
- |
- 6 | use std::mem::replace; pub fn fibonacci() -> impl Iterator<Item=u128> { let mut (a, b) = (0, 1); std::iter::from_fn(|| replace(&mut a, replace(&mut b, a + b))) }
- | ^^^^^^^^^^^^^^^^^
- |
- = note: #[warn(unused_imports)] on by default
- error: aborting due to previous error
- 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