From c6ebabd555a18053250fe37b195cd49310e144a7 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 4 Sep 2025 16:32:13 -0500 Subject: [PATCH 1/3] chore: Update annotate-snippets --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c7649f62b3..c401a80c802 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,9 +40,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "annotate-snippets" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a851f39ec7e23bf1c30faf3844a496fee4db701f5f840f68d1f78f00e697892" +checksum = "4b0f1e2f8ec4bff67c7e1867001ec452595daf315cce10c393b7d4274024f878" dependencies = [ "anstyle", "memchr", diff --git a/Cargo.toml b/Cargo.toml index 7fd04749b03..4684ef0ec55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,7 +18,7 @@ homepage = "https://github.com/rust-lang/cargo" repository = "https://github.com/rust-lang/cargo" [workspace.dependencies] -annotate-snippets = { version = "0.12.1", features = ["simd"] } +annotate-snippets = { version = "0.12.3", features = ["simd"] } anstream = "0.6.20" anstyle = "1.0.11" anyhow = "1.0.98" From 7d6d673e23969b7ee1a3ce563992ae14a13e1818 Mon Sep 17 00:00:00 2001 From: Ed Page Date: Thu, 4 Sep 2025 16:35:40 -0500 Subject: [PATCH 2/3] fix(cli): Adjust terminal styles to match rustc Fixes #12740 --- src/bin/cargo/cli.rs | 50 ++++----- src/bin/cargo/commands/add.rs | 8 +- src/bin/cargo/commands/bench.rs | 2 +- src/bin/cargo/commands/build.rs | 2 +- src/bin/cargo/commands/check.rs | 2 +- src/bin/cargo/commands/clean.rs | 2 +- src/bin/cargo/commands/doc.rs | 2 +- src/bin/cargo/commands/fetch.rs | 2 +- src/bin/cargo/commands/fix.rs | 2 +- src/bin/cargo/commands/generate_lockfile.rs | 2 +- src/bin/cargo/commands/info.rs | 2 +- src/bin/cargo/commands/init.rs | 2 +- src/bin/cargo/commands/install.rs | 2 +- src/bin/cargo/commands/locate_project.rs | 2 +- src/bin/cargo/commands/login.rs | 2 +- src/bin/cargo/commands/logout.rs | 2 +- src/bin/cargo/commands/metadata.rs | 2 +- src/bin/cargo/commands/new.rs | 2 +- src/bin/cargo/commands/owner.rs | 2 +- src/bin/cargo/commands/package.rs | 2 +- src/bin/cargo/commands/pkgid.rs | 2 +- src/bin/cargo/commands/publish.rs | 2 +- src/bin/cargo/commands/read_manifest.rs | 2 +- src/bin/cargo/commands/remove.rs | 2 +- src/bin/cargo/commands/report.rs | 2 +- src/bin/cargo/commands/run.rs | 2 +- src/bin/cargo/commands/rustc.rs | 2 +- src/bin/cargo/commands/rustdoc.rs | 2 +- src/bin/cargo/commands/search.rs | 2 +- src/bin/cargo/commands/test.rs | 4 +- src/bin/cargo/commands/tree.rs | 2 +- src/bin/cargo/commands/uninstall.rs | 2 +- src/bin/cargo/commands/update.rs | 2 +- src/bin/cargo/commands/vendor.rs | 2 +- src/bin/cargo/commands/version.rs | 2 +- src/bin/cargo/commands/yank.rs | 2 +- src/cargo/ops/registry/info/view.rs | 10 +- src/cargo/ops/tree/mod.rs | 12 +- src/cargo/util/style.rs | 18 +-- tests/testsuite/cargo/help/stdout.term.svg | 73 ++++++------ .../cargo_add/add_basic/stderr.term.svg | 8 +- .../cargo_add/add_multiple/stderr.term.svg | 10 +- .../stderr.term.svg | 24 ++-- .../stderr.term.svg | 4 +- .../cargo_add/add_toolchain/stderr.term.svg | 4 +- .../testsuite/cargo_add/build/stderr.term.svg | 10 +- .../stderr.term.svg | 12 +- .../change_rename_target/stderr.term.svg | 10 +- .../cargo_add/cyclic_features/stderr.term.svg | 12 +- .../default_features/stderr.term.svg | 13 +-- .../stderr.term.svg | 4 +- .../deprecated_section/stderr.term.svg | 4 +- .../detect_workspace_inherit/stderr.term.svg | 4 +- .../stderr.term.svg | 22 ++-- .../stderr.term.svg | 6 +- .../stderr.term.svg | 4 +- .../stderr.term.svg | 4 +- tests/testsuite/cargo_add/dev/stderr.term.svg | 10 +- .../dev_build_conflict/stderr.term.svg | 15 +-- .../dev_existing_path_base/stderr.term.svg | 6 +- .../stderr.term.svg | 12 +- .../cargo_add/dry_run/stderr.term.svg | 6 +- .../cargo_add/empty_dep_name/stderr.term.svg | 4 +- .../stderr.term.svg | 10 +- .../feature_suggestion_none/stderr.term.svg | 10 +- .../feature_suggestion_single/stderr.term.svg | 10 +- .../cargo_add/features/stderr.term.svg | 18 +-- .../stderr.term.svg | 8 +- .../stderr.term.svg | 68 ++++++------ .../cargo_add/features_empty/stderr.term.svg | 18 +-- .../stderr.term.svg | 10 +- .../stderr.term.svg | 10 +- .../stderr.term.svg | 18 +-- .../features_preserve/stderr.term.svg | 18 +-- .../features_spaced_values/stderr.term.svg | 18 +-- .../features_unknown/stderr.term.svg | 10 +- .../stderr.term.svg | 10 +- tests/testsuite/cargo_add/git/stderr.term.svg | 12 +- .../cargo_add/git_branch/stderr.term.svg | 12 +- .../git_conflicts_namever/stderr.term.svg | 4 +- .../cargo_add/git_dev/stderr.term.svg | 12 +- .../git_inferred_name/stderr.term.svg | 14 +-- .../stderr.term.svg | 10 +- .../git_multiple_names/stderr.term.svg | 14 +-- .../stderr.term.svg | 14 +-- .../cargo_add/git_registry/stderr.term.svg | 12 +- .../cargo_add/git_rev/stderr.term.svg | 12 +- .../cargo_add/git_tag/stderr.term.svg | 12 +- .../testsuite/cargo_add/help/stdout.term.svg | 87 ++++++++------- .../infer_prerelease/stderr.term.svg | 8 +- .../cargo_add/invalid_arg/stderr.term.svg | 17 +-- .../invalid_git_name/stderr.term.svg | 10 +- .../stderr.term.svg | 4 +- .../stderr.term.svg | 4 +- .../stderr.term.svg | 4 +- .../invalid_name_external/stderr.term.svg | 8 +- .../cargo_add/invalid_path/stderr.term.svg | 6 +- .../invalid_path_name/stderr.term.svg | 6 +- .../invalid_path_self/stderr.term.svg | 8 +- .../invalid_target_empty/stderr.term.svg | 8 +- .../cargo_add/invalid_vers/stderr.term.svg | 4 +- .../cargo_add/list_features/stderr.term.svg | 18 +-- .../list_features_path/stderr.term.svg | 21 ++-- .../stderr.term.svg | 21 ++-- .../cargo_add/locked_changed/stderr.term.svg | 12 +- .../locked_unchanged/stderr.term.svg | 6 +- .../lockfile_updated/stderr.term.svg | 11 +- .../manifest_path_package/stderr.term.svg | 4 +- .../merge_activated_features/stderr.term.svg | 22 ++-- .../missing_at_in_crate_spec/stderr.term.svg | 4 +- .../stderr.term.svg | 4 +- .../stderr.term.svg | 4 +- .../cargo_add/namever/stderr.term.svg | 15 ++- .../cargo_add/no_args/stderr.term.svg | 17 +-- .../no_default_features/stderr.term.svg | 13 +-- .../cargo_add/no_optional/stderr.term.svg | 8 +- .../cargo_add/no_public/stderr.term.svg | 8 +- .../normalize_name_git/stderr.term.svg | 10 +- .../normalize_name_path/stderr.term.svg | 6 +- .../stderr.term.svg | 8 +- .../normalize_name_registry/stderr.term.svg | 34 +++--- .../stderr.term.svg | 18 +-- .../stderr.term.svg | 8 +- .../stderr.term.svg | 8 +- .../offline_empty_cache/stderr.term.svg | 4 +- .../cargo_add/optional/stderr.term.svg | 10 +- .../stderr.term.svg | 13 +-- .../stderr.term.svg | 13 +-- .../overwrite_features/stderr.term.svg | 18 +-- .../overwrite_git_with_path/stderr.term.svg | 8 +- .../stderr.term.svg | 6 +- .../overwrite_inherit_noop/stderr.term.svg | 4 +- .../stderr.term.svg | 6 +- .../overwrite_inline_features/stderr.term.svg | 18 +-- .../overwrite_name_dev_noop/stderr.term.svg | 10 +- .../overwrite_name_noop/stderr.term.svg | 12 +- .../stderr.term.svg | 13 +-- .../stderr.term.svg | 13 +-- .../overwrite_no_optional/stderr.term.svg | 8 +- .../stderr.term.svg | 10 +- .../overwrite_no_public/stderr.term.svg | 8 +- .../stderr.term.svg | 8 +- .../overwrite_optional/stderr.term.svg | 10 +- .../stderr.term.svg | 18 +-- .../stderr.term.svg | 8 +- .../stderr.term.svg | 14 +-- .../overwrite_path_noop/stderr.term.svg | 12 +- .../stderr.term.svg | 13 +-- .../stderr.term.svg | 18 +-- .../overwrite_public/stderr.term.svg | 8 +- .../stderr.term.svg | 8 +- .../stderr.term.svg | 11 +- .../stderr.term.svg | 11 +- .../stderr.term.svg | 13 +-- .../stderr.term.svg | 12 +- .../stderr.term.svg | 8 +- .../overwrite_with_rename/stderr.term.svg | 11 +- .../overwrite_workspace_dep/stderr.term.svg | 4 +- .../stderr.term.svg | 22 ++-- .../testsuite/cargo_add/path/stderr.term.svg | 6 +- .../cargo_add/path_base/stderr.term.svg | 6 +- .../path_base_inferred_name/stderr.term.svg | 6 +- .../stderr.term.svg | 6 +- .../path_base_unstable/stderr.term.svg | 6 +- .../cargo_add/path_dev/stderr.term.svg | 6 +- .../path_inferred_name/stderr.term.svg | 6 +- .../stderr.term.svg | 4 +- .../prefixed_v_in_version/stderr.term.svg | 4 +- .../preserve_dep_std_table/stderr.term.svg | 18 +-- .../preserve_features_sorted/stderr.term.svg | 18 +-- .../preserve_features_table/stderr.term.svg | 18 +-- .../stderr.term.svg | 18 +-- .../cargo_add/preserve_sorted/stderr.term.svg | 13 +-- .../preserve_unsorted/stderr.term.svg | 13 +-- .../cargo_add/public/stderr.term.svg | 8 +- .../cargo_add/registry/stderr.term.svg | 10 +- .../cargo_add/rename/stderr.term.svg | 8 +- .../cargo_add/require_weak/stderr.term.svg | 18 +-- .../rust_version_ignore/stderr.term.svg | 8 +- .../rust_version_incompatible/stderr.term.svg | 8 +- .../rust_version_latest/stderr.term.svg | 8 +- .../rust_version_older/stderr.term.svg | 11 +- .../cargo_add/rustc_ignore/stderr.term.svg | 13 +-- .../rustc_incompatible/stderr.term.svg | 8 +- .../cargo_add/rustc_latest/stderr.term.svg | 11 +- .../cargo_add/rustc_older/stderr.term.svg | 11 +- .../cargo_add/script_bare/stderr.term.svg | 8 +- .../cargo_add/script_escape/stderr.term.svg | 8 +- .../script_frontmatter/stderr.term.svg | 8 +- .../script_frontmatter_empty/stderr.term.svg | 8 +- .../cargo_add/script_shebang/stderr.term.svg | 8 +- .../stderr.term.svg | 15 ++- .../cargo_add/target/stderr.term.svg | 10 +- .../cargo_add/target_cfg/stderr.term.svg | 10 +- .../unknown_inherited_feature/stderr.term.svg | 8 +- .../testsuite/cargo_add/vers/stderr.term.svg | 8 +- .../cargo_add/workspace_name/stderr.term.svg | 4 +- .../cargo_add/workspace_path/stderr.term.svg | 4 +- .../workspace_path_dev/stderr.term.svg | 4 +- .../cargo_add/yanked/stderr.term.svg | 8 +- .../cargo_bench/help/stdout.term.svg | 97 ++++++++-------- .../cargo_bench/no_keep_going/stderr.term.svg | 13 ++- .../cargo_build/help/stdout.term.svg | 101 ++++++++--------- .../cargo_check/help/stdout.term.svg | 97 ++++++++-------- .../cargo_clean/help/stdout.term.svg | 51 ++++----- .../cargo_config/help/stdout.term.svg | 31 +++--- .../testsuite/cargo_doc/help/stdout.term.svg | 91 +++++++-------- .../cargo_fetch/help/stdout.term.svg | 37 +++--- .../testsuite/cargo_fix/help/stdout.term.svg | 105 +++++++++--------- .../help/stdout.term.svg | 35 +++--- .../testsuite/cargo_help/help/stdout.term.svg | 29 ++--- .../cargo_info/basic/stderr.term.svg | 8 +- .../cargo_info/basic/stdout.term.svg | 20 ++-- .../cargo_info/features/stderr.term.svg | 8 +- .../cargo_info/features/stdout.term.svg | 18 +-- .../stderr.term.svg | 8 +- .../stdout.term.svg | 16 +-- .../stderr.term.svg | 8 +- .../stdout.term.svg | 18 +-- .../stderr.term.svg | 8 +- .../stdout.term.svg | 18 +-- .../cargo_info/git_dependency/stdout.term.svg | 18 +-- .../testsuite/cargo_info/help/stdout.term.svg | 35 +++--- .../cargo_info/not_found/stderr.term.svg | 10 +- .../path_dependency/stdout.term.svg | 18 +-- .../stderr.term.svg | 8 +- .../stdout.term.svg | 14 +-- .../stderr.term.svg | 8 +- .../stdout.term.svg | 14 +-- .../stderr.term.svg | 8 +- .../stdout.term.svg | 14 +-- .../stderr.term.svg | 4 +- .../stderr.term.svg | 8 +- .../stdout.term.svg | 14 +-- .../stderr.term.svg | 10 +- .../stderr.term.svg | 8 +- .../stdout.term.svg | 14 +-- .../stderr.term.svg | 12 +- .../stdout.term.svg | 16 +-- .../direct1-stderr.term.svg | 10 +- .../direct1-stdout.term.svg | 16 +-- .../direct2-stderr.term.svg | 5 +- .../direct2-stdout.term.svg | 16 +-- .../transitive1-stderr.term.svg | 5 +- .../transitive1-stdout.term.svg | 16 +-- .../transitive2-stderr.term.svg | 5 +- .../transitive2-stdout.term.svg | 16 +-- .../ws-stderr.term.svg | 12 +- .../ws-stdout.term.svg | 16 +-- .../cargo_info/verbose/stderr.term.svg | 8 +- .../cargo_info/verbose/stdout.term.svg | 26 ++--- .../with_frozen_outside_ws/stderr.term.svg | 4 +- .../with_frozen_within_ws/stderr.term.svg | 6 +- .../with_locked_outside_ws/stderr.term.svg | 4 +- .../with_locked_within_ws/stderr.term.svg | 10 +- .../stderr.term.svg | 8 +- .../stdout.term.svg | 14 +-- .../cargo_info/with_offline/stderr.term.svg | 6 +- .../cargo_info/with_quiet/stdout.term.svg | 14 +-- .../cargo_info/within_ws/stderr.term.svg | 12 +- .../cargo_info/within_ws/stdout.term.svg | 16 +-- .../stdout.term.svg | 14 +-- .../stderr.term.svg | 10 +- .../stdout.term.svg | 14 +-- .../stderr.term.svg | 16 +-- .../stdout.term.svg | 16 +-- .../stderr.term.svg | 12 +- .../stdout.term.svg | 16 +-- .../cargo_init/auto_git/stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../both_lib_and_bin/stderr.term.svg | 4 +- .../stderr.term.svg | 8 +- .../stderr.term.svg | 4 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../explicit_bin_with_git/stderr.term.svg | 7 +- .../cargo_init/formats_source/stderr.term.svg | 7 +- .../fossil_autodetect/stderr.term.svg | 7 +- .../cargo_init/git_autodetect/stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../testsuite/cargo_init/help/stdout.term.svg | 43 +++---- .../stderr.term.svg | 7 +- .../inferred_bin_with_git/stderr.term.svg | 7 +- .../inferred_lib_with_git/stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../invalid_dir_name/stderr.term.svg | 8 +- .../lib_already_exists_nosrc/stderr.term.svg | 7 +- .../lib_already_exists_src/stderr.term.svg | 7 +- .../mercurial_autodetect/stderr.term.svg | 7 +- .../stderr.term.svg | 4 +- .../cargo_init/no_filename/stderr.term.svg | 4 +- .../path_contains_separator/stderr.term.svg | 7 +- .../pijul_autodetect/stderr.term.svg | 7 +- .../cargo_init/reserved_name/stderr.term.svg | 8 +- .../cargo_init/simple_bin/stderr.term.svg | 7 +- .../cargo_init/simple_git/stderr.term.svg | 7 +- .../simple_git_ignore_exists/stderr.term.svg | 7 +- .../cargo_init/simple_hg/stderr.term.svg | 7 +- .../simple_hg_ignore_exists/stderr.term.svg | 7 +- .../cargo_init/simple_lib/stderr.term.svg | 7 +- .../cargo_init/unknown_flags/stderr.term.svg | 13 ++- .../cargo_init/with_argument/stderr.term.svg | 7 +- .../workspace_add_member/stderr.term.svg | 9 +- .../cargo_install/help/stdout.term.svg | 97 ++++++++-------- .../cargo_locate_project/help/stdout.term.svg | 35 +++--- .../cargo_login/help/stdout.term.svg | 33 +++--- .../cargo_logout/help/stdout.term.svg | 31 +++--- .../cargo_metadata/help/stdout.term.svg | 47 ++++---- .../stderr.term.svg | 7 +- .../stderr.term.svg | 9 +- .../stderr.term.svg | 9 +- .../stderr.term.svg | 9 +- .../stderr.term.svg | 9 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 9 +- .../cargo_new/empty_name/stderr.term.svg | 8 +- .../testsuite/cargo_new/help/stdout.term.svg | 43 +++---- .../stderr.term.svg | 7 +- .../inherit_workspace_lints/stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../stderr.term.svg | 7 +- .../cargo_owner/help/stdout.term.svg | 43 +++---- .../cargo_package/help/stdout.term.svg | 75 +++++++------ .../cargo_pkgid/help/stdout.term.svg | 39 +++---- .../cargo_publish/help/stdout.term.svg | 71 ++++++------ .../cargo_read_manifest/help/stdout.term.svg | 31 +++--- .../avoid_empty_tables/stderr.term.svg | 4 +- .../cargo_remove/build/stderr.term.svg | 4 +- .../cargo_remove/dev/stderr.term.svg | 4 +- .../cargo_remove/dry_run/stderr.term.svg | 4 +- .../gc_keep_used_patch/stderr.term.svg | 4 +- .../cargo_remove/gc_patch/stderr.term.svg | 4 +- .../cargo_remove/gc_profile/stderr.term.svg | 4 +- .../cargo_remove/gc_replace/stderr.term.svg | 4 +- .../cargo_remove/help/stdout.term.svg | 49 ++++---- .../cargo_remove/invalid_arg/stderr.term.svg | 13 ++- .../cargo_remove/invalid_dep/stderr.term.svg | 8 +- .../invalid_package/stderr.term.svg | 4 +- .../invalid_package_multiple/stderr.term.svg | 4 +- .../invalid_section/stderr.term.svg | 8 +- .../invalid_section_dep/stderr.term.svg | 8 +- .../invalid_target/stderr.term.svg | 10 +- .../invalid_target_dep/stderr.term.svg | 10 +- .../cargo_remove/last_dep/stderr.term.svg | 4 +- .../multiple_deps/stderr.term.svg | 6 +- .../cargo_remove/multiple_dev/stderr.term.svg | 6 +- .../cargo_remove/no_arg/stderr.term.svg | 13 ++- .../cargo_remove/offline/stderr.term.svg | 4 +- .../optional_dep_feature/stderr.term.svg | 4 +- .../stderr.term.svg | 6 +- .../optional_feature/stderr.term.svg | 4 +- .../cargo_remove/package/stderr.term.svg | 4 +- .../cargo_remove/remove_basic/stderr.term.svg | 4 +- .../cargo_remove/script/stderr.term.svg | 4 +- .../cargo_remove/script_last/stderr.term.svg | 4 +- .../skip_gc_glob_profile/stderr.term.svg | 4 +- .../cargo_remove/target/stderr.term.svg | 4 +- .../cargo_remove/target_build/stderr.term.svg | 4 +- .../cargo_remove/target_dev/stderr.term.svg | 4 +- .../update_lock_file/stderr.term.svg | 4 +- .../cargo_remove/workspace/stderr.term.svg | 4 +- .../workspace_non_virtual/stderr.term.svg | 4 +- .../workspace_preserved/stderr.term.svg | 4 +- .../cargo_report/help/stdout.term.svg | 33 +++--- .../testsuite/cargo_run/help/stdout.term.svg | 75 +++++++------ .../cargo_rustc/help/stdout.term.svg | 97 ++++++++-------- .../cargo_rustdoc/help/stdout.term.svg | 95 ++++++++-------- .../cargo_search/help/stdout.term.svg | 37 +++--- .../testsuite/cargo_test/help/stdout.term.svg | 105 +++++++++--------- .../cargo_test/no_keep_going/stderr.term.svg | 13 ++- .../testsuite/cargo_tree/dupe/stderr.term.svg | 14 +-- .../cargo_tree/edge_kind/stderr.term.svg | 44 ++++---- .../cargo_tree/edge_kind/stdout.term.svg | 12 +- .../testsuite/cargo_tree/help/stdout.term.svg | 71 ++++++------ .../cargo_uninstall/help/stdout.term.svg | 41 +++---- .../cargo_update/help/stdout.term.svg | 47 ++++---- .../toolchain_pkgname/stderr.term.svg | 4 +- .../cargo_vendor/help/stdout.term.svg | 43 +++---- .../cargo_verify_project/help/stdout.term.svg | 29 ++--- .../cargo_version/help/stdout.term.svg | 29 ++--- .../testsuite/cargo_yank/help/stdout.term.svg | 41 +++---- .../testsuite/lints/inherited/stderr.term.svg | 3 +- tests/testsuite/lints/warning/stderr.term.svg | 6 +- 393 files changed, 2737 insertions(+), 2757 deletions(-) diff --git a/src/bin/cargo/cli.rs b/src/bin/cargo/cli.rs index f549e4b1325..aba77bd96ff 100644 --- a/src/bin/cargo/cli.rs +++ b/src/bin/cargo/cli.rs @@ -163,7 +163,7 @@ fn print_list(gctx: &GlobalContext, is_verbose: bool) { ]); drop_println!( gctx, - color_print::cstr!("Installed Commands:") + color_print::cstr!("Installed Commands:") ); for (name, command) in list_commands(gctx) { let known_external_desc = known_external_command_descriptions.get(name.as_str()); @@ -557,11 +557,11 @@ pub fn cli(gctx: &GlobalContext) -> Command { let usage = if is_rustup() { color_print::cstr!( - "cargo [+toolchain] [OPTIONS] [COMMAND]\n cargo [+toolchain] [OPTIONS] -Zscript <> [ARGS]..." + "cargo [+toolchain] [OPTIONS] [COMMAND]\n cargo [+toolchain] [OPTIONS] -Zscript <> [ARGS]..." ) } else { color_print::cstr!( - "cargo [OPTIONS] [COMMAND]\n cargo [OPTIONS] -Zscript <> [ARGS]..." + "cargo [OPTIONS] [COMMAND]\n cargo [OPTIONS] -Zscript <> [ARGS]..." ) }; @@ -592,31 +592,31 @@ pub fn cli(gctx: &GlobalContext) -> Command { "\ Rust's package manager -Usage: {usage} +Usage: {usage} -Options: +Options: {options} -Commands: - build, b Compile the current package - check, c Analyze the current package and report errors, but don't build object files - clean Remove the target directory - doc, d Build this package's and its dependencies' documentation - new Create a new cargo package - init Create a new cargo package in an existing directory - add Add dependencies to a manifest file - remove Remove dependencies from a manifest file - run, r Run a binary or example of the local package - test, t Run the tests - bench Run the benchmarks - update Update dependencies listed in Cargo.lock - search Search registry for crates - publish Package and upload this package to the registry - install Install a Rust binary - uninstall Uninstall a Rust binary - ... See all commands with --list - -See 'cargo help <>' for more information on a specific command.\n", +Commands: + build, b Compile the current package + check, c Analyze the current package and report errors, but don't build object files + clean Remove the target directory + doc, d Build this package's and its dependencies' documentation + new Create a new cargo package + init Create a new cargo package in an existing directory + add Add dependencies to a manifest file + remove Remove dependencies from a manifest file + run, r Run a binary or example of the local package + test, t Run the tests + bench Run the benchmarks + update Update dependencies listed in Cargo.lock + search Search registry for crates + publish Package and upload this package to the registry + install Install a Rust binary + uninstall Uninstall a Rust binary + ... See all commands with --list + +See 'cargo help <>' for more information on a specific command.\n", )) .arg(flag("version", "Print version info and exit").short('V')) .arg(flag("list", "List installed commands")) diff --git a/src/bin/cargo/commands/add.rs b/src/bin/cargo/commands/add.rs index 166e56d135b..8cabda1acd3 100644 --- a/src/bin/cargo/commands/add.rs +++ b/src/bin/cargo/commands/add.rs @@ -18,11 +18,11 @@ pub fn cli() -> Command { .about("Add dependencies to a Cargo.toml manifest file") .override_usage( color_print::cstr!("\ - cargo add [OPTIONS] <>[@<>] ... - cargo add [OPTIONS] --path <> ... - cargo add [OPTIONS] --git <> ..." + cargo add [OPTIONS] <>[@<>] ... + cargo add [OPTIONS] --path <> ... + cargo add [OPTIONS] --git <> ..." )) - .after_help(color_print::cstr!("Run `cargo help add` for more detailed information.\n")) + .after_help(color_print::cstr!("Run `cargo help add` for more detailed information.\n")) .group(clap::ArgGroup::new("selected").multiple(true).required(true)) .args([ clap::Arg::new("crates") diff --git a/src/bin/cargo/commands/bench.rs b/src/bin/cargo/commands/bench.rs index b4b4b664c37..f78e3b70ee2 100644 --- a/src/bin/cargo/commands/bench.rs +++ b/src/bin/cargo/commands/bench.rs @@ -53,7 +53,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help bench` for more detailed information.\n" + "Run `cargo help bench` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/build.rs b/src/bin/cargo/commands/build.rs index 51b019d4382..3d8ced9630e 100644 --- a/src/bin/cargo/commands/build.rs +++ b/src/bin/cargo/commands/build.rs @@ -43,7 +43,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help build` for more detailed information.\n" + "Run `cargo help build` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/check.rs b/src/bin/cargo/commands/check.rs index 957195498ab..9ba340b4a79 100644 --- a/src/bin/cargo/commands/check.rs +++ b/src/bin/cargo/commands/check.rs @@ -40,7 +40,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help check` for more detailed information.\n" + "Run `cargo help check` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/clean.rs b/src/bin/cargo/commands/clean.rs index c1792388e44..e14ebd379d1 100644 --- a/src/bin/cargo/commands/clean.rs +++ b/src/bin/cargo/commands/clean.rs @@ -122,7 +122,7 @@ pub fn cli() -> Command { ), ) .after_help(color_print::cstr!( - "Run `cargo help clean` for more detailed information.\n" + "Run `cargo help clean` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/doc.rs b/src/bin/cargo/commands/doc.rs index 20f39618cf3..3f918a06b29 100644 --- a/src/bin/cargo/commands/doc.rs +++ b/src/bin/cargo/commands/doc.rs @@ -42,7 +42,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help doc` for more detailed information.\n" + "Run `cargo help doc` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/fetch.rs b/src/bin/cargo/commands/fetch.rs index 2fdba80baf8..5486d0c43b2 100644 --- a/src/bin/cargo/commands/fetch.rs +++ b/src/bin/cargo/commands/fetch.rs @@ -11,7 +11,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help fetch` for more detailed information.\n" + "Run `cargo help fetch` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/fix.rs b/src/bin/cargo/commands/fix.rs index f638599c4e6..d9893a27da4 100644 --- a/src/bin/cargo/commands/fix.rs +++ b/src/bin/cargo/commands/fix.rs @@ -57,7 +57,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help fix` for more detailed information.\n" + "Run `cargo help fix` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/generate_lockfile.rs b/src/bin/cargo/commands/generate_lockfile.rs index 1f0be40fbf1..878dfe9e964 100644 --- a/src/bin/cargo/commands/generate_lockfile.rs +++ b/src/bin/cargo/commands/generate_lockfile.rs @@ -10,7 +10,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version_with_help("Ignore `rust-version` specification in packages") .after_help(color_print::cstr!( - "Run `cargo help generate-lockfile` for more detailed information.\n" + "Run `cargo help generate-lockfile` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/info.rs b/src/bin/cargo/commands/info.rs index 31b68f3e89b..a06e4ce08ca 100644 --- a/src/bin/cargo/commands/info.rs +++ b/src/bin/cargo/commands/info.rs @@ -17,7 +17,7 @@ pub fn cli() -> Command { .arg_registry("Registry to search packages in") .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help info` for more detailed information.\n" + "Run `cargo help info` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/init.rs b/src/bin/cargo/commands/init.rs index 614a200799d..f048966fe05 100644 --- a/src/bin/cargo/commands/init.rs +++ b/src/bin/cargo/commands/init.rs @@ -15,7 +15,7 @@ pub fn cli() -> Command { .arg_registry("Registry to use") .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help init` for more detailed information.\n" + "Run `cargo help init` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/install.rs b/src/bin/cargo/commands/install.rs index 30ec8884512..7668b376c64 100644 --- a/src/bin/cargo/commands/install.rs +++ b/src/bin/cargo/commands/install.rs @@ -105,7 +105,7 @@ pub fn cli() -> Command { .arg_timings() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help install` for more detailed information.\n" + "Run `cargo help install` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/locate_project.rs b/src/bin/cargo/commands/locate_project.rs index 92729657ff1..49d6e6ca256 100644 --- a/src/bin/cargo/commands/locate_project.rs +++ b/src/bin/cargo/commands/locate_project.rs @@ -16,7 +16,7 @@ pub fn cli() -> Command { .arg_silent_suggestion() .arg_manifest_path() .after_help(color_print::cstr!( - "Run `cargo help locate-project` for more detailed information.\n" + "Run `cargo help locate-project` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/login.rs b/src/bin/cargo/commands/login.rs index 7fe86b9b0c6..62a3b1dc1f5 100644 --- a/src/bin/cargo/commands/login.rs +++ b/src/bin/cargo/commands/login.rs @@ -21,7 +21,7 @@ pub fn cli() -> Command { ) .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help login` for more detailed information.\n" + "Run `cargo help login` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/logout.rs b/src/bin/cargo/commands/logout.rs index 57df53ad737..3660b3102d5 100644 --- a/src/bin/cargo/commands/logout.rs +++ b/src/bin/cargo/commands/logout.rs @@ -9,7 +9,7 @@ pub fn cli() -> Command { .arg_registry("Registry to use") .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help logout` for more detailed information.\n" + "Run `cargo help logout` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/metadata.rs b/src/bin/cargo/commands/metadata.rs index 0b98d50a114..d082af33abd 100644 --- a/src/bin/cargo/commands/metadata.rs +++ b/src/bin/cargo/commands/metadata.rs @@ -29,7 +29,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help metadata` for more detailed information.\n" + "Run `cargo help metadata` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/new.rs b/src/bin/cargo/commands/new.rs index 35a85e0499b..3af05ced370 100644 --- a/src/bin/cargo/commands/new.rs +++ b/src/bin/cargo/commands/new.rs @@ -15,7 +15,7 @@ pub fn cli() -> Command { .arg_registry("Registry to use") .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help new` for more detailed information.\n" + "Run `cargo help new` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/owner.rs b/src/bin/cargo/commands/owner.rs index 659408758df..9816af2b215 100644 --- a/src/bin/cargo/commands/owner.rs +++ b/src/bin/cargo/commands/owner.rs @@ -29,7 +29,7 @@ pub fn cli() -> Command { .arg(opt("token", "API token to use when authenticating").value_name("TOKEN")) .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help owner` for more detailed information.\n" + "Run `cargo help owner` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/package.rs b/src/bin/cargo/commands/package.rs index ae556eda234..aa16989b3d3 100644 --- a/src/bin/cargo/commands/package.rs +++ b/src/bin/cargo/commands/package.rs @@ -52,7 +52,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help package` for more detailed information.\n" + "Run `cargo help package` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/pkgid.rs b/src/bin/cargo/commands/pkgid.rs index aa98dc5c335..a007653fe00 100644 --- a/src/bin/cargo/commands/pkgid.rs +++ b/src/bin/cargo/commands/pkgid.rs @@ -12,7 +12,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help pkgid` for more detailed information.\n" + "Run `cargo help pkgid` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/publish.rs b/src/bin/cargo/commands/publish.rs index 57eff8d0324..572312eefae 100644 --- a/src/bin/cargo/commands/publish.rs +++ b/src/bin/cargo/commands/publish.rs @@ -30,7 +30,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help publish` for more detailed information.\n" + "Run `cargo help publish` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/read_manifest.rs b/src/bin/cargo/commands/read_manifest.rs index c014c99f5f7..f725e4befa8 100644 --- a/src/bin/cargo/commands/read_manifest.rs +++ b/src/bin/cargo/commands/read_manifest.rs @@ -9,7 +9,7 @@ pub fn cli() -> Command { "\ DEPRECATED: Print a JSON representation of a Cargo.toml manifest. -Use `cargo metadata --no-deps` instead.\ +Use `cargo metadata --no-deps` instead.\ " )) .arg_silent_suggestion() diff --git a/src/bin/cargo/commands/remove.rs b/src/bin/cargo/commands/remove.rs index f5e2237c6d9..60979cae26f 100644 --- a/src/bin/cargo/commands/remove.rs +++ b/src/bin/cargo/commands/remove.rs @@ -56,7 +56,7 @@ pub fn cli() -> clap::Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help remove` for more detailed information.\n" + "Run `cargo help remove` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/report.rs b/src/bin/cargo/commands/report.rs index 75918699b1e..6283d490203 100644 --- a/src/bin/cargo/commands/report.rs +++ b/src/bin/cargo/commands/report.rs @@ -6,7 +6,7 @@ pub fn cli() -> Command { subcommand("report") .about("Generate and display various kinds of reports") .after_help(color_print::cstr!( - "Run `cargo help report` for more detailed information.\n" + "Run `cargo help report` for more detailed information.\n" )) .subcommand_required(true) .arg_required_else_help(true) diff --git a/src/bin/cargo/commands/run.rs b/src/bin/cargo/commands/run.rs index 2f1ce6a26a4..20b46052b3f 100644 --- a/src/bin/cargo/commands/run.rs +++ b/src/bin/cargo/commands/run.rs @@ -43,7 +43,7 @@ pub fn cli() -> Command { .arg_unit_graph() .arg_timings() .after_help(color_print::cstr!( - "Run `cargo help run` for more detailed information.\n" + "Run `cargo help run` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/rustc.rs b/src/bin/cargo/commands/rustc.rs index cee871db025..37be9e08f56 100644 --- a/src/bin/cargo/commands/rustc.rs +++ b/src/bin/cargo/commands/rustc.rs @@ -54,7 +54,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help rustc` for more detailed information.\n" + "Run `cargo help rustc` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/rustdoc.rs b/src/bin/cargo/commands/rustdoc.rs index 5a226f421b1..e931a62b024 100644 --- a/src/bin/cargo/commands/rustdoc.rs +++ b/src/bin/cargo/commands/rustdoc.rs @@ -48,7 +48,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help rustdoc` for more detailed information.\n" + "Run `cargo help rustdoc` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/search.rs b/src/bin/cargo/commands/search.rs index f51f59d2dd9..6d7894b4e1f 100644 --- a/src/bin/cargo/commands/search.rs +++ b/src/bin/cargo/commands/search.rs @@ -19,7 +19,7 @@ pub fn cli() -> Command { .arg_registry("Registry to search packages in") .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help search` for more detailed information.\n" + "Run `cargo help search` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/test.rs b/src/bin/cargo/commands/test.rs index bca0e8b6889..3c9e83a803b 100644 --- a/src/bin/cargo/commands/test.rs +++ b/src/bin/cargo/commands/test.rs @@ -63,8 +63,8 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version() .after_help(color_print::cstr!( - "Run `cargo help test` for more detailed information.\n\ - Run `cargo test -- --help` for test binary options.\n", + "Run `cargo help test` for more detailed information.\n\ + Run `cargo test -- --help` for test binary options.\n", )) } diff --git a/src/bin/cargo/commands/tree.rs b/src/bin/cargo/commands/tree.rs index 274a3f9cf45..e2cd954b6ad 100644 --- a/src/bin/cargo/commands/tree.rs +++ b/src/bin/cargo/commands/tree.rs @@ -97,7 +97,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help tree` for more detailed information.\n" + "Run `cargo help tree` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/uninstall.rs b/src/bin/cargo/commands/uninstall.rs index d50996d9af6..2f764d4549e 100644 --- a/src/bin/cargo/commands/uninstall.rs +++ b/src/bin/cargo/commands/uninstall.rs @@ -21,7 +21,7 @@ pub fn cli() -> Command { .help_heading(heading::TARGET_SELECTION), ) .after_help(color_print::cstr!( - "Run `cargo help uninstall` for more detailed information.\n" + "Run `cargo help uninstall` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/update.rs b/src/bin/cargo/commands/update.rs index 3b89d037d40..15700d0b361 100644 --- a/src/bin/cargo/commands/update.rs +++ b/src/bin/cargo/commands/update.rs @@ -55,7 +55,7 @@ pub fn cli() -> Command { .arg_lockfile_path() .arg_ignore_rust_version_with_help("Ignore `rust-version` specification in packages") .after_help(color_print::cstr!( - "Run `cargo help update` for more detailed information.\n" + "Run `cargo help update` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/vendor.rs b/src/bin/cargo/commands/vendor.rs index 63db209cca4..95175b483b5 100644 --- a/src/bin/cargo/commands/vendor.rs +++ b/src/bin/cargo/commands/vendor.rs @@ -39,7 +39,7 @@ pub fn cli() -> Command { .arg_manifest_path() .arg_lockfile_path() .after_help(color_print::cstr!( - "Run `cargo help vendor` for more detailed information.\n" + "Run `cargo help vendor` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/version.rs b/src/bin/cargo/commands/version.rs index 78d3c658fec..eb30f98428f 100644 --- a/src/bin/cargo/commands/version.rs +++ b/src/bin/cargo/commands/version.rs @@ -6,7 +6,7 @@ pub fn cli() -> Command { .about("Show version information") .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help version` for more detailed information.\n" + "Run `cargo help version` for more detailed information.\n" )) } diff --git a/src/bin/cargo/commands/yank.rs b/src/bin/cargo/commands/yank.rs index b2bc147f0c9..c4c5c6fa00f 100644 --- a/src/bin/cargo/commands/yank.rs +++ b/src/bin/cargo/commands/yank.rs @@ -22,7 +22,7 @@ pub fn cli() -> Command { .arg(opt("token", "API token to use when authenticating").value_name("TOKEN")) .arg_silent_suggestion() .after_help(color_print::cstr!( - "Run `cargo help yank` for more detailed information.\n" + "Run `cargo help yank` for more detailed information.\n" )) } diff --git a/src/cargo/ops/registry/info/view.rs b/src/cargo/ops/registry/info/view.rs index 2ac6b67d889..ab825acda88 100644 --- a/src/cargo/ops/registry/info/view.rs +++ b/src/cargo/ops/registry/info/view.rs @@ -2,7 +2,7 @@ use std::collections::HashMap; use std::io::Write; use crate::core::Shell; -use crate::util::style::{ERROR, HEADER, LITERAL, NOP, NOTE, WARN}; +use crate::util::style::{ERROR, HEADER, LITERAL, NOP, WARN}; use crate::{ CargoResult, GlobalContext, core::{ @@ -26,7 +26,7 @@ pub(super) fn pretty_view( let header = HEADER; let error = ERROR; let warn = WARN; - let note = NOTE; + let context = annotate_snippets::renderer::DEFAULT_CONTEXT_STYLE; let mut shell = gctx.shell(); let verbosity = shell.verbosity(); @@ -45,7 +45,7 @@ pub(super) fn pretty_view( } else { format!("#{}", metadata.keywords.join(" #")) }; - write!(shell.out(), " {note}{message}{note:#}")?; + write!(shell.out(), " {context}{message}{context:#}")?; } let stdout = shell.out(); @@ -68,7 +68,7 @@ pub(super) fn pretty_view( (Some(latest), false) if latest.as_summary().version() != package_id.version() => { write!( stdout, - " {warn}(latest {} {warn:#}{note}from {}{note:#}{warn}){warn:#}", + " {warn}(latest {} {warn:#}{context}from {}{context:#}{warn}){warn:#}", latest.as_summary().version(), pretty_source(summary.source_id(), gctx) )?; @@ -83,7 +83,7 @@ pub(super) fn pretty_view( (_, false) => { write!( stdout, - " {note}(from {}){note:#}", + " {context}(from {}){context:#}", pretty_source(summary.source_id(), gctx) )?; } diff --git a/src/cargo/ops/tree/mod.rs b/src/cargo/ops/tree/mod.rs index 99a82a2b791..347ec56153e 100644 --- a/src/cargo/ops/tree/mod.rs +++ b/src/cargo/ops/tree/mod.rs @@ -406,12 +406,12 @@ fn print_dependencies<'a>( let name = match kind { EdgeKind::Dep(DepKind::Normal) => None, - EdgeKind::Dep(DepKind::Build) => { - Some(color_print::cstr!("[build-dependencies]")) - } - EdgeKind::Dep(DepKind::Development) => { - Some(color_print::cstr!("[dev-dependencies]")) - } + EdgeKind::Dep(DepKind::Build) => Some(color_print::cstr!( + "[build-dependencies]" + )), + EdgeKind::Dep(DepKind::Development) => Some(color_print::cstr!( + "[dev-dependencies]" + )), EdgeKind::Feature => None, }; diff --git a/src/cargo/util/style.rs b/src/cargo/util/style.rs index 618a10876bf..824f42b59b4 100644 --- a/src/cargo/util/style.rs +++ b/src/cargo/util/style.rs @@ -1,13 +1,13 @@ use anstyle::*; pub const NOP: Style = Style::new(); -pub const HEADER: Style = AnsiColor::Green.on_default().effects(Effects::BOLD); -pub const USAGE: Style = AnsiColor::Green.on_default().effects(Effects::BOLD); -pub const LITERAL: Style = AnsiColor::Cyan.on_default().effects(Effects::BOLD); +pub const HEADER: Style = AnsiColor::BrightGreen.on_default().effects(Effects::BOLD); +pub const USAGE: Style = AnsiColor::BrightGreen.on_default().effects(Effects::BOLD); +pub const LITERAL: Style = AnsiColor::BrightCyan.on_default().effects(Effects::BOLD); pub const PLACEHOLDER: Style = AnsiColor::Cyan.on_default(); -pub const ERROR: Style = AnsiColor::Red.on_default().effects(Effects::BOLD); -pub const WARN: Style = AnsiColor::Yellow.on_default().effects(Effects::BOLD); -pub const NOTE: Style = AnsiColor::Cyan.on_default().effects(Effects::BOLD); -pub const GOOD: Style = AnsiColor::Green.on_default().effects(Effects::BOLD); -pub const VALID: Style = AnsiColor::Cyan.on_default().effects(Effects::BOLD); -pub const INVALID: Style = AnsiColor::Yellow.on_default().effects(Effects::BOLD); +pub const ERROR: Style = annotate_snippets::renderer::DEFAULT_ERROR_STYLE; +pub const WARN: Style = annotate_snippets::renderer::DEFAULT_WARNING_STYLE; +pub const NOTE: Style = annotate_snippets::renderer::DEFAULT_NOTE_STYLE; +pub const GOOD: Style = AnsiColor::BrightGreen.on_default().effects(Effects::BOLD); +pub const VALID: Style = AnsiColor::BrightCyan.on_default().effects(Effects::BOLD); +pub const INVALID: Style = annotate_snippets::renderer::DEFAULT_WARNING_STYLE; diff --git a/tests/testsuite/cargo/help/stdout.term.svg b/tests/testsuite/cargo/help/stdout.term.svg index 65f66ac859b..541e3465a86 100644 --- a/tests/testsuite/cargo/help/stdout.term.svg +++ b/tests/testsuite/cargo/help/stdout.term.svg @@ -2,8 +2,9 @@