You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies if this is a known problem already. I was working through a fairly simple Project Euler problem to learn some Rust and I think I found an issue (with possibly the type checker?).
I tried this code:
fnmain(){letmut iterator = (1..).filter(|x| x % 1 == 0).filter(|x| x % 2 == 0).filter(|x| x % 3 == 0).filter(|x| x % 4 == 0).filter(|x| x % 5 == 0).filter(|x| x % 6 == 0)// .filter(|x| x % 7 == 0)// .filter(|x| x % 8 == 0)// .filter(|x| x % 9 == 0)// .filter(|x| x % 10 == 0);let answer = iterator.next().unwrap();println!("{}", answer);}
I expected to see this happen: Compiling this should be pretty fast.
Instead, this happened: Exponential slowdown as I uncomment each filter line one by one
Apologies if this is a known problem already. I was working through a fairly simple Project Euler problem to learn some Rust and I think I found an issue (with possibly the type checker?).
I tried this code:
I expected to see this happen: Compiling this should be pretty fast.
Instead, this happened: Exponential slowdown as I uncomment each filter line one by one
Meta
rustc --version --verbose
:Backtrace: No backtrace
The text was updated successfully, but these errors were encountered: