Skip to content

Commit

Permalink
Update rust-lang/cargo links
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Sep 1, 2024
1 parent 0a2abf7 commit 41af832
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 10 deletions.
6 changes: 4 additions & 2 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ pub struct BuildConfig {
pub(crate) override_target_rustdocflags: bool,
}

// https://github.com/rust-lang/cargo/blob/0.67.0/src/cargo/util/config/target.rs
// https://github.com/rust-lang/cargo/blob/0.80.0/src/cargo/util/context/target.rs
/// A `[target.<triple>]` or `[target.<cfg>]` table.
///
/// [reference](https://doc.rust-lang.org/nightly/cargo/reference/config.html#target)
Expand Down Expand Up @@ -984,7 +984,7 @@ impl<'de> Deserialize<'de> for Flags {
}
}

// https://github.com/rust-lang/cargo/blob/0.67.0/src/cargo/util/config/path.rs
// https://github.com/rust-lang/cargo/blob/0.80.0/src/cargo/util/context/path.rs
#[derive(Debug, Deserialize, PartialEq, Clone)]
#[serde(transparent)]
pub struct ConfigRelativePath(pub(crate) Value<String>);
Expand Down Expand Up @@ -1226,5 +1226,7 @@ pub(crate) fn split_encoded(s: &str) -> impl Iterator<Item = &str> {
s.split('\x1f')
}
pub(crate) fn split_space_separated(s: &str) -> impl Iterator<Item = &str> {
// TODO: tab/line?
// https://github.com/rust-lang/cargo/blob/0.80.0/src/cargo/util/context/path.rs#L89
s.split(' ').map(str::trim).filter(|s| !s.is_empty())
}
2 changes: 1 addition & 1 deletion src/easy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ impl BuildConfig {
}
}

// https://github.com/rust-lang/cargo/blob/0.67.0/src/cargo/util/config/target.rs
// https://github.com/rust-lang/cargo/blob/0.80.0/src/cargo/util/context/target.rs
/// A `[target.<triple>]` or `[target.<cfg>]` table.
///
/// [reference](https://doc.rust-lang.org/nightly/cargo/reference/config.html#target)
Expand Down
2 changes: 1 addition & 1 deletion src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl ApplyEnv for BuildConfig {
impl ApplyEnv for DocConfig {
fn apply_env(&mut self, cx: &ResolveContext) -> Result<()> {
// doc.browser config value is prefer over BROWSER environment variable.
// https://github.com/rust-lang/cargo/blob/0.67.0/src/cargo/ops/cargo_doc.rs#L52-L53
// https://github.com/rust-lang/cargo/blob/0.80.0/src/cargo/ops/cargo_doc.rs#L143-L144
if self.browser.is_none() {
if let Some(browser) = cx.env("BROWSER")? {
self.browser = Some(
Expand Down
5 changes: 4 additions & 1 deletion src/merge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ use crate::{
Color, Frequency, When,
};

// https://github.com/rust-lang/cargo/blob/0.67.0/src/cargo/util/config/mod.rs#L1900-L1908
// https://github.com/rust-lang/cargo/blob/0.74.0/src/cargo/util/config/mod.rs#L2107-L2115
// TODO:
// - https://github.com/rust-lang/cargo/pull/12515
// - https://github.com/rust-lang/cargo/blob/0.80.0/src/cargo/util/context/mod.rs#L2159-L2167
//
// > If `force` is true, primitive (non-container) types will override existing values.
// > If false, the original will be kept and the new value ignored.
Expand Down
2 changes: 1 addition & 1 deletion src/resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ impl CargoVersion {
fn verbose_version(mut rustc_or_cargo: ProcessBuilder) -> Result<(String, ProcessBuilder)> {
// Use verbose version output because the packagers add extra strings to the normal version output.
// Do not use long flags (--version --verbose) because clippy-deriver doesn't handle them properly.
// -vV is also matched with that cargo internally uses: https://github.com/rust-lang/cargo/blob/14b46ecc62aa671d7477beba237ad9c6a209cf5d/src/cargo/util/rustc.rs#L65
// -vV is also matched with that cargo internally uses: https://github.com/rust-lang/cargo/blob/0.80.0/src/cargo/util/rustc.rs#L65
rustc_or_cargo.arg("-vV");
let verbose_version = rustc_or_cargo.read()?;
Ok((verbose_version, rustc_or_cargo))
Expand Down
2 changes: 1 addition & 1 deletion src/value.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: Apache-2.0 OR MIT

// Based on https://github.com/rust-lang/cargo/blob/0.67.0/src/cargo/util/config/value.rs.
// Based on https://github.com/rust-lang/cargo/blob/0.80.0/src/cargo/util/context/value.rs.

use core::{fmt, mem, str::FromStr};
use std::{
Expand Down
6 changes: 3 additions & 3 deletions src/walk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn config_path(path: &Path) -> Option<PathBuf> {
}

// Use the home crate only on Windows which std::env::home_dir is not correct.
// https://github.com/rust-lang/cargo/blob/b2e1d3b6235c07221dd0fcac54a7b0c754ef8b11/crates/home/src/lib.rs#L65-L72
// https://github.com/rust-lang/cargo/blob/0.80.0/crates/home/src/lib.rs#L65-L72
#[cfg(windows)]
use home::home_dir;
#[cfg(not(windows))]
Expand All @@ -50,8 +50,8 @@ fn home_dir() -> Option<PathBuf> {

pub(crate) fn cargo_home_with_cwd(cwd: &Path) -> Option<PathBuf> {
// Follow the cargo's behavior.
// https://github.com/rust-lang/cargo/blob/b2e1d3b6235c07221dd0fcac54a7b0c754ef8b11/crates/home/src/lib.rs#L77-L86
// https://github.com/rust-lang/cargo/blob/b2e1d3b6235c07221dd0fcac54a7b0c754ef8b11/crates/home/src/env.rs#L63-L77
// https://github.com/rust-lang/cargo/blob/0.80.0/crates/home/src/lib.rs#L77-L86
// https://github.com/rust-lang/cargo/blob/0.80.0/crates/home/src/env.rs#L63-L77
match std::env::var_os("CARGO_HOME").filter(|h| !h.is_empty()).map(PathBuf::from) {
Some(home) => {
if home.is_absolute() {
Expand Down

0 comments on commit 41af832

Please sign in to comment.