Mutex::lock
returns a "guard" value. This guard is what gives you access to the contents of the mutex. The guard also keeps the mutex locked as long as it still exists; once the guard is dropped, the mutex is automatically unlocked.
Although it's not exactly the same, that single line is roughly equivalent to:
let job = {
let guard = receiver.lock().unwrap(); // lock the mutex
let result = guard.recv().unwrap();
drop(guard); // automatically unlocks the mutex
result
};
The point of this arrangement is that you cannot access the value protected by the mutex without locking it to obtain a guard, as long as you hold the guard no one else can access it, and as soon as you drop the guard the mutex is unlocked.
I have no idea. The signature of recv
is:
fn recv(&self) -> Result<T, RecvError>
The &self
means that you do not need exclusive access to a Receiver
to call recv
. Also, I went back and checked, and this has been the case since Rust 1.0.
I can think of two possibilities:
- There is some unstated problem with accessing the...
wait a second. "unstated"? I don't think I actually checked... better make sure.
*goes back to the docs*
Oh hell.
Nevermind, found it. From the Receiver
documentation, right at the top:
(Emphasis mine.)
And, if we scroll down to check the implementations, we find:
impl<T: Send> Send for Receiver<T>
impl<T> !Sync for Receiver<T>
The issue here is that, whatever the signature of recv
says, the type is Send
, but !Sync
, meaning that although it can be sent to another thread, it cannot be safely accessed from multiple threads without synchronisation.
This synchronisation is precisely what Mutex
provides.
And that, dear reader, is why you should always check the docs. And double-check anything you're saying to make sure you're not about to make an ass out of yourself on the internet. 
(To be clear: I'm talking about myself. I really did almost post misinformation!)