Allow --cfg on rustpkg test

Closes #10238
auto merge of #10282 : sfackler/rust/rustpkg-test-cfg, r=alexcrichton

Closes #10238