]> git.proxmox.com Git - cargo.git/commitdiff
Remove Compilation.libraries
authorDale Wijnand <dale.wijnand@gmail.com>
Sat, 20 Oct 2018 08:02:56 +0000 (09:02 +0100)
committerDale Wijnand <dale.wijnand@gmail.com>
Sat, 20 Oct 2018 08:02:56 +0000 (09:02 +0100)
src/cargo/core/compiler/compilation.rs
src/cargo/core/compiler/context/mod.rs

index bda915b5b1f496c82d693116ee446e7362c4ceee..43224e2bd4e2bccb2f98e841db07bcc98badbf20 100644 (file)
@@ -21,11 +21,6 @@ pub struct Doctest {
 
 /// A structure returning the result of a compilation.
 pub struct Compilation<'cfg> {
-    /// A mapping from a package to the list of libraries that need to be
-    /// linked when working with that package.
-    // TODO: deprecated, remove
-    pub libraries: HashMap<PackageId, HashSet<(Target, PathBuf)>>,
-
     /// An array of all tests created during this compilation.
     pub tests: Vec<(Package, TargetKind, String, PathBuf)>,
 
@@ -106,7 +101,6 @@ impl<'cfg> Compilation<'cfg> {
             server.configure(&mut rustc);
         }
         Ok(Compilation {
-            libraries: HashMap::new(),
             native_dirs: BTreeSet::new(), // TODO: deprecated, remove
             root_output: PathBuf::from("/"),
             deps_output: PathBuf::from("/"),
index df5671403ae5ad2a688bdf3a9d1f6024973ada3b..225e6ebd53f6b914d8cf9fa18b82da95adc1340d 100644 (file)
@@ -189,13 +189,6 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
                     ));
                 } else if unit.target.is_bin() || unit.target.is_bin_example() {
                     self.compilation.binaries.push(bindst.clone());
-                } else if unit.target.is_lib() {
-                    let pkgid = unit.pkg.package_id().clone();
-                    self.compilation
-                        .libraries
-                        .entry(pkgid)
-                        .or_insert_with(HashSet::new)
-                        .insert((unit.target.clone(), output.path.clone()));
                 }
             }
 
@@ -212,24 +205,6 @@ impl<'a, 'cfg> Context<'a, 'cfg> {
                         .or_insert_with(Vec::new)
                         .push(("OUT_DIR".to_string(), out_dir));
                 }
-
-                if !dep.target.is_lib() {
-                    continue;
-                }
-                if dep.mode.is_doc() {
-                    continue;
-                }
-
-                let outputs = self.outputs(dep)?;
-                self.compilation
-                    .libraries
-                    .entry(unit.pkg.package_id().clone())
-                    .or_insert_with(HashSet::new)
-                    .extend(
-                        outputs
-                            .iter()
-                            .map(|output| (dep.target.clone(), output.path.clone())),
-                    );
             }
 
             if unit.mode == CompileMode::Doctest {