Skip to content

Commit

Permalink
Rollup merge of rust-lang#60942 - bjorn3:metadata_loader_refactor, r=…
Browse files Browse the repository at this point in the history
…michaelwoerister

Misc changes to rustc_metadata
  • Loading branch information
Centril committed May 20, 2019
2 parents 3f86fad + cb0039e commit 65cec43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/librustc_metadata/creader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
}
}
}
Expand Down Expand Up @@ -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(),
Expand Down
5 changes: 2 additions & 3 deletions src/librustc_metadata/locator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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()));
Expand Down

0 comments on commit 65cec43

Please sign in to comment.