Sum of N primes in parallel-ish Linq's AsParallel() call would be my normal way of doing something like this, but Rust hasn't stolen that just yet. This method has obvious shortcomings, but I'm still sort of hoping for it to shave off a little time by engaging a second core.

How can I achieve this less terribly?

use std::num::Float;
use std::sync::Future;

fn main() {
    // This implementation cheats because it knows the biggest prime value
    // in the range: 7919. Getting primes in parallel is a pain in the ass 
    // pretty much no matter what, and it's probably not worth it, but on 
    // the up side... Eh. Whatever. Only other way I know to do this would 
    // be to get the first *1001* primes, sort them, and then fold the first 
    // thousand after stuffing them into a vector.

    let mut path_1 = Future::spawn(proc() {
        Unfold::new(3, incr).filter(prime).take_while(|n| *n &lt;= 7919).fold(0i, |a, b| a + b)
    });
    let mut path_2 = Future::spawn(proc() {
        Unfold::new(5, incr).filter(prime).take_while(|n| *n &lt;= 7919).fold(0i, |a, b| a + b)
    });

    // As you can see, my plan here was to get 999 primes (skipping 2) 
    // and then add 2 back in later on.
    println!("{}", path_1.get() + path_2.get() + 2);
}

fn incr(n: &amp;mut int) -&gt; Option&lt;int&gt; {
    let r = Some(*n);
    *n = *n + 4; 
    r
}

fn prime(n: &amp;int) -&gt; bool {
    match n {
        &amp;1 =&gt; false,
        &amp;2 =&gt; true,
        &amp;3 =&gt; true,
        n if *n % 2 == 0 =&gt; false,
        _ =&gt; {
            let max = (*n as f64).sqrt() as int + 1;
            !range(2, max).any(|i| *n % i == 0)
        }
    }
}
It isn't clear to me what you are asking. However, I was able to update your code and run it:

use std::thread;

struct PrimeIncrement(i64);

impl Iterator for PrimeIncrement {
    type Item = i64;
    fn next(&amp;mut self) -&gt; Option&lt;i64&gt; {
        self.0 += 4; // What do you mean "integer overflow"? ^_^
        Some(self.0)
    }
}

fn main() {
    let path_1 = thread::scoped(|| {
        PrimeIncrement(3).filter(prime).take_while(|&amp;n| n &lt;= 7919).fold(0, |a, b| a + b)
    });
    let path_2 = thread::scoped(|| {
        PrimeIncrement(5).filter(prime).take_while(|&amp;n| n &lt;= 7919).fold(0, |a, b| a + b)
    });

    let a = path_1.join();
    let b = path_2.join();

    println!("{}", 2 + a + b);
}

fn prime(n: &amp;i64) -&gt; bool {
    match n {
        &amp;1 =&gt; false,
        &amp;2 =&gt; true,
        &amp;3 =&gt; true,
        n if *n % 2 == 0 =&gt; false,
        _ =&gt; {
            let max = (*n as f64).sqrt() as i64 + 1;
            !(2..max).any(|i| *n % i == 0)
        }
    }
}


The main changes were:


Removing Unfold, as it isn't stable in the 1.0 beta.
Using thread::scoped instead of a Future.
Using i64 instead of int


Update for Rust 1.3

The thread::scoped API was found to have soundness problems and has been deprecated. In this case, thread::spawn is powerful enough, so I've replaced that:

use std::thread;

struct PrimeIncrement(i64);

impl Iterator for PrimeIncrement {
    type Item = i64;
    fn next(&amp;mut self) -&gt; Option&lt;i64&gt; {
        self.0 += 4; // What do you mean "integer overflow"? ^_^
        Some(self.0)
    }
}

fn main() {
    let path_1 = thread::spawn(|| {
        PrimeIncrement(3).filter(prime).take_while(|&amp;n| n &lt;= 7919).fold(0, |a, b| a + b)
    });
    let path_2 = thread::spawn(|| {
        PrimeIncrement(5).filter(prime).take_while(|&amp;n| n &lt;= 7919).fold(0, |a, b| a + b)
    });

    let a = path_1.join().unwrap();
    let b = path_2.join().unwrap();

    println!("{}", 2 + a + b);
}

fn prime(n: &amp;i64) -&gt; bool {
    match *n {
        1 =&gt; false,
        2 =&gt; true,
        3 =&gt; true,
        n if n % 2 == 0 =&gt; false,
        n =&gt; {
            let max = (n as f64).sqrt() as i64 + 1;
            !(2..max).any(|i| n % i == 0)
        }
    }
}


Additionally, I now match on *n, which avoids the need to have quite as many dereferences.