rustpkg: extern mod inference

r? @graydon Addresses #5681