mirror of
https://github.com/rust-lang/cargo
synced 2024-09-13 21:11:44 +00:00
Bump to 0.59.0
This commit is contained in:
parent
7fbbf4e8f2
commit
88117505b8
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "cargo"
|
name = "cargo"
|
||||||
version = "0.58.0"
|
version = "0.59.0"
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
authors = ["Yehuda Katz <wycats@gmail.com>",
|
authors = ["Yehuda Katz <wycats@gmail.com>",
|
||||||
"Carl Lerche <me@carllerche.com>",
|
"Carl Lerche <me@carllerche.com>",
|
||||||
|
|
|
@ -47,8 +47,6 @@ pub struct TargetInfo {
|
||||||
pub rustdocflags: Vec<String>,
|
pub rustdocflags: Vec<String>,
|
||||||
/// Whether or not rustc supports the `-Csplit-debuginfo` flag.
|
/// Whether or not rustc supports the `-Csplit-debuginfo` flag.
|
||||||
pub supports_split_debuginfo: bool,
|
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`.
|
/// Kind of each file generated by a Unit, part of `FileType`.
|
||||||
|
@ -180,12 +178,6 @@ impl TargetInfo {
|
||||||
extra_fingerprint,
|
extra_fingerprint,
|
||||||
)
|
)
|
||||||
.is_ok();
|
.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=sysroot");
|
||||||
process.arg("--print=cfg");
|
process.arg("--print=cfg");
|
||||||
|
@ -261,7 +253,6 @@ impl TargetInfo {
|
||||||
)?,
|
)?,
|
||||||
cfg,
|
cfg,
|
||||||
supports_split_debuginfo,
|
supports_split_debuginfo,
|
||||||
supports_force_warn,
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ use rustfix::diagnostics::Diagnostic;
|
||||||
use rustfix::{self, CodeFix};
|
use rustfix::{self, CodeFix};
|
||||||
use semver::Version;
|
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::features::{DiffMap, FeatureOpts, FeatureResolver};
|
||||||
use crate::core::resolver::{HasDevUnits, Resolve, ResolveBehavior};
|
use crate::core::resolver::{HasDevUnits, Resolve, ResolveBehavior};
|
||||||
use crate::core::{Edition, MaybePackage, PackageId, Workspace};
|
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 BROKEN_CODE_ENV: &str = "__CARGO_FIX_BROKEN_CODE";
|
||||||
const EDITION_ENV: &str = "__CARGO_FIX_EDITION";
|
const EDITION_ENV: &str = "__CARGO_FIX_EDITION";
|
||||||
const IDIOMS_ENV: &str = "__CARGO_FIX_IDIOMS";
|
const IDIOMS_ENV: &str = "__CARGO_FIX_IDIOMS";
|
||||||
const SUPPORTS_FORCE_WARN: &str = "__CARGO_SUPPORTS_FORCE_WARN";
|
|
||||||
|
|
||||||
pub struct FixOptions {
|
pub struct FixOptions {
|
||||||
pub edition: bool,
|
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))?;
|
let rustc = ws.config().load_global_rustc(Some(ws))?;
|
||||||
wrapper.arg(&rustc.path);
|
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
|
// 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
|
// repeating build until there are no more changes to be applied
|
||||||
opts.compile_opts.build_config.primary_unit_rustc = Some(wrapper);
|
opts.compile_opts.build_config.primary_unit_rustc = Some(wrapper);
|
||||||
|
@ -849,7 +837,7 @@ impl FixArgs {
|
||||||
fn apply(&self, cmd: &mut Command) {
|
fn apply(&self, cmd: &mut Command) {
|
||||||
cmd.arg(&self.file);
|
cmd.arg(&self.file);
|
||||||
cmd.args(&self.other);
|
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
|
// When migrating an edition, we don't want to fix other lints as
|
||||||
// they can sometimes add suggestions that fail to apply, causing
|
// they can sometimes add suggestions that fail to apply, causing
|
||||||
// the entire migration to fail. But those lints aren't needed to
|
// 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 let Some(edition) = self.prepare_for_edition {
|
||||||
if edition.supports_compat_lint() {
|
if edition.supports_compat_lint() {
|
||||||
if env::var_os(SUPPORTS_FORCE_WARN).is_some() {
|
|
||||||
cmd.arg("--force-warn")
|
cmd.arg("--force-warn")
|
||||||
.arg(format!("rust-{}-compatibility", edition));
|
.arg(format!("rust-{}-compatibility", edition));
|
||||||
} else {
|
|
||||||
cmd.arg("-W").arg(format!("rust-{}-compatibility", edition));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -950,10 +950,6 @@ fn prepare_for_already_on_latest_unstable() {
|
||||||
#[cargo_test]
|
#[cargo_test]
|
||||||
fn prepare_for_already_on_latest_stable() {
|
fn prepare_for_already_on_latest_stable() {
|
||||||
// Stable counterpart of prepare_for_already_on_latest_unstable.
|
// 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() {
|
if Edition::LATEST_UNSTABLE.is_some() {
|
||||||
eprintln!("This test cannot run while the latest edition is unstable, skipping.");
|
eprintln!("This test cannot run while the latest edition is unstable, skipping.");
|
||||||
return;
|
return;
|
||||||
|
@ -1528,10 +1524,6 @@ fn rustfix_handles_multi_spans() {
|
||||||
#[cargo_test]
|
#[cargo_test]
|
||||||
fn fix_edition_2021() {
|
fn fix_edition_2021() {
|
||||||
// Can migrate 2021, even when lints are allowed.
|
// Can migrate 2021, even when lints are allowed.
|
||||||
if !is_nightly() {
|
|
||||||
// Remove once 1.56 is stabilized.
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let p = project()
|
let p = project()
|
||||||
.file(
|
.file(
|
||||||
"Cargo.toml",
|
"Cargo.toml",
|
||||||
|
@ -1748,10 +1740,6 @@ fn fix_with_run_cargo_in_proc_macros() {
|
||||||
#[cargo_test]
|
#[cargo_test]
|
||||||
fn non_edition_lint_migration() {
|
fn non_edition_lint_migration() {
|
||||||
// Migrating to a new edition where a non-edition lint causes problems.
|
// 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()
|
let p = project()
|
||||||
.file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
|
.file("Cargo.toml", &basic_manifest("foo", "0.1.0"))
|
||||||
.file(
|
.file(
|
||||||
|
|
|
@ -377,10 +377,6 @@ fn new_with_reference_link() {
|
||||||
|
|
||||||
#[cargo_test]
|
#[cargo_test]
|
||||||
fn lockfile_constant_during_new() {
|
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("new foo").run();
|
||||||
|
|
||||||
cargo_process("build").cwd(&paths::root().join("foo")).run();
|
cargo_process("build").cwd(&paths::root().join("foo")).run();
|
||||||
|
|
Loading…
Reference in a new issue