Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ contact_links:
url: https://internals.rust-lang.org/c/tools-and-infrastructure/cargo
about: >
Need more discussions with your next big idea?
Reach out the coummunity on the internals forum.
Reach out the community on the internals forum.
4 changes: 2 additions & 2 deletions crates/cargo-test-support/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ use time::format_description::well_known::Rfc3339;
use time::{Duration, OffsetDateTime};
use url::Url;

/// Path to the local index for psuedo-crates.io.
/// Path to the local index for pseudo-crates.io.
///
/// This is a Git repo
/// initialized with a `config.json` file pointing to `dl_path` for downloads
Expand Down Expand Up @@ -622,7 +622,7 @@ struct PackageFile {

const DEFAULT_MODE: u32 = 0o644;

/// Setup a local psuedo-crates.io [`TestRegistry`]
/// Setup a local pseudo-crates.io [`TestRegistry`]
///
/// This is implicitly called by [`Package::new`].
///
Expand Down
4 changes: 2 additions & 2 deletions crates/crates-io/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub enum Error {
#[error(transparent)]
Curl(#[from] curl::Error),

/// Error from seriailzing the request payload and deserializing the
/// Error from serializing the request payload and deserializing the
/// response body (like response body didn't match expected structure).
#[error(transparent)]
Json(#[from] serde_json::Error),
Expand Down Expand Up @@ -183,7 +183,7 @@ pub enum Error {
#[error("{0}")]
InvalidToken(&'static str),

/// Server was unavailable and timeouted. Happened when uploading a way
/// Server was unavailable and timed out. Happened when uploading a way
/// too large tarball to crates.io.
#[error(
"Request timed out after 30 seconds. If you're trying to \
Expand Down
4 changes: 2 additions & 2 deletions crates/home/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn home_dir_inner() -> Option<PathBuf> {
std::env::home_dir()
}

/// Returns the storage directory used by Cargo, often knowns as
/// Returns the storage directory used by Cargo, often known as
/// `.cargo` or `CARGO_HOME`.
///
/// It returns one of the following values, in this order of
Expand Down Expand Up @@ -112,7 +112,7 @@ pub fn cargo_home_with_cwd(cwd: &Path) -> io::Result<PathBuf> {
env::cargo_home_with_cwd_env(&env::OS_ENV, cwd)
}

/// Returns the storage directory used by rustup, often knowns as
/// Returns the storage directory used by rustup, often known as
/// `.rustup` or `RUSTUP_HOME`.
///
/// It returns one of the following values, in this order of
Expand Down
4 changes: 2 additions & 2 deletions src/bin/cargo/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ pub fn main(gctx: &mut GlobalContext) -> CliResult {
} else if let Some(code) = expanded_args.get_one::<String>("explain") {
// Don't let config errors get in the way of parsing arguments
let _ = configure_gctx(gctx, &expanded_args, None, global_args, None);
let mut procss = gctx.load_global_rustc(None)?.process();
procss.arg("--explain").arg(code).exec()?;
let mut process = gctx.load_global_rustc(None)?.process();
process.arg("--explain").arg(code).exec()?;
} else if expanded_args.flag("list") {
// Don't let config errors get in the way of parsing arguments
let _ = configure_gctx(gctx, &expanded_args, None, global_args, None);
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/fingerprint/dep_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ mod encoded_dep_info {
0x72, 0x75, 0x73, 0x74, // path bytes: "rust"
0x00, 0x00, 0x00, 0x00, // # of env vars
];
// Cargo can't recognize v0 after `-Zchecksum-freshess` added.
// Cargo can't recognize v0 after `-Zchecksum-freshness` added.
assert!(EncodedDepInfo::parse(&data).is_none());
}
}
10 changes: 5 additions & 5 deletions src/cargo/core/compiler/fingerprint/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1962,12 +1962,12 @@ where
return Some(StaleItem::MissingFile(reference.to_path_buf()));
};

let skipable_dirs = if let Ok(cargo_home) = home::cargo_home() {
let skipable_dirs: Vec<_> = ["git", "registry"]
let skippable_dirs = if let Ok(cargo_home) = home::cargo_home() {
let skippable_dirs: Vec<_> = ["git", "registry"]
.into_iter()
.map(|subfolder| cargo_home.join(subfolder))
.collect();
Some(skipable_dirs)
Some(skippable_dirs)
} else {
None
};
Expand All @@ -1978,8 +1978,8 @@ where
// (see also #9455 about marking the src directory readonly) which avoids rebuilds when CI
// caches $CARGO_HOME/registry/{index, cache} and $CARGO_HOME/git/db across runs, keeping
// the content the same but changing the mtime.
if let Some(ref skipable_dirs) = skipable_dirs {
if skipable_dirs.iter().any(|dir| path.starts_with(dir)) {
if let Some(ref skippable_dirs) = skippable_dirs {
if skippable_dirs.iter().any(|dir| path.starts_with(dir)) {
continue;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/job_queue/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ pub struct WarningCount {
/// were duplicates of a previous warning
pub duplicates: usize,
/// number of fixable warnings set to `NotAllowed`
/// if any errors have been seen ofr the current
/// if any errors have been seen for the current
/// target
pub fixable: FixableWarnings,
}
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/core/compiler/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ fn compile<'gctx>(
}

// If we are in `--compile-time-deps` and the given unit is not a compile time
// dependency, skip compling the unit and jumps to dependencies, which still
// dependency, skip compiling the unit and jumps to dependencies, which still
// have chances to be compile time dependencies
if !unit.skip_non_compile_time_dep {
// Build up the work to be done to compile this unit, enqueuing it once
Expand Down Expand Up @@ -1615,7 +1615,7 @@ fn check_cfg_args(unit: &Unit) -> Vec<OsString> {
arg_feature.push("))");

// In addition to the package features, we also include the `test` cfg (since
// compiler-team#785, as to be able to someday apply yt conditionally), as well
// compiler-team#785, as to be able to someday apply it conditionally), as well
// the `docsrs` cfg from the docs.rs service.
//
// We include `docsrs` here (in Cargo) instead of rustc, since there is a much closer
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/compiler/output_depinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::util::{CargoResult, internal};
use cargo_util::paths;
use tracing::debug;

/// Bacially just normalizes a given path and converts it to a string.
/// Basically just normalizes a given path and converts it to a string.
fn render_filename<P: AsRef<Path>>(path: P, basedir: Option<&str>) -> CargoResult<String> {
fn wrap_path(path: &Path) -> CargoResult<String> {
path.to_str()
Expand Down
8 changes: 4 additions & 4 deletions src/cargo/core/compiler/output_sbom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ pub fn build_sbom(build_runner: &BuildRunner<'_, '_>, root: &Unit) -> CargoResul
let mut crates = Vec::new();
let sbom_graph = build_sbom_graph(build_runner, root);

// Build set of indicies for each node in the graph for fast lookup.
let indicies: HashMap<&Unit, SbomIndex> = sbom_graph
// Build set of indices for each node in the graph for fast lookup.
let indices: HashMap<&Unit, SbomIndex> = sbom_graph
.keys()
.enumerate()
.map(|(i, dep)| (*dep, SbomIndex(i)))
Expand All @@ -115,7 +115,7 @@ pub fn build_sbom(build_runner: &BuildRunner<'_, '_>, root: &Unit) -> CargoResul
let mut krate = SbomCrate::new(unit);
for (dep, kind) in edges {
krate.dependencies.push(SbomDependency {
index: indicies[dep],
index: indices[dep],
kind: kind,
});
}
Expand All @@ -128,7 +128,7 @@ pub fn build_sbom(build_runner: &BuildRunner<'_, '_>, root: &Unit) -> CargoResul
Ok(Sbom {
version: SbomFormatVersion(1),
crates,
root: indicies[root],
root: indices[root],
rustc,
target,
})
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,7 +1207,7 @@ fn parse_gitoxide(

impl CliUnstable {
/// Parses `-Z` flags from the command line, and returns messages that warn
/// if any flag has alreardy been stabilized.
/// if any flag has already been stabilized.
pub fn parse(
&mut self,
flags: &[String],
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ pub struct PackageRegistry<'gctx> {
/// This is constructed via [`PackageRegistry::register_lock`].
/// See also [`LockedMap`].
locked: LockedMap,
/// A group of packages tha allows to use even when yanked.
/// Packages allowed to be used, even if they are yanked.
yanked_whitelist: HashSet<PackageId>,
source_config: SourceConfigMap<'gctx>,

Expand Down
2 changes: 1 addition & 1 deletion src/cargo/core/resolver/encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
//! really use it that much except for `checksum`s historically. It's not
//! really recommended to use this.
//!
//! * The actual literal on-disk serialiation is found in
//! * The actual literal on-disk serialization is found in
//! `src/cargo/ops/lockfile.rs` which basically renders a `toml::Value` in a
//! special fashion to make sure we have strict control over the on-disk
//! format.
Expand Down
10 changes: 4 additions & 6 deletions src/cargo/ops/cargo_package/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -617,12 +617,10 @@ fn build_ar_list(
.iter()
.filter(|t| t.is_custom_build())
{
if let Some(custome_build_path) = t.src_path().path() {
let abs_custome_build_path =
paths::normalize_path(&pkg.root().join(custome_build_path));
if !abs_custome_build_path.is_file() || !abs_custome_build_path.starts_with(pkg.root())
{
error_custom_build_file_not_in_package(pkg, &abs_custome_build_path, t)?;
if let Some(custom_build_path) = t.src_path().path() {
let abs_custom_build_path = paths::normalize_path(&pkg.root().join(custom_build_path));
if !abs_custom_build_path.is_file() || !abs_custom_build_path.starts_with(pkg.root()) {
error_custom_build_file_not_in_package(pkg, &abs_custom_build_path, t)?;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/ops/tree/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ fn add_pkg(
if !opts.edge_kinds.contains(&EdgeKind::Dep(dep.kind())) {
return false;
}
// Filter out proc-macrcos if requested.
// Filter out proc-macros if requested.
if opts.no_proc_macro && graph.package_for_id(dep_id).proc_macro() {
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/sources/git/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ impl<'a> GitCheckout<'a> {
&self.database.remote.url()
}

/// Clone a repo for a `revision` into a local path from a `datatabase`.
/// Clone a repo for a `revision` into a local path from a `database`.
/// This is a filesystem-to-filesystem clone.
fn clone_into(
into: &Path,
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/sources/registry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ impl<'gctx> RegistrySource<'gctx> {
/// Unpacks the `.crate` tarball of the package in a given directory.
///
/// Returns the path to the crate tarball directory,
/// whch is always `<unpack_dir>/<pkg>-<version>`.
/// which is always `<unpack_dir>/<pkg>-<version>`.
///
/// This holds an assumption that the associated tarball already exists.
pub fn unpack_package_in(
Expand Down
2 changes: 1 addition & 1 deletion src/cargo/util/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ impl GlobalContext {
}

/// Internal method for getting an environment variable as a list.
/// If the key is a non-mergable list and a value is found in the environment, existing values are cleared.
/// If the key is a non-mergeable list and a value is found in the environment, existing values are cleared.
fn get_env_list(
&self,
key: &ConfigKey,
Expand Down
4 changes: 2 additions & 2 deletions src/cargo/util/toml/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1730,7 +1730,7 @@ pub fn to_real_manifest(
normalized_package.links.as_deref(),
rust_version.clone(),
);
// editon2024 stops exposing implicit features, which will strip weak optional dependencies from `dependencies`,
// edition2024 stops exposing implicit features, which will strip weak optional dependencies from `dependencies`,
// need to check whether `dep_name` is stripped as unused dependency
if let Err(ref err) = summary {
if let Some(missing_dep) = err.downcast_ref::<MissingDependencyError>() {
Expand Down Expand Up @@ -2501,7 +2501,7 @@ fn validate_profiles(
Ok(())
}

/// Checks stytax validity and unstable feature gate for a given profile.
/// Checks syntax validity and unstable feature gate for a given profile.
pub fn validate_profile(
root: &manifest::TomlProfile,
name: &str,
Expand Down
4 changes: 2 additions & 2 deletions src/doc/src/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

- cargo-credential-libsecret: give FFI correctly-sized object
[#15767](https://github.com/rust-lang/cargo/pull/15767)
- cargo-publish: includes mainfest paths when verifying
- cargo-publish: includes manifest paths when verifying
[#15705](https://github.com/rust-lang/cargo/pull/15705)
- cargo-tree: Fixed `no-proc-macro` being overridden by subsequent edges.
[#15764](https://github.com/rust-lang/cargo/pull/15764)
Expand Down Expand Up @@ -211,7 +211,7 @@
[#15682](https://github.com/rust-lang/cargo/pull/15682)
- Update links in contrib docs
[#15659](https://github.com/rust-lang/cargo/pull/15659)
- docs: clarify `--all-features` not available for all commmands
- docs: clarify `--all-features` not available for all commands
[#15572](https://github.com/rust-lang/cargo/pull/15572)
- docs(README): fix the link to the changelog in the Cargo book
[#15597](https://github.com/rust-lang/cargo/pull/15597)
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4488,7 +4488,7 @@ WRAPPER CALLED: rustc --crate-name foo [..]

/// Checks what happens when both rust-wrapper and rustc-workspace-wrapper are set.
#[cargo_test]
fn rustc_wrapper_precendence() {
fn rustc_wrapper_precedence() {
let p = project().file("src/lib.rs", "").build();
let rustc_wrapper = tools::echo_wrapper();
let ws_wrapper = rustc_wrapper.with_file_name("rustc-ws-wrapper");
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/build_script_env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ fn rustc_cfg_with_and_without_value() {
}

#[cargo_test]
fn rerun_if_env_is_exsited_config() {
fn rerun_if_env_exists_in_config() {
let p = project()
.file("src/main.rs", "fn main() {}")
.file(
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/custom_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ fn custom_target_ignores_filepath() {
"#]])
.run();

// But not the second time, even though the path to the custom target is dfferent.
// But not the second time, even though the path to the custom target is different.
p.cargo("build --lib --target b/custom-target.json")
.with_stderr_data(str![[r#"
[FINISHED] `dev` profile [unoptimized + debuginfo] target(s) in [ELAPSED]s
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/direct_minimal_versions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fn simple() {
);
assert!(
!lock.contains("1.1.0"),
"dep maximimal version cannot be present"
"dep maximal version cannot be present"
);
}

Expand Down Expand Up @@ -139,7 +139,7 @@ fn yanked() {
);
assert!(
!lock.contains("1.2.0"),
"dep maximimal version cannot be present"
"dep maximal version cannot be present"
);
}

Expand Down Expand Up @@ -189,7 +189,7 @@ fn indirect() {
);
assert!(
!lock.contains("1.1.0"),
"direct maximimal version cannot be present"
"direct maximal version cannot be present"
);
assert!(
!lock.contains("2.0.0"),
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/docscrape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -698,7 +698,7 @@ fn use_dev_deps_if_explicitly_enabled() {

#[cargo_test(nightly, reason = "rustdoc scrape examples flags are unstable")]
fn only_scrape_documented_targets() {
// package bar has doc = false and should not be eligible for documtation.
// package bar has doc = false and should not be eligible for documentation.
let p = project()
.file(
"Cargo.toml",
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/future_incompat_report.rs
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ The package `second-dep v0.0.2` currently triggers the following future incompat
// Extract the 'id' from the stdout. We are looking
// for the id in a line of the form "run `cargo report future-incompatibilities --id yZ7S`"
// which is generated by Cargo to tell the user what command to run
// This is just to test that passing the id suppresses the warning mesasge. Any users needing
// This is just to test that passing the id suppresses the warning message. Any users needing
// access to the report from a shell script should use the `--future-incompat-report` flag
let stderr = std::str::from_utf8(&output.stderr).unwrap();

Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3468,7 +3468,7 @@ fn two_dep_forms() {
.file("a/src/lib.rs", "")
.build();

// This'll download the git repository twice, one with HEAD and once with
// This will download the git repository twice, one with HEAD and once with
// the master branch. Then it'll compile 4 crates, the 2 git deps, then
// the two local deps.
project
Expand Down
2 changes: 1 addition & 1 deletion tests/testsuite/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2783,7 +2783,7 @@ fn dry_run_incompatible_package() {
}

#[cargo_test]
fn dry_run_incompatible_package_dependecy() {
fn dry_run_incompatible_package_dependency() {
let p = project()
.file(
"Cargo.toml",
Expand Down
4 changes: 2 additions & 2 deletions tests/testsuite/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3649,7 +3649,7 @@ fn larger_filesizes() {
"#;
let lots_of_crabs = "🦀".repeat(1337);
let main_rs_contents = format!(r#"fn main() {{ println!("{}"); }}"#, lots_of_crabs);
let bar_txt_contents = "This file is relatively uncompressible, to increase the compressed
let bar_txt_contents = "This file is relatively incompressible, to increase the compressed
package size beyond 1KiB.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
Expand Down Expand Up @@ -3765,7 +3765,7 @@ fn symlink_filesizes() {
"#;
let lots_of_crabs = "🦀".repeat(1337);
let main_rs_contents = format!(r#"fn main() {{ println!("{}"); }}"#, lots_of_crabs);
let bar_txt_contents = "This file is relatively uncompressible, to increase the compressed
let bar_txt_contents = "This file is relatively incompressible, to increase the compressed
package size beyond 1KiB.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
Expand Down
Loading
Loading