Upgrade Rust toolchain to 1.84.0 (#10533)
Some checks are pending
CI / cargo dev generate-all (push) Blocked by required conditions
CI / cargo shear (push) Waiting to run
CI / check windows trampoline | i686 (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / lint (push) Waiting to run
CI / cargo clippy | ubuntu (push) Blocked by required conditions
CI / cargo clippy | windows (push) Blocked by required conditions
CI / cargo test | ubuntu (push) Blocked by required conditions
CI / cargo test | macos (push) Blocked by required conditions
CI / cargo test | windows (push) Blocked by required conditions
CI / check windows trampoline | aarch64 (push) Blocked by required conditions
CI / check windows trampoline | x86_64 (push) Blocked by required conditions
CI / test windows trampoline | i686 (push) Blocked by required conditions
CI / test windows trampoline | x86_64 (push) Blocked by required conditions
CI / typos (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / build binary | linux (push) Blocked by required conditions
CI / build binary | macos aarch64 (push) Blocked by required conditions
CI / build binary | macos x86_64 (push) Blocked by required conditions
CI / build binary | windows (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / build binary | freebsd (push) Blocked by required conditions
CI / ecosystem test | prefecthq/prefect (push) Blocked by required conditions
CI / ecosystem test | pallets/flask (push) Blocked by required conditions
CI / integration test | conda on ubuntu (push) Blocked by required conditions
CI / integration test | free-threaded on linux (push) Blocked by required conditions
CI / integration test | free-threaded on windows (push) Blocked by required conditions
CI / integration test | pypy on ubuntu (push) Blocked by required conditions
CI / integration test | pypy on windows (push) Blocked by required conditions
CI / integration test | graalpy on ubuntu (push) Blocked by required conditions
CI / integration test | graalpy on windows (push) Blocked by required conditions
CI / integration test | github actions (push) Blocked by required conditions
CI / integration test | determine publish changes (push) Blocked by required conditions
CI / integration test | uv publish (push) Blocked by required conditions
CI / check cache | ubuntu (push) Blocked by required conditions
CI / check cache | macos aarch64 (push) Blocked by required conditions
CI / check system | python on debian (push) Blocked by required conditions
CI / check system | python on fedora (push) Blocked by required conditions
CI / check system | python on ubuntu (push) Blocked by required conditions
CI / check system | python on opensuse (push) Blocked by required conditions
CI / check system | python on rocky linux 8 (push) Blocked by required conditions
CI / check system | python on rocky linux 9 (push) Blocked by required conditions
CI / check system | pypy on ubuntu (push) Blocked by required conditions
CI / check system | pyston (push) Blocked by required conditions
CI / check system | alpine (push) Blocked by required conditions
CI / check system | python on macos aarch64 (push) Blocked by required conditions
CI / check system | homebrew python on macos aarch64 (push) Blocked by required conditions
CI / check system | python on macos x86_64 (push) Blocked by required conditions
CI / check system | python3.10 on windows (push) Blocked by required conditions
CI / check system | python3.10 on windows x86 (push) Blocked by required conditions
CI / check system | python3.13 on windows (push) Blocked by required conditions
CI / check system | python3.12 via chocolatey (push) Blocked by required conditions
CI / check system | python3.9 via pyenv (push) Blocked by required conditions
CI / check system | python3.13 (push) Blocked by required conditions
CI / check system | conda3.11 on linux (push) Blocked by required conditions
CI / check system | conda3.8 on linux (push) Blocked by required conditions
CI / check system | conda3.11 on macos (push) Blocked by required conditions
CI / check system | conda3.8 on macos (push) Blocked by required conditions
CI / check system | conda3.11 on windows (push) Blocked by required conditions
CI / check system | conda3.8 on windows (push) Blocked by required conditions
CI / check system | amazonlinux (push) Blocked by required conditions
CI / check system | embedded python3.10 on windows (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions

## Summary
Upgrade the rust toolchain to 1.84.0. This PR does not bump the MSRV.
This commit is contained in:
samypr100 2025-01-11 22:19:33 -05:00 committed by GitHub
parent 051aaa5fe5
commit 4d3809cc6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 65 additions and 64 deletions

View file

@ -225,6 +225,9 @@ rc_mutex = "warn"
rest_pat_in_fully_bound_structs = "warn"
if_not_else = "allow"
# Diagnostics are not actionable: Enable once https://github.com/rust-lang/rust-clippy/issues/13774 is resolved.
large_stack_arrays = "allow"
[profile.release]
strip = true
lto = "fat"

View file

@ -741,7 +741,7 @@ mod tests {
let mut netrc_file = NamedTempFile::new()?;
writeln!(
netrc_file,
r#"machine {} login {username} password {password}"#,
r"machine {} login {username} password {password}",
base_url.host_str().unwrap()
)?;
@ -788,7 +788,7 @@ mod tests {
let mut netrc_file = NamedTempFile::new()?;
writeln!(
netrc_file,
r#"machine example.com login {username} password {password}"#,
r"machine example.com login {username} password {password}",
)?;
let client = test_client_builder()
@ -829,7 +829,7 @@ mod tests {
let mut netrc_file = NamedTempFile::new()?;
writeln!(
netrc_file,
r#"machine {} login {username} password {password}"#,
r"machine {} login {username} password {password}",
base_url.host_str().unwrap()
)?;

View file

@ -292,7 +292,7 @@ impl DevGroupsSpecification {
self.groups
.as_ref()
.map_or(false, |groups| groups.contains(group))
.is_some_and(|groups| groups.contains(group))
}
}

View file

@ -163,7 +163,7 @@ impl<'a> BuildDispatch<'a> {
}
#[allow(refining_impl_trait)]
impl<'a> BuildContext for BuildDispatch<'a> {
impl BuildContext for BuildDispatch<'_> {
type SourceDistBuilder = SourceBuild;
fn interpreter(&self) -> &Interpreter {

View file

@ -139,8 +139,8 @@ pub async fn unzip<R: tokio::io::AsyncRead + Unpin>(
/// Unpack the given tar archive into the destination directory.
///
/// This is equivalent to `archive.unpack_in(dst)`, but it also preserves the executable bit.
async fn untar_in<'a>(
mut archive: tokio_tar::Archive<&'a mut (dyn tokio::io::AsyncRead + Unpin)>,
async fn untar_in(
mut archive: tokio_tar::Archive<&'_ mut (dyn tokio::io::AsyncRead + Unpin)>,
dst: &Path,
) -> std::io::Result<()> {
let mut entries = archive.entries()?;

View file

@ -516,7 +516,7 @@ pub fn is_temporary(path: impl AsRef<Path>) -> bool {
path.as_ref()
.file_name()
.and_then(|name| name.to_str())
.map_or(false, |name| name.starts_with(".tmp"))
.is_some_and(|name| name.starts_with(".tmp"))
}
/// A file lock that is automatically released when dropped.
@ -588,7 +588,7 @@ impl LockedFile {
impl Drop for LockedFile {
fn drop(&mut self) {
if let Err(err) = self.0.file().unlock() {
if let Err(err) = fs2::FileExt::unlock(self.0.file()) {
error!(
"Failed to unlock {}; program may be stuck: {}",
self.0.path().display(),

View file

@ -34,7 +34,7 @@ fn get_script_launcher(entry_point: &Script, shebang: &str) -> String {
let import_name = entry_point.import_name();
format!(
r##"{shebang}
r#"{shebang}
# -*- coding: utf-8 -*-
import re
import sys
@ -42,7 +42,7 @@ from {module} import {import_name}
if __name__ == "__main__":
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
sys.exit({function}())
"##
"#
)
}

View file

@ -930,12 +930,12 @@ fn parse_pep508_requirement<T: Pep508Url>(
if let Some((pos, char)) = cursor.next().filter(|(_, c)| *c != '#') {
let message = if char == '#' {
format!(
r#"Expected end of input or `;`, found `{char}`; comments must be preceded by a leading space"#
r"Expected end of input or `;`, found `{char}`; comments must be preceded by a leading space"
)
} else if marker.is_none() {
format!(r#"Expected end of input or `;`, found `{char}`"#)
format!(r"Expected end of input or `;`, found `{char}`")
} else {
format!(r#"Expected end of input, found `{char}`"#)
format!(r"Expected end of input, found `{char}`")
};
return Err(Pep508Error {
message: Pep508ErrorSource::String(message),

View file

@ -176,12 +176,12 @@ fn parse_unnamed_requirement<Url: UnnamedRequirementUrl>(
if let Some((pos, char)) = cursor.next() {
let message = if char == '#' {
format!(
r#"Expected end of input or `;`, found `{char}`; comments must be preceded by a leading space"#
r"Expected end of input or `;`, found `{char}`; comments must be preceded by a leading space"
)
} else if marker.is_none() {
format!(r#"Expected end of input or `;`, found `{char}`"#)
format!(r"Expected end of input or `;`, found `{char}`")
} else {
format!(r#"Expected end of input, found `{char}`"#)
format!(r"Expected end of input, found `{char}`")
};
return Err(Pep508Error {
message: Pep508ErrorSource::String(message),

View file

@ -406,7 +406,7 @@ pub fn looks_like_git_repository(url: &Url) -> bool {
.map_or(true, |ext| ext.eq_ignore_ascii_case("git"))
&& url
.path_segments()
.map_or(false, |segments| segments.count() == 2)
.is_some_and(|segments| segments.count() == 2)
}
/// Split the fragment from a URL.

View file

@ -1154,7 +1154,7 @@ pub(crate) fn is_windows_store_shim(path: &Path) -> bool {
component.starts_with("python")
&& std::path::Path::new(component)
.extension()
.map_or(false, |ext| ext.eq_ignore_ascii_case("exe"))
.is_some_and(|ext| ext.eq_ignore_ascii_case("exe"))
})
{
return false;

View file

@ -78,12 +78,12 @@ impl PythonInstallation {
/// Find or fetch a [`PythonInstallation`].
///
/// Unlike [`PythonInstallation::find`], if the required Python is not installed it will be installed automatically.
pub async fn find_or_download<'a>(
pub async fn find_or_download(
request: Option<&PythonRequest>,
environments: EnvironmentPreference,
preference: PythonPreference,
python_downloads: PythonDownloads,
client_builder: &BaseClientBuilder<'a>,
client_builder: &BaseClientBuilder<'_>,
cache: &Cache,
reporter: Option<&dyn Reporter>,
python_install_mirror: Option<&str>,
@ -127,9 +127,9 @@ impl PythonInstallation {
}
/// Download and install the requested installation.
pub async fn fetch<'a>(
pub async fn fetch(
request: PythonDownloadRequest,
client_builder: &BaseClientBuilder<'a>,
client_builder: &BaseClientBuilder<'_>,
cache: &Cache,
reporter: Option<&dyn Reporter>,
python_install_mirror: Option<&str>,

View file

@ -894,10 +894,10 @@ mod tests {
fs::write(
&mocked_interpreter,
formatdoc! {r##"
formatdoc! {r"
#!/bin/bash
echo '{json}'
"##},
"},
)
.unwrap();
@ -913,10 +913,10 @@ mod tests {
);
fs::write(
&mocked_interpreter,
formatdoc! {r##"
formatdoc! {r"
#!/bin/bash
echo '{}'
"##, json.replace("3.12", "3.13")},
", json.replace("3.12", "3.13")},
)
.unwrap();
let interpreter = Interpreter::query(&mocked_interpreter, &cache).unwrap();

View file

@ -282,10 +282,10 @@ mod tests {
fs_err::create_dir_all(path.parent().unwrap())?;
fs_err::write(
path,
formatdoc! {r##"
formatdoc! {r"
#!/bin/bash
echo '{json}'
"##},
"},
)?;
fs_err::set_permissions(path, std::os::unix::fs::PermissionsExt::from_mode(0o770))?;
@ -304,10 +304,10 @@ mod tests {
fs_err::write(
path,
formatdoc! {r##"
formatdoc! {r"
#!/bin/bash
echo '{output}' 1>&2
"##},
"},
)?;
fs_err::set_permissions(path, std::os::unix::fs::PermissionsExt::from_mode(0o770))?;
@ -525,10 +525,10 @@ mod tests {
#[cfg(unix)]
fs_err::write(
children[0].join(format!("python{}", env::consts::EXE_SUFFIX)),
formatdoc! {r##"
formatdoc! {r"
#!/bin/bash
echo 'foo'
"##},
"},
)?;
fs_err::set_permissions(
children[0].join(format!("python{}", env::consts::EXE_SUFFIX)),

View file

@ -953,7 +953,7 @@ impl Lock {
.ok()
.flatten()
.map(|package| matches!(package.id.source, Source::Virtual(_)));
if actual.map_or(true, |actual| actual != expected) {
if actual != Some(expected) {
return Ok(SatisfiesResult::MismatchedSources(name.clone(), expected));
}
}
@ -973,7 +973,7 @@ impl Lock {
.ok()
.flatten()
.map(|package| &package.id.version);
if actual.map_or(true, |actual| actual != expected) {
if actual != Some(expected) {
return Ok(SatisfiesResult::MismatchedVersion(
name.clone(),
expected.clone(),

View file

@ -145,7 +145,7 @@ impl<'a, Context: BuildContext> DefaultResolverProvider<'a, Context> {
}
}
impl<'a, Context: BuildContext> ResolverProvider for DefaultResolverProvider<'a, Context> {
impl<Context: BuildContext> ResolverProvider for DefaultResolverProvider<'_, Context> {
/// Make a "Simple API" request for the package and convert the result to a [`VersionMap`].
async fn get_package_versions<'io>(
&'io self,

View file

@ -55,6 +55,6 @@ impl AllowedYanks {
pub fn contains(&self, package_name: &PackageName, version: &Version) -> bool {
self.0
.get(package_name)
.map_or(false, |versions| versions.contains(version))
.is_some_and(|versions| versions.contains(version))
}
}

View file

@ -205,10 +205,10 @@ impl Pep723Script {
let metadata = serialize_metadata(&default_metadata);
let script = if let Some(existing_contents) = existing_contents {
indoc::formatdoc! {r#"
indoc::formatdoc! {r"
{metadata}
{content}
"#,
",
content = String::from_utf8(existing_contents).map_err(|err| Pep723Error::Utf8(err.utf8_error()))?}
} else {
indoc::formatdoc! {r#"

View file

@ -268,7 +268,7 @@ pub fn windows_script_launcher(
launcher.extend_from_slice(&payload);
launcher.extend_from_slice(python_path.as_bytes());
launcher.extend_from_slice(
&u32::try_from(python_path.as_bytes().len())
&u32::try_from(python_path.len())
.expect("file path should be smaller than 4GB")
.to_le_bytes(),
);
@ -300,7 +300,7 @@ pub fn windows_python_launcher(
launcher.extend_from_slice(launcher_bin);
launcher.extend_from_slice(python_path.as_bytes());
launcher.extend_from_slice(
&u32::try_from(python_path.as_bytes().len())
&u32::try_from(python_path.len())
.expect("file path should be smaller than 4GB")
.to_le_bytes(),
);
@ -377,7 +377,7 @@ mod test {
fn get_script_launcher(shebang: &str, is_gui: bool) -> String {
if is_gui {
format!(
r##"{shebang}
r#"{shebang}
# -*- coding: utf-8 -*-
import re
import sys
@ -394,11 +394,11 @@ def make_gui() -> None:
if __name__ == "__main__":
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
sys.exit(make_gui())
"##
"#
)
} else {
format!(
r##"{shebang}
r#"{shebang}
# -*- coding: utf-8 -*-
import re
import sys
@ -412,7 +412,7 @@ def main_console() -> None:
if __name__ == "__main__":
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
sys.exit(main_console())
"##
"#
)
}
}

View file

@ -21,7 +21,7 @@ pub(crate) struct LatestClient<'env> {
pub(crate) requires_python: &'env RequiresPython,
}
impl<'env> LatestClient<'env> {
impl LatestClient<'_> {
/// Find the latest version of a package from an index.
pub(crate) async fn find_latest(
&self,

View file

@ -1006,7 +1006,7 @@ fn pyproject_build_backend_prerequisites(
if !build_file.try_exists()? {
fs_err::write(
build_file,
indoc::formatdoc! {r#"
indoc::formatdoc! {r"
cmake_minimum_required(VERSION 3.15)
project(${{SKBUILD_PROJECT_NAME}} LANGUAGES CXX)
@ -1015,7 +1015,7 @@ fn pyproject_build_backend_prerequisites(
pybind11_add_module(_core MODULE src/main.cpp)
install(TARGETS _core DESTINATION ${{SKBUILD_PROJECT_NAME}})
"#},
"},
)?;
}
}
@ -1052,21 +1052,21 @@ fn generate_package_scripts(
// Python script for binary-based packaged apps or libs
let binary_call_script = if is_lib {
indoc::formatdoc! {r#"
indoc::formatdoc! {r"
from {module_name}._core import hello_from_bin
def hello() -> str:
return hello_from_bin()
"#}
"}
} else {
indoc::formatdoc! {r#"
indoc::formatdoc! {r"
from {module_name}._core import hello_from_bin
def main() -> None:
print(hello_from_bin())
"#}
"}
};
// .pyi file for binary script

View file

@ -1117,7 +1117,7 @@ impl<'lock> EnvironmentSpecification<'lock> {
}
/// Run dependency resolution for an interpreter, returning the [`ResolverOutput`].
pub(crate) async fn resolve_environment<'a>(
pub(crate) async fn resolve_environment(
spec: EnvironmentSpecification<'_>,
interpreter: &Interpreter,
settings: ResolverSettingsRef<'_>,

View file

@ -1535,8 +1535,8 @@ impl RunCommand {
}
let metadata = target_path.metadata();
let is_file = metadata.as_ref().map_or(false, std::fs::Metadata::is_file);
let is_dir = metadata.as_ref().map_or(false, std::fs::Metadata::is_dir);
let is_file = metadata.as_ref().is_ok_and(std::fs::Metadata::is_file);
let is_dir = metadata.as_ref().is_ok_and(std::fs::Metadata::is_dir);
if target.eq_ignore_ascii_case("python") {
Ok(Self::Python(args.to_vec()))
@ -1569,9 +1569,7 @@ impl RunCommand {
fn is_python_zipapp(target: &Path) -> bool {
if let Ok(file) = fs_err::File::open(target) {
if let Ok(mut archive) = zip::ZipArchive::new(file) {
return archive
.by_name("__main__.py")
.map_or(false, |f| f.is_file());
return archive.by_name("__main__.py").is_ok_and(|f| f.is_file());
}
}
false

View file

@ -922,7 +922,7 @@ impl TestContext {
/// For when we add pypy to the test suite.
#[allow(clippy::unused_self)]
pub fn python_kind(&self) -> &str {
pub fn python_kind(&self) -> &'static str {
"python"
}

View file

@ -6859,10 +6859,10 @@ dependencies = [
// Write to a requirements file.
let requirements_in = context.temp_dir.child("requirements.in");
requirements_in.write_str(&indoc::formatdoc! {r#"
requirements_in.write_str(&indoc::formatdoc! {r"
-e {}
-e {}
"#,
",
editable_dir1.path().display(),
editable_dir2.path().display()
})?;

View file

@ -7077,10 +7077,10 @@ fn local_index_requirements_txt_absolute() -> Result<()> {
"#, Url::from_directory_path(context.workspace_root.join("scripts/links/")).unwrap().as_str()})?;
let requirements_txt = context.temp_dir.child("requirements.txt");
requirements_txt.write_str(&indoc::formatdoc! {r#"
requirements_txt.write_str(&indoc::formatdoc! {r"
--index-url {}
tqdm
"#, Url::from_directory_path(root).unwrap().as_str()})?;
", Url::from_directory_path(root).unwrap().as_str()})?;
uv_snapshot!(context.filters(), context.pip_install()
.env_remove(EnvVars::UV_EXCLUDE_NEWER)

View file

@ -1,2 +1,2 @@
[toolchain]
channel = "1.83"
channel = "1.84"