Skip to content

Commit ce25922

Browse files
committed
Change package spec
1 parent 315d605 commit ce25922

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/cargo/core/compiler/future_incompat.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,9 @@ impl OnDiskReports {
228228
fn render_report(per_package_reports: &[FutureIncompatReportPackage]) -> BTreeMap<String, String> {
229229
let mut report: BTreeMap<String, String> = BTreeMap::new();
230230
for per_package in per_package_reports {
231+
let package_spec = format!("{}:{}", per_package.package_id.name(), per_package.package_id.version());
231232
let rendered = report
232-
.entry(per_package.package_id.to_string())
233+
.entry(package_spec)
233234
.or_default();
234235
rendered.push_str(&format!(
235236
"The package `{}` currently triggers the following future \

src/cargo/core/compiler/job_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -942,7 +942,7 @@ impl<'cfg> DrainState<'cfg> {
942942
- {name}
943943
- Repository: {url}
944944
- Detailed warning command: `cargo report future-incompatibilities --id {id} --crate '{name}'",
945-
name = package_id,
945+
name = format!("{}:{}", package_id.name(), package_id.version()),
946946
url = manifest
947947
.metadata()
948948
.repository

tests/testsuite/future_incompat_report.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ frequency = 'never'
161161
.env("RUSTFLAGS", "-Zfuture-incompat-test")
162162
.with_stderr_contains(FUTURE_OUTPUT)
163163
.with_stderr_contains("warning: the following packages contain code that will be rejected by a future version of Rust: foo v0.0.0 [..]")
164-
.with_stderr_contains(" - foo v0.0.0[..]")
164+
.with_stderr_contains(" - foo:0.0.0[..]")
165165
.run();
166166
}
167167
}
@@ -213,18 +213,18 @@ fn test_multi_crate() {
213213
.masquerade_as_nightly_cargo()
214214
.env("RUSTFLAGS", "-Zfuture-incompat-test")
215215
.with_stderr_contains("warning: the following packages contain code that will be rejected by a future version of Rust: first-dep v0.0.1, second-dep v0.0.2")
216-
.with_stderr_contains(" - first-dep v0.0.1")
217-
.with_stderr_contains(" - second-dep v0.0.2")
216+
.with_stderr_contains(" - first-dep:0.0.1")
217+
.with_stderr_contains(" - second-dep:0.0.2")
218218
.run();
219219

220-
p.cargo("report future-incompatibilities").arg("--package").arg("first-dep v0.0.1").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
220+
p.cargo("report future-incompatibilities").arg("--package").arg("first-dep:0.0.1").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
221221
.masquerade_as_nightly_cargo()
222222
.with_stdout_contains("The package `first-dep v0.0.1` currently triggers the following future incompatibility lints:")
223223
.with_stdout_contains(FUTURE_OUTPUT)
224224
.with_stdout_does_not_contain("[..]second-dep[..]")
225225
.run();
226226

227-
p.cargo("report future-incompatibilities").arg("--package").arg("second-dep v0.0.2").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
227+
p.cargo("report future-incompatibilities").arg("--package").arg("second-dep:0.0.2").arg("-Zunstable-options").arg("-Zfuture-incompat-report")
228228
.masquerade_as_nightly_cargo()
229229
.with_stdout_contains("The package `second-dep v0.0.2` currently triggers the following future incompatibility lints:")
230230
.with_stdout_contains(FUTURE_OUTPUT)

0 commit comments

Comments
 (0)