Skip to content

Commit

Permalink
Adjust comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Aaron1011 committed Oct 18, 2021
1 parent 958f2fc commit 5c3b380
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
11 changes: 7 additions & 4 deletions src/cargo/core/compiler/future_incompat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,9 +254,9 @@ fn render_report(per_package_reports: &[FutureIncompatReportPackage]) -> BTreeMa
report
}

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

pub fn render_message(
/// Writes a future-incompat report to disk, using the per-package
/// reports gathered during the build. If requested by the user,
/// a message is also displayed in the build output.
pub fn save_and_display_report(
bcx: &BuildContext<'_, '_>,
per_package_future_incompat_reports: &[FutureIncompatReportPackage],
) {
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/job_queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ impl<'cfg> DrainState<'cfg> {
if !cx.bcx.build_config.build_plan {
// It doesn't really matter if this fails.
drop(cx.bcx.config.shell().status("Finished", message));
future_incompat::render_message(cx.bcx, &self.per_package_future_incompat_reports);
future_incompat::save_and_display_report(cx.bcx, &self.per_package_future_incompat_reports);
}

None
Expand Down
1 change: 0 additions & 1 deletion tests/testsuite/future_incompat_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ fn test_multi_crate() {
.exec_with_output()
.unwrap();
let output = std::str::from_utf8(&output.stdout).unwrap();
//if true { panic!("Got output: \n{}", output) }
assert!(output.starts_with("The following warnings were discovered"));
let mut lines = output
.lines()
Expand Down

0 comments on commit 5c3b380

Please sign in to comment.