Skip to content

Commit cb0039e

Browse files
committed
Misc changes to rustc_metadata
1 parent b8aa422 commit cb0039e

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/librustc_metadata/creader.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ enum LoadError<'a> {
9595
impl<'a> LoadError<'a> {
9696
fn report(self) -> ! {
9797
match self {
98-
LoadError::LocatorError(mut locate_ctxt) => locate_ctxt.report_errs(),
98+
LoadError::LocatorError(locate_ctxt) => locate_ctxt.report_errs(),
9999
}
100100
}
101101
}
@@ -365,8 +365,8 @@ impl<'a> CrateLoader<'a> {
365365
span,
366366
ident,
367367
crate_name: name,
368-
hash: hash.map(|a| &*a),
369-
extra_filename: extra_filename,
368+
hash,
369+
extra_filename,
370370
filesearch: self.sess.target_filesearch(path_kind),
371371
target: &self.sess.target.target,
372372
triple: self.sess.opts.target_triple.clone(),

src/librustc_metadata/locator.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ impl<'a> Context<'a> {
321321
}
322322
}
323323

324-
pub fn report_errs(&mut self) -> ! {
324+
pub fn report_errs(self) -> ! {
325325
let add = match self.root {
326326
&None => String::new(),
327327
&Some(ref r) => format!(" which `{}` depends on", r.ident),
@@ -901,8 +901,7 @@ fn get_metadata_section_imp(target: &Target,
901901
let mut inflated = Vec::new();
902902
match DeflateDecoder::new(compressed_bytes).read_to_end(&mut inflated) {
903903
Ok(_) => {
904-
let buf = unsafe { OwningRef::new_assert_stable_address(inflated) };
905-
rustc_erase_owner!(buf.map_owner_box())
904+
rustc_erase_owner!(OwningRef::new(inflated).map_owner_box())
906905
}
907906
Err(_) => {
908907
return Err(format!("failed to decompress metadata: {}", filename.display()));

0 commit comments

Comments
 (0)