mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
Rollup merge of #60942 - bjorn3:metadata_loader_refactor, r=michaelwoerister
Misc changes to rustc_metadata
This commit is contained in:
commit
65cec43ce1
@ -95,7 +95,7 @@ enum LoadError<'a> {
|
||||
impl<'a> LoadError<'a> {
|
||||
fn report(self) -> ! {
|
||||
match self {
|
||||
LoadError::LocatorError(mut locate_ctxt) => locate_ctxt.report_errs(),
|
||||
LoadError::LocatorError(locate_ctxt) => locate_ctxt.report_errs(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -365,8 +365,8 @@ impl<'a> CrateLoader<'a> {
|
||||
span,
|
||||
ident,
|
||||
crate_name: name,
|
||||
hash: hash.map(|a| &*a),
|
||||
extra_filename: extra_filename,
|
||||
hash,
|
||||
extra_filename,
|
||||
filesearch: self.sess.target_filesearch(path_kind),
|
||||
target: &self.sess.target.target,
|
||||
triple: self.sess.opts.target_triple.clone(),
|
||||
|
@ -321,7 +321,7 @@ impl<'a> Context<'a> {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn report_errs(&mut self) -> ! {
|
||||
pub fn report_errs(self) -> ! {
|
||||
let add = match self.root {
|
||||
&None => String::new(),
|
||||
&Some(ref r) => format!(" which `{}` depends on", r.ident),
|
||||
@ -901,8 +901,7 @@ fn get_metadata_section_imp(target: &Target,
|
||||
let mut inflated = Vec::new();
|
||||
match DeflateDecoder::new(compressed_bytes).read_to_end(&mut inflated) {
|
||||
Ok(_) => {
|
||||
let buf = unsafe { OwningRef::new_assert_stable_address(inflated) };
|
||||
rustc_erase_owner!(buf.map_owner_box())
|
||||
rustc_erase_owner!(OwningRef::new(inflated).map_owner_box())
|
||||
}
|
||||
Err(_) => {
|
||||
return Err(format!("failed to decompress metadata: {}", filename.display()));
|
||||
|
Loading…
Reference in New Issue
Block a user