Skip to content

Remove Compilation.libraries #6193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions src/cargo/core/compiler/compilation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)>,

Expand Down Expand Up @@ -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("/"),
Expand Down
25 changes: 0 additions & 25 deletions src/cargo/core/compiler/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}
}

Expand All @@ -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 {
Expand Down