Random patches (incl. #[quickcheck] syntax extension)

I finally got around to bringing https://github.com/rust-lang/rust/pull/14100 upstream.

This includes @MrAlert's `#[quickcheck]` syntax extension (the first 2 commits) and a few other minor fixes.