test: Remove most uses of `&fn()` from the tests.
auto merge of #10572 : pcwalton/rust/more-bars, r=alexcrichton

r? @alexcrichton