Skip to content

Commit ae25c2f

Browse files
authored
Upgrade minimum Rust version to 1.83 (#9815)
This reverts commit 6cc7a56 to reapply #9511 since we've disabled ppc64le-musl per #9793
1 parent f64da9b commit ae25c2f

File tree

31 files changed

+72
-65
lines changed

31 files changed

+72
-65
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ resolver = "2"
1313

1414
[workspace.package]
1515
edition = "2021"
16-
rust-version = "1.81"
16+
rust-version = "1.83"
1717
homepage = "https://pypi.org/project/uv/"
1818
documentation = "https://pypi.org/project/uv/"
1919
repository = "https://github.com/astral-sh/uv"

crates/uv-cache/src/wheel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub enum WheelCache<'a> {
2323
Git(&'a Url, &'a str),
2424
}
2525

26-
impl<'a> WheelCache<'a> {
26+
impl WheelCache<'_> {
2727
/// The root directory for a cache bucket.
2828
pub fn root(&self) -> PathBuf {
2929
match self {

crates/uv-client/src/httpcache/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,7 @@ impl ArchivedCachePolicy {
992992
/// This dictates what the caller should do next by indicating whether the
993993
/// cached response is stale or not.
994994
#[derive(Debug)]
995+
#[allow(clippy::large_enum_variant)]
995996
pub enum BeforeRequest {
996997
/// The cached response is still fresh, and the caller may return the
997998
/// cached response without issuing an HTTP requests.

crates/uv-client/src/remote_metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub(crate) async fn wheel_metadata_from_remote_zip(
8585
// The zip archive uses as BufReader which reads in chunks of 8192. To ensure we prefetch
8686
// enough data we round the size up to the nearest multiple of the buffer size.
8787
let buffer_size = 8192;
88-
let size = ((size + buffer_size - 1) / buffer_size) * buffer_size;
88+
let size = size.div_ceil(buffer_size) * buffer_size;
8989

9090
// Fetch the bytes from the zip archive that contain the requested file.
9191
reader

crates/uv-configuration/src/name_specifiers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ impl<'de> serde::Deserialize<'de> for PackageNameSpecifier {
3131
{
3232
struct Visitor;
3333

34-
impl<'de> serde::de::Visitor<'de> for Visitor {
34+
impl serde::de::Visitor<'_> for Visitor {
3535
type Value = PackageNameSpecifier;
3636

3737
fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {

crates/uv-distribution-types/src/buildable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub enum SourceUrl<'a> {
9393
Directory(DirectorySourceUrl<'a>),
9494
}
9595

96-
impl<'a> SourceUrl<'a> {
96+
impl SourceUrl<'_> {
9797
/// Return the [`Url`] of the source.
9898
pub fn url(&self) -> &Url {
9999
match self {

crates/uv-distribution-types/src/hash.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub enum HashPolicy<'a> {
1111
Validate(&'a [HashDigest]),
1212
}
1313

14-
impl<'a> HashPolicy<'a> {
14+
impl HashPolicy<'_> {
1515
/// Returns `true` if the hash policy is `None`.
1616
pub fn is_none(&self) -> bool {
1717
matches!(self, Self::None)

crates/uv-distribution-types/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub enum VersionOrUrlRef<'a, T: Pep508Url = VerbatimUrl> {
103103
Url(&'a T),
104104
}
105105

106-
impl<'a, T: Pep508Url> VersionOrUrlRef<'a, T> {
106+
impl<T: Pep508Url> VersionOrUrlRef<'_, T> {
107107
/// If it is a URL, return its value.
108108
pub fn url(&self) -> Option<&T> {
109109
match self {
@@ -140,7 +140,7 @@ pub enum InstalledVersion<'a> {
140140
Url(&'a Url, &'a Version),
141141
}
142142

143-
impl<'a> InstalledVersion<'a> {
143+
impl InstalledVersion<'_> {
144144
/// If it is a URL, return its value.
145145
pub fn url(&self) -> Option<&Url> {
146146
match self {

crates/uv-distribution/src/metadata/lowering.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl LoweredRequirement {
8484
if workspace.packages().contains_key(&requirement.name) {
8585
// And it's not a recursive self-inclusion (extras that activate other extras), e.g.
8686
// `framework[machine_learning]` depends on `framework[cuda]`.
87-
if !project_name.is_some_and(|project_name| *project_name == requirement.name) {
87+
if project_name.is_none_or(|project_name| *project_name != requirement.name) {
8888
// It must be declared as a workspace source.
8989
let Some(sources) = sources.as_ref() else {
9090
// No sources were declared for the workspace package.
@@ -141,7 +141,7 @@ impl LoweredRequirement {
141141
// Support recursive editable inclusions.
142142
if has_sources
143143
&& requirement.version_or_url.is_none()
144-
&& !project_name.is_some_and(|project_name| *project_name == requirement.name)
144+
&& project_name.is_none_or(|project_name| *project_name != requirement.name)
145145
{
146146
warn_user_once!(
147147
"Missing version constraint (e.g., a lower bound) for `{}`",

crates/uv-distribution/src/source/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
17551755
.map_err(Error::CacheWrite)?;
17561756
if let Err(err) = rename_with_retry(extracted, target).await {
17571757
// If the directory already exists, accept it.
1758-
if target.is_dir() {
1758+
if err.kind() == std::io::ErrorKind::AlreadyExists {
17591759
warn!("Directory already exists: {}", target.display());
17601760
} else {
17611761
return Err(Error::CacheWrite(err));
@@ -1816,7 +1816,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
18161816
.map_err(Error::CacheWrite)?;
18171817
if let Err(err) = rename_with_retry(extracted, target).await {
18181818
// If the directory already exists, accept it.
1819-
if target.is_dir() {
1819+
if err.kind() == std::io::ErrorKind::AlreadyExists {
18201820
warn!("Directory already exists: {}", target.display());
18211821
} else {
18221822
return Err(Error::CacheWrite(err));

0 commit comments

Comments
 (0)