diff --git a/CHANGELOG.md b/CHANGELOG.md index fc0ebf4c74b4..8566d2e41f4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ ### Changed -- Splitted up registry documentation into multiple sections. +- Split up registry documentation into multiple sections. [#11480](https://github.com/rust-lang/cargo/pull/11480) ### Fixed @@ -55,7 +55,7 @@ [#11349](https://github.com/rust-lang/cargo/pull/11349) - ❗ Cargo now emits an error if there are multiple registries in the configuration with the same index URL. [#10592](https://github.com/rust-lang/cargo/pull/10592) -- Cargo now is aware of compression ratio when extracing crate files. +- Cargo now is aware of compression ratio when extracting crate files. This relaxes the hard size limit introduced in 1.64.0 to mitigate zip bomb attack. [#11337](https://github.com/rust-lang/cargo/pull/11337) - Cargo now errors out when `cargo fix` on a git repo with uncommitted changes. @@ -65,7 +65,7 @@ - Cargo now warns when running `cargo new/init` and `PATH` env separator is in the project path. [#11318](https://github.com/rust-lang/cargo/pull/11318) -- Better error messages when multiple pacakges were found and +- Better error messages when multiple packages were found and `cargo add/remove` gets confused. [#11186](https://github.com/rust-lang/cargo/pull/11186) [#11375](https://github.com/rust-lang/cargo/pull/11375) @@ -289,7 +289,7 @@ ### Nightly -- Progress indicator for sparse registries becomes more straightfoward. +- Progress indicator for sparse registries becomes more straightforward. [#11068](https://github.com/rust-lang/cargo/pull/11068) ## Cargo 1.64 (2022-09-22) diff --git a/crates/cargo-util/src/paths.rs b/crates/cargo-util/src/paths.rs index 0a3843c3aa7b..d0ac2a79a083 100644 --- a/crates/cargo-util/src/paths.rs +++ b/crates/cargo-util/src/paths.rs @@ -651,7 +651,7 @@ pub fn create_dir_all_excluded_from_backups_atomic(p: impl AsRef) -> Resul // here to create the directory directly and fs::create_dir_all() explicitly treats // the directory being created concurrently by another thread or process as success, // hence the check below to follow the existing behavior. If we get an error at - // rename() and suddently the directory (which didn't exist a moment earlier) exists + // rename() and suddenly the directory (which didn't exist a moment earlier) exists // we can infer from it's another cargo process doing work. if let Err(e) = fs::rename(tempdir.path(), path) { if !path.exists() { diff --git a/src/cargo/core/compiler/build_context/target_info.rs b/src/cargo/core/compiler/build_context/target_info.rs index e297a2ef783b..61398a7d66e6 100644 --- a/src/cargo/core/compiler/build_context/target_info.rs +++ b/src/cargo/core/compiler/build_context/target_info.rs @@ -1,4 +1,4 @@ -//! This modules contains types storing information of target platfroms. +//! This modules contains types storing information of target platforms. //! //! Normally, call [`RustcTargetData::new`] to construct all the target //! platform once, and then query info on your demand. For example, diff --git a/src/cargo/core/compiler/unit_dependencies.rs b/src/cargo/core/compiler/unit_dependencies.rs index 8d87f4af655a..64356d47b4be 100644 --- a/src/cargo/core/compiler/unit_dependencies.rs +++ b/src/cargo/core/compiler/unit_dependencies.rs @@ -1109,7 +1109,7 @@ impl<'a, 'cfg> State<'a, 'cfg> { // did not enable it, don't include it. if dep.is_optional() { // This `unit_for` is from parent dep and *SHOULD* contains its own - // artifact dep infomration inside `artifact_target_for_features`. + // artifact dep information inside `artifact_target_for_features`. // So, no need to map any artifact info from an incorrect `dep.artifact()`. let features_for = unit_for.map_to_features_for(IS_NO_ARTIFACT_DEP); if !self.is_dep_activated(pkg_id, features_for, dep.name_in_toml()) { diff --git a/src/cargo/core/profiles.rs b/src/cargo/core/profiles.rs index bcd9a89c76dd..fba7b0ca36fb 100644 --- a/src/cargo/core/profiles.rs +++ b/src/cargo/core/profiles.rs @@ -7,12 +7,12 @@ //! which does the followings: //! //! - Create a `Profiles` by merging profiles from configs onto the profile -//! from root mainfest (see [`merge_config_profiles`]). +//! from root manifest (see [`merge_config_profiles`]). //! - Add built-in profiles onto it (see [`Profiles::add_root_profiles`]). //! - Process profile inheritance for each profiles. (see [`Profiles::add_maker`]). //! //! Then you can query a [`Profile`] via [`Profiles::get_profile`], which respects -//! the profile overriden hierarchy described in below. The [`Profile`] you get +//! the profile overridden hierarchy described in below. The [`Profile`] you get //! is basically an immutable struct containing the compiler flag presets. //! //! ## Profile overridden hierarchy diff --git a/src/cargo/ops/cargo_compile/packages.rs b/src/cargo/ops/cargo_compile/packages.rs index 39f627b5db54..4bc0ff231c2f 100644 --- a/src/cargo/ops/cargo_compile/packages.rs +++ b/src/cargo/ops/cargo_compile/packages.rs @@ -9,13 +9,13 @@ use crate::util::CargoResult; use anyhow::{bail, Context as _}; -/// Represents the selected pacakges that will be built. +/// Represents the selected packages that will be built. /// /// Generally, it represents the combination of all `-p` flag. When working within /// a workspace, `--exclude` and `--workspace` flags also contribute to it. #[derive(PartialEq, Eq, Debug)] pub enum Packages { - /// Pacakges selected by default. Ususally means no flag provided. + /// Packages selected by default. Usually means no flag provided. Default, /// Opt in all packages. /// diff --git a/src/cargo/ops/cargo_compile/unit_generator.rs b/src/cargo/ops/cargo_compile/unit_generator.rs index efc4edf992e0..ce5a825fe3a6 100644 --- a/src/cargo/ops/cargo_compile/unit_generator.rs +++ b/src/cargo/ops/cargo_compile/unit_generator.rs @@ -35,7 +35,7 @@ struct Proposal<'a> { } /// The context needed for generating root units, -/// which are pacakges the user has requested to compile. +/// which are packages the user has requested to compile. /// /// To generate a full [`UnitGraph`], /// generally you need to call [`generate_root_units`] first, @@ -700,7 +700,7 @@ Rustdoc did not scrape the following examples because they require dev-dependenc self.proposals_to_units(proposals) } - /// Generates units specfically for doc-scraping. + /// Generates units specifically for doc-scraping. /// /// This requires a separate entrypoint from [`generate_root_units`] because it /// takes the documented units as input. diff --git a/src/cargo/ops/registry.rs b/src/cargo/ops/registry.rs index d70e86cd1490..c1684d0ef316 100644 --- a/src/cargo/ops/registry.rs +++ b/src/cargo/ops/registry.rs @@ -814,7 +814,7 @@ pub fn registry_login( } else if key_subject.is_some() { "key-subject" } else { - unreachable!("how did whe get here"); + unreachable!("how did we get here"); }; bail!( "the `{flag}` flag is unstable, pass `-Z registry-auth` to enable it\n\ @@ -855,7 +855,7 @@ pub fn registry_login( if let Some(p) = paserk_public_from_paserk_secret(&secret_key) { drop_println!(config, "{}", &p); } else { - bail!("not a validly formated PASERK secret key"); + bail!("not a validly formatted PASERK secret key"); } new_token = RegistryCredentialConfig::AsymmetricKey(( secret_key, diff --git a/src/cargo/sources/registry/mod.rs b/src/cargo/sources/registry/mod.rs index 972863521958..f74daa5486bc 100644 --- a/src/cargo/sources/registry/mod.rs +++ b/src/cargo/sources/registry/mod.rs @@ -890,7 +890,7 @@ fn max_unpack_size(size: u64) -> u64 { std::env::var(RATIO_VAR) .unwrap() .parse() - .expect("a max compresssion ratio in bytes") + .expect("a max compression ratio in bytes") } else { MAX_COMPRESSION_RATIO }; diff --git a/src/cargo/util/auth.rs b/src/cargo/util/auth.rs index 0235f517ac6d..e0e8f1dd6b44 100644 --- a/src/cargo/util/auth.rs +++ b/src/cargo/util/auth.rs @@ -72,7 +72,7 @@ pub fn registry_credential_config( // Find the SourceId's name by its index URL. If environment variables // are available they will be preferred over configuration values. // - // The fundimental problem is that we only know the index url of the registry + // The fundamental problem is that we only know the index url of the registry // for certain. For example, an unnamed registry source can come from the `--index` // command line argument, or from a Cargo.lock file. For this reason, we always // attempt to discover the name by looking it up by the index URL. @@ -341,7 +341,7 @@ fn auth_token_optional( if let Some(cache_token_value) = cache.get(url) { // Tokens for endpoints that do not involve a mutation can always be reused. - // If the value is put in the cach by the command line, then we reuse it without looking at the configuration. + // If the value is put in the cache by the command line, then we reuse it without looking at the configuration. if cache_token_value.from_commandline || cache_token_value.independent_of_endpoint || mutation.is_none() diff --git a/src/doc/man/cargo-locate-project.md b/src/doc/man/cargo-locate-project.md index 61edead11e8d..87cf9919f528 100644 --- a/src/doc/man/cargo-locate-project.md +++ b/src/doc/man/cargo-locate-project.md @@ -15,7 +15,7 @@ manifest is found by searching upward for a file named `Cargo.toml` starting fro working directory. If the project happens to be a part of a workspace, the manifest of the project, rather than -the workspace root, is output. This can be overriden by the `--workspace` flag. The root +the workspace root, is output. This can be overridden by the `--workspace` flag. The root workspace is found by traversing further upward or by using the field `package.workspace` after locating the manifest of a workspace member. diff --git a/tests/testsuite/cargo_command.rs b/tests/testsuite/cargo_command.rs index e96f7ae2184d..5eb9bb274c9f 100644 --- a/tests/testsuite/cargo_command.rs +++ b/tests/testsuite/cargo_command.rs @@ -343,7 +343,7 @@ fn cargo_subcommand_env() { .with_stdout(cargo.to_str().unwrap()) .run(); - // Check that subcommands inherit an overriden $CARGO + // Check that subcommands inherit an overridden $CARGO let envtest_bin = target_dir .join("cargo-envtest") .with_extension(std::env::consts::EXE_EXTENSION) diff --git a/tests/testsuite/config_cli.rs b/tests/testsuite/config_cli.rs index 92e145d9661b..be70b5da806d 100644 --- a/tests/testsuite/config_cli.rs +++ b/tests/testsuite/config_cli.rs @@ -56,7 +56,7 @@ fn cli_priority() { } #[cargo_test] -fn merge_primitives_for_multiple_cli_occurences() { +fn merge_primitives_for_multiple_cli_occurrences() { let config_path0 = ".cargo/file0.toml"; write_config_at(config_path0, "k = 'file0'"); let config_path1 = ".cargo/file1.toml"; diff --git a/tests/testsuite/login.rs b/tests/testsuite/login.rs index da04a5f38ab4..7dee57d79337 100644 --- a/tests/testsuite/login.rs +++ b/tests/testsuite/login.rs @@ -294,7 +294,7 @@ k3.public.AmDwjlyf8jAV3gm5Z7Kz9xAOcsKslt_Vwp5v-emjFzBHLCtcANzTaVEghTNEMj9PkQ", .with_stdin("k3.secret.fNYVuMvBgOlljt9TDohnaYLblghqaHoQquVZwgR6X12cBFHZLFsaU3q7X3k1Zn36") .run(); - // and then it shuld work + // and then it should work cargo_process("login --key-subject=foo -Z registry-auth") .masquerade_as_nightly_cargo(&["registry-auth"]) .replace_crates_io(registry.index_url()) diff --git a/tests/testsuite/registry_auth.rs b/tests/testsuite/registry_auth.rs index 440cc90955fe..64a1176e50a3 100644 --- a/tests/testsuite/registry_auth.rs +++ b/tests/testsuite/registry_auth.rs @@ -32,7 +32,7 @@ fn make_project() -> Project { p } -static SUCCCESS_OUTPUT: &'static str = "\ +static SUCCESS_OUTPUT: &'static str = "\ [UPDATING] `alternative` index [DOWNLOADING] crates ... [DOWNLOADED] bar v0.0.1 (registry `alternative`) @@ -61,7 +61,7 @@ fn simple() { .build(); let p = make_project(); - cargo(&p, "build").with_stderr(SUCCCESS_OUTPUT).run(); + cargo(&p, "build").with_stderr(SUCCESS_OUTPUT).run(); } #[cargo_test] @@ -74,7 +74,7 @@ fn simple_with_asymmetric() { .build(); let p = make_project(); - cargo(&p, "build").with_stderr(SUCCCESS_OUTPUT).run(); + cargo(&p, "build").with_stderr(SUCCESS_OUTPUT).run(); } #[cargo_test] @@ -93,7 +93,7 @@ fn environment_config() { registry.index_url().as_str(), ) .env("CARGO_REGISTRIES_ALTERNATIVE_TOKEN", registry.token()) - .with_stderr(SUCCCESS_OUTPUT) + .with_stderr(SUCCESS_OUTPUT) .run(); } @@ -109,7 +109,7 @@ fn environment_token() { let p = make_project(); cargo(&p, "build") .env("CARGO_REGISTRIES_ALTERNATIVE_TOKEN", registry.token()) - .with_stderr(SUCCCESS_OUTPUT) + .with_stderr(SUCCESS_OUTPUT) .run(); } @@ -130,7 +130,7 @@ fn environment_token_with_asymmetric() { let p = make_project(); cargo(&p, "build") .env("CARGO_REGISTRIES_ALTERNATIVE_SECRET_KEY", registry.key()) - .with_stderr(SUCCCESS_OUTPUT) + .with_stderr(SUCCESS_OUTPUT) .run(); }