]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_metadata/creader.rs
rustc_metadata: Privatize `CrateMetadata::source`
[rust.git] / src / librustc_metadata / creader.rs
index 32548081e62997a36e6fcf5bae93872416b7b397..31d783f4afc7a68dfd9550d5fe7a548805e5bd35 100644 (file)
@@ -51,10 +51,10 @@ fn dump_crates(cstore: &CStore) {
         info!("  cnum: {}", cnum);
         info!("  hash: {}", data.root.hash);
         info!("  reqd: {:?}", *data.dep_kind.lock());
-        let CrateSource { dylib, rlib, rmeta } = data.source.clone();
-        dylib.map(|dl| info!("  dylib: {}", dl.0.display()));
-        rlib.map(|rl|  info!("   rlib: {}", rl.0.display()));
-        rmeta.map(|rl| info!("   rmeta: {}", rl.0.display()));
+        let CrateSource { dylib, rlib, rmeta } = data.source();
+        dylib.as_ref().map(|dl| info!("  dylib: {}", dl.0.display()));
+        rlib.as_ref().map(|rl|  info!("   rlib: {}", rl.0.display()));
+        rmeta.as_ref().map(|rl| info!("   rmeta: {}", rl.0.display()));
     });
 }
 
@@ -118,7 +118,7 @@ fn existing_match(&self, name: Symbol, hash: Option<&Svh>, kind: PathKind)
             // We're also sure to compare *paths*, not actual byte slices. The
             // `source` stores paths which are normalized which may be different
             // from the strings on the command line.
-            let source = &self.cstore.get_crate_data(cnum).source;
+            let source = self.cstore.get_crate_data(cnum).source();
             if let Some(entry) = self.sess.opts.externs.get(&name.as_str()) {
                 // Only use `--extern crate_name=path` here, not `--extern crate_name`.
                 let found = entry.locations.iter().filter_map(|l| l.as_ref()).any(|l| {