rust-refactor icon indicating copy to clipboard operation
rust-refactor copied to clipboard

Expand global imports (only including the ones used)

Open aochagavia opened this issue 10 years ago • 2 comments

aochagavia avatar Nov 20 '15 09:11 aochagavia

@nrc I noticed librustc_trans/save doesn't collect information about use statements. Do we need to add a UseData or should we work directly with rustc_resolve?

aochagavia avatar Nov 20 '15 11:11 aochagavia

There is this for globs which does what you want (I believe): https://dxr.mozilla.org/rust/source/src/librustc_trans/save/dump_csv.rs#857-879 (other than rewriting the source code itself). You would want to move it from dump_csv to the API (or just read it from the csv file).

nrc avatar Nov 20 '15 19:11 nrc