Adjust comments

This commit is contained in:
Aaron Hill 2021-10-18 12:06:23 -05:00
parent 958f2fc962
commit 5c3b38086f
No known key found for this signature in database
GPG Key ID: B4087E510E98B164
3 changed files with 8 additions and 6 deletions

View File

@ -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()?;
@ -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],
) {

View File

@ -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

View File

@ -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()