Skip to content

Commit 5c3b380

Browse files
committed
Adjust comments
1 parent 958f2fc commit 5c3b380

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/cargo/core/compiler/future_incompat.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,9 @@ fn render_report(per_package_reports: &[FutureIncompatReportPackage]) -> BTreeMa
254254
report
255255
}
256256

257-
// Returns a pair (compatible_updates, incompatible_updates),
258-
// of semver-compatible and semver-incompatible update versions,
259-
// respectively.
257+
/// Returns a user-readable message explaining which of
258+
/// the packages in `package_ids` have updates available.
259+
/// This is best-effort - if an error occurs, `None` will be returned.
260260
fn get_updates(ws: &Workspace<'_>, package_ids: &BTreeSet<PackageId>) -> Option<String> {
261261
// This in general ignores all errors since this is opportunistic.
262262
let _lock = ws.config().acquire_package_cache_lock().ok()?;
@@ -312,7 +312,10 @@ fn get_updates(ws: &Workspace<'_>, package_ids: &BTreeSet<PackageId>) -> Option<
312312
Some(updates)
313313
}
314314

315-
pub fn render_message(
315+
/// Writes a future-incompat report to disk, using the per-package
316+
/// reports gathered during the build. If requested by the user,
317+
/// a message is also displayed in the build output.
318+
pub fn save_and_display_report(
316319
bcx: &BuildContext<'_, '_>,
317320
per_package_future_incompat_reports: &[FutureIncompatReportPackage],
318321
) {

src/cargo/core/compiler/job_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -871,7 +871,7 @@ impl<'cfg> DrainState<'cfg> {
871871
if !cx.bcx.build_config.build_plan {
872872
// It doesn't really matter if this fails.
873873
drop(cx.bcx.config.shell().status("Finished", message));
874-
future_incompat::render_message(cx.bcx, &self.per_package_future_incompat_reports);
874+
future_incompat::save_and_display_report(cx.bcx, &self.per_package_future_incompat_reports);
875875
}
876876

877877
None

tests/testsuite/future_incompat_report.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ fn test_multi_crate() {
269269
.exec_with_output()
270270
.unwrap();
271271
let output = std::str::from_utf8(&output.stdout).unwrap();
272-
//if true { panic!("Got output: \n{}", output) }
273272
assert!(output.starts_with("The following warnings were discovered"));
274273
let mut lines = output
275274
.lines()

0 commit comments

Comments
 (0)