Skip to content
This repository was archived by the owner on Dec 29, 2022. It is now read-only.

Commit 7ee3bb8

Browse files
authored
Merge pull request #1204 from ehuss/update-cargo
Update cargo.
2 parents 8c33155 + e6e6cb2 commit 7ee3bb8

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

Cargo.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ categories = ["development-tools"]
1111
build = "build.rs"
1212

1313
[dependencies]
14-
cargo = { git = "https://github.com/rust-lang/cargo", rev = "5c3b8f2d9ccc4c6c890f073ccf97115779184cb4" }
14+
cargo = { git = "https://github.com/rust-lang/cargo", rev = "2a9f16da7ffc4877aacf7547bac705f0d82de2d6" }
1515
cargo_metadata = "0.6"
1616
clippy_lints = { git = "https://github.com/rust-lang/rust-clippy", rev = "a3c77f6ad1c1c185e561e9cd7fdec7db569169d1", optional = true }
1717
env_logger = "0.5"

src/build/cargo_plan.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,20 +212,21 @@ impl CargoPlan {
212212
.units
213213
.iter()
214214
.filter(|&(&(_, ref target, _), _)| {
215-
*target.kind() == TargetKind::CustomBuild && target.src_path().is_path()
215+
target.is_custom_build() && target.src_path().is_path()
216216
})
217-
.map(|(key, unit)| (unit.target.src_path().path(), key.clone()))
217+
.map(|(key, unit)| (unit.target.src_path().path().unwrap(), key.clone()))
218218
.collect();
219219
let other_targets: HashMap<UnitKey, &Path> = self
220220
.units
221221
.iter()
222-
.filter(|&(&(_, ref target, _), _)| *target.kind() != TargetKind::CustomBuild)
222+
.filter(|&(&(_, ref target, _), _)| !target.is_custom_build())
223223
.map(|(key, unit)| {
224224
(
225225
key.clone(),
226226
unit.target
227227
.src_path()
228228
.path()
229+
.expect("normal targets should have a path")
229230
.parent()
230231
.expect("no parent for src_path"),
231232
)

src/project_model.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,15 @@ impl ProjectModel {
8282
.iter()
8383
.find(|t| t.is_lib())
8484
// racer expect name 'underscored'(crate) name
85-
.map(|t| (t.src_path().path().to_owned(), t.name().replace('-', "_"))),
85+
.map(|t| {
86+
(
87+
t.src_path()
88+
.path()
89+
.expect("lib must have a path")
90+
.to_owned(),
91+
t.name().replace('-', "_"),
92+
)
93+
}),
8694
deps: Vec::new(),
8795
edition: match cargo_pkg.manifest().edition() {
8896
cargo::core::Edition::Edition2015 => racer::Edition::Ed2015,

0 commit comments

Comments
 (0)