From 88117505b8b691e0e7892630a71a85bb5e9945de Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Fri, 22 Oct 2021 07:53:17 -0700 Subject: [PATCH 1/2] Bump to 0.59.0 --- Cargo.toml | 2 +- .../compiler/build_context/target_info.rs | 9 ------- src/cargo/ops/fix.rs | 24 ++++--------------- tests/testsuite/fix.rs | 12 ---------- tests/testsuite/new.rs | 4 ---- 5 files changed, 5 insertions(+), 46 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c9fa27f5eaf..87e98339dbd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo" -version = "0.58.0" +version = "0.59.0" edition = "2018" authors = ["Yehuda Katz ", "Carl Lerche ", diff --git a/src/cargo/core/compiler/build_context/target_info.rs b/src/cargo/core/compiler/build_context/target_info.rs index 3c032b6e1a5..e8ed0a07381 100644 --- a/src/cargo/core/compiler/build_context/target_info.rs +++ b/src/cargo/core/compiler/build_context/target_info.rs @@ -47,8 +47,6 @@ pub struct TargetInfo { pub rustdocflags: Vec, /// Whether or not rustc supports the `-Csplit-debuginfo` flag. pub supports_split_debuginfo: bool, - /// Whether or not rustc supports the `--force-warn` flag. Remove after 1.56 is stable. - pub supports_force_warn: bool, } /// Kind of each file generated by a Unit, part of `FileType`. @@ -180,12 +178,6 @@ impl TargetInfo { extra_fingerprint, ) .is_ok(); - let supports_force_warn = rustc - .cached_output( - process.clone().arg("--force-warn=rust-2021-compatibility"), - extra_fingerprint, - ) - .is_ok(); process.arg("--print=sysroot"); process.arg("--print=cfg"); @@ -261,7 +253,6 @@ impl TargetInfo { )?, cfg, supports_split_debuginfo, - supports_force_warn, }) } diff --git a/src/cargo/ops/fix.rs b/src/cargo/ops/fix.rs index 45460d26c99..81b379bec3a 100644 --- a/src/cargo/ops/fix.rs +++ b/src/cargo/ops/fix.rs @@ -52,7 +52,7 @@ use rustfix::diagnostics::Diagnostic; use rustfix::{self, CodeFix}; use semver::Version; -use crate::core::compiler::{CompileKind, RustcTargetData, TargetInfo}; +use crate::core::compiler::RustcTargetData; use crate::core::resolver::features::{DiffMap, FeatureOpts, FeatureResolver}; use crate::core::resolver::{HasDevUnits, Resolve, ResolveBehavior}; use crate::core::{Edition, MaybePackage, PackageId, Workspace}; @@ -68,7 +68,6 @@ const FIX_ENV: &str = "__CARGO_FIX_PLZ"; const BROKEN_CODE_ENV: &str = "__CARGO_FIX_BROKEN_CODE"; const EDITION_ENV: &str = "__CARGO_FIX_EDITION"; const IDIOMS_ENV: &str = "__CARGO_FIX_IDIOMS"; -const SUPPORTS_FORCE_WARN: &str = "__CARGO_SUPPORTS_FORCE_WARN"; pub struct FixOptions { pub edition: bool, @@ -124,17 +123,6 @@ pub fn fix(ws: &Workspace<'_>, opts: &mut FixOptions) -> CargoResult<()> { let rustc = ws.config().load_global_rustc(Some(ws))?; wrapper.arg(&rustc.path); - // Remove this once 1.56 is stabilized. - let target_info = TargetInfo::new( - ws.config(), - &opts.compile_opts.build_config.requested_kinds, - &rustc, - CompileKind::Host, - )?; - if target_info.supports_force_warn { - wrapper.env(SUPPORTS_FORCE_WARN, "1"); - } - // primary crates are compiled using a cargo subprocess to do extra work of applying fixes and // repeating build until there are no more changes to be applied opts.compile_opts.build_config.primary_unit_rustc = Some(wrapper); @@ -849,7 +837,7 @@ impl FixArgs { fn apply(&self, cmd: &mut Command) { cmd.arg(&self.file); cmd.args(&self.other); - if self.prepare_for_edition.is_some() && env::var_os(SUPPORTS_FORCE_WARN).is_some() { + if self.prepare_for_edition.is_some() { // When migrating an edition, we don't want to fix other lints as // they can sometimes add suggestions that fail to apply, causing // the entire migration to fail. But those lints aren't needed to @@ -868,12 +856,8 @@ impl FixArgs { if let Some(edition) = self.prepare_for_edition { if edition.supports_compat_lint() { - if env::var_os(SUPPORTS_FORCE_WARN).is_some() { - cmd.arg("--force-warn") - .arg(format!("rust-{}-compatibility", edition)); - } else { - cmd.arg("-W").arg(format!("rust-{}-compatibility", edition)); - } + cmd.arg("--force-warn") + .arg(format!("rust-{}-compatibility", edition)); } } } diff --git a/tests/testsuite/fix.rs b/tests/testsuite/fix.rs index 9fd612e8a04..fce7ab843e5 100644 --- a/tests/testsuite/fix.rs +++ b/tests/testsuite/fix.rs @@ -950,10 +950,6 @@ fn prepare_for_already_on_latest_unstable() { #[cargo_test] fn prepare_for_already_on_latest_stable() { // Stable counterpart of prepare_for_already_on_latest_unstable. - if !is_nightly() { - // Remove once 1.56 is stabilized. - return; - } if Edition::LATEST_UNSTABLE.is_some() { eprintln!("This test cannot run while the latest edition is unstable, skipping."); return; @@ -1528,10 +1524,6 @@ fn rustfix_handles_multi_spans() { #[cargo_test] fn fix_edition_2021() { // Can migrate 2021, even when lints are allowed. - if !is_nightly() { - // Remove once 1.56 is stabilized. - return; - } let p = project() .file( "Cargo.toml", @@ -1748,10 +1740,6 @@ fn fix_with_run_cargo_in_proc_macros() { #[cargo_test] fn non_edition_lint_migration() { // Migrating to a new edition where a non-edition lint causes problems. - if !is_nightly() { - // Remove once force-warn hits stable. - return; - } let p = project() .file("Cargo.toml", &basic_manifest("foo", "0.1.0")) .file( diff --git a/tests/testsuite/new.rs b/tests/testsuite/new.rs index b183ccb3e5c..829638141da 100644 --- a/tests/testsuite/new.rs +++ b/tests/testsuite/new.rs @@ -377,10 +377,6 @@ fn new_with_reference_link() { #[cargo_test] fn lockfile_constant_during_new() { - if !cargo_test_support::is_nightly() { - // Remove when 1.56 is stable (cargo new defaults to 2021). - return; - } cargo_process("new foo").run(); cargo_process("build").cwd(&paths::root().join("foo")).run(); From 333ee58d241a5d0ace628a56619f2bd3c34b6717 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Fri, 22 Oct 2021 08:18:25 -0700 Subject: [PATCH 2/2] Update changelog for 1.57 --- CHANGELOG.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b96ca0fddb..b3c95dc0818 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,21 +1,76 @@ # Changelog +## Cargo 1.58 (2022-01-13) +[b2e52d7c...HEAD](https://github.com/rust-lang/cargo/compare/b2e52d7c...HEAD) + +### Added + +- Added `rust_version` field to package data in `cargo metadata`. + [#9967](https://github.com/rust-lang/cargo/pull/9967) + +### Changed + +### Fixed + +- Doctests now include rustc-link-args from build scripts. + [#9916](https://github.com/rust-lang/cargo/pull/9916) + +### Nightly only + +- Make future-incompat-report output more user-friendly. + [#9953](https://github.com/rust-lang/cargo/pull/9953) + ## Cargo 1.57 (2021-12-02) -[18751dd3...HEAD](https://github.com/rust-lang/cargo/compare/18751dd3...HEAD) +[18751dd3...rust-1.57.0](https://github.com/rust-lang/cargo/compare/18751dd3...rust-1.57.0) ### Added +- 🎉 Added custom named profiles. This also changes the `test` and `bench` + profiles to inherit their settings from `dev` and `release`, and Cargo will + now only use a single profile during a given command instead of using + different profiles for dependencies and cargo-targets. + [docs](https://doc.rust-lang.org/nightly/cargo/reference/profiles.html#custom-profiles) + [#9943](https://github.com/rust-lang/cargo/pull/9943) - The `rev` option for a git dependency now supports git references that start with `refs/`. An example where this can be used is to depend on a pull request from a service like GitHub before it is merged. [#9859](https://github.com/rust-lang/cargo/pull/9859) +- Added `path_in_vcs` field to the `.cargo_vcs_info.json` file. + [docs](https://doc.rust-lang.org/nightly/cargo/commands/cargo-package.html#cargo_vcs_infojson-format) + [#9866](https://github.com/rust-lang/cargo/pull/9866) ### Changed +- The `cargo version` command now includes some extra information. + [#9968](https://github.com/rust-lang/cargo/pull/9968) +- Updated libgit2 to 1.3 which brings in a number of fixes and changes to git + handling. + [#9963](https://github.com/rust-lang/cargo/pull/9963) + [#9988](https://github.com/rust-lang/cargo/pull/9988) +- Shell completions now include shorthand b/r/c/d subcommands. + [#9951](https://github.com/rust-lang/cargo/pull/9951) +- `cargo update --precise` now allows specifying a version without semver + metadata (stuff after `+` in the version number). + [#9945](https://github.com/rust-lang/cargo/pull/9945) +- zsh completions now complete `--example` names. + [#9939](https://github.com/rust-lang/cargo/pull/9939) +- The progress bar now differentiates when building unittests. + [#9934](https://github.com/rust-lang/cargo/pull/9934) +- Some backwards-compatibility support for invalid TOML syntax has been removed. + [#9932](https://github.com/rust-lang/cargo/pull/9932) +- Reverted the change from 1.55 that triggered an error for dependency + specifications that did not include any fields. + [#9911](https://github.com/rust-lang/cargo/pull/9911) + ### Fixed - Removed a log message (from `CARGO_LOG`) that may leak tokens. [#9873](https://github.com/rust-lang/cargo/pull/9873) +- `cargo fix` will now avoid writing fixes to the global registry cache. + [#9938](https://github.com/rust-lang/cargo/pull/9938) +- Fixed `-Z help` CLI option when used with a shorthand alias (b/c/r/d). + [#9933](https://github.com/rust-lang/cargo/pull/9933) + ### Nightly only @@ -105,6 +160,8 @@ [#9818](https://github.com/rust-lang/cargo/pull/9818) - Return an error instead of a stack overflow for command alias loops. [#9791](https://github.com/rust-lang/cargo/pull/9791) +- Updated to curl 7.79.1, which will hopefully fix intermittent http2 errors. + [#9937](https://github.com/rust-lang/cargo/pull/9937) ### Nightly only