Open
Description
Hi,
A recent commit bdacdfe made the DefaultMetadataLoader
struct private to the crate.
This makes it impossible to print out the crate metadata using the given functions unless I define my own struct which implements the MetadataLoader
trait. I'm currently just trying to understand the metadata file better, and am working with an older version of the Rust compiler so that I can access this type. I'm wondering why this type was made private.
Here is the code I'm using which works with an older version of the compiler:
fn main() {
let path = std::env::args().nth(1).expect("no path given");
let path = Path::new(&path);
let triple = TargetTriple::from_triple("x86_64-apple-darwin");
let target = Target::expect_builtin(&triple);
let mut stdout = io::stdout();
rustc_span::create_session_globals_then(Edition::Edition2018, || {
let _ = locator::list_file_metadata(&target, path, &DefaultMetadataLoader, &mut stdout);
});
}