Skip to content

Commit 629ea89

Browse files
committed
Update Rust to nightly-2024-12-22
1 parent e3efab0 commit 629ea89

File tree

19 files changed

+40
-20
lines changed

19 files changed

+40
-20
lines changed

crates/sc-subspace-block-relay/src/consensus/relay.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ where
246246
who: PeerId,
247247
request: BlockRequest<Block>,
248248
) -> Result<Result<(Vec<u8>, ProtocolName), RequestFailure>, oneshot::Canceled> {
249-
let full_download = request.max.map_or(false, |max_blocks| max_blocks > 1);
249+
let full_download = request.max.is_some_and(|max_blocks| max_blocks > 1);
250250
let ret = if full_download {
251251
self.full_download(who, request.clone()).await
252252
} else {

crates/sp-domains-fraud-proof/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
//! Subspace fraud proof primitives for consensus chain.
1818
#![cfg_attr(not(feature = "std"), no_std)]
19+
// `generic_const_exprs` is an incomplete feature
20+
#![allow(incomplete_features)]
21+
// TODO: This feature is not actually used in this crate, but is added as a workaround for
22+
// https://github.com/rust-lang/rust/issues/133199
23+
#![feature(generic_const_exprs)]
1924
#![feature(associated_type_defaults)]
2025

2126
#[cfg(feature = "std")]

crates/subspace-archiving/src/archiver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ impl Archiver {
527527
let continuation_object_mapping = BlockObjectMapping::V0 {
528528
objects: object_mapping
529529
.objects_mut()
530-
.extract_if(|block_object: &mut BlockObject| {
530+
.extract_if(.., |block_object: &mut BlockObject| {
531531
if block_object.offset >= split_point as u32 {
532532
block_object.offset -= split_point as u32;
533533
true
@@ -570,7 +570,7 @@ impl Archiver {
570570
let continuation_object_mapping = BlockObjectMapping::V0 {
571571
objects: object_mapping
572572
.objects_mut()
573-
.extract_if(|block_object: &mut BlockObject| {
573+
.extract_if(.., |block_object: &mut BlockObject| {
574574
if block_object.offset >= split_point as u32 {
575575
block_object.offset -= split_point as u32;
576576
true

crates/subspace-core-primitives/src/pieces.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ pub struct PieceIndex(u64);
6363

6464
impl Step for PieceIndex {
6565
#[inline]
66-
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
66+
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
6767
u64::steps_between(&start.0, &end.0)
6868
}
6969

@@ -206,7 +206,7 @@ pub struct PieceOffset(u16);
206206

207207
impl Step for PieceOffset {
208208
#[inline]
209-
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
209+
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
210210
u16::steps_between(&start.0, &end.0)
211211
}
212212

crates/subspace-core-primitives/src/sectors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ pub struct SBucket(u16);
198198

199199
impl Step for SBucket {
200200
#[inline]
201-
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
201+
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
202202
u16::steps_between(&start.0, &end.0)
203203
}
204204

crates/subspace-core-primitives/src/segments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub struct SegmentIndex(u64);
5858

5959
impl Step for SegmentIndex {
6060
#[inline]
61-
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
61+
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
6262
u64::steps_between(&start.0, &end.0)
6363
}
6464

crates/subspace-farmer/src/cluster/controller/caches.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl KnownCaches {
8484
}
8585

8686
fn remove_expired(&mut self) -> impl Iterator<Item = KnownCache> + '_ {
87-
self.known_caches.extract_if(|known_cache| {
87+
self.known_caches.extract_if(.., |known_cache| {
8888
known_cache.last_identification.elapsed() > self.identification_broadcast_interval * 2
8989
})
9090
}

crates/subspace-proof-of-space/src/chiapos/table/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub(in super::super) struct X(u32);
1313

1414
impl Step for X {
1515
#[inline(always)]
16-
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
16+
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
1717
u32::steps_between(&start.0, &end.0)
1818
}
1919

@@ -89,7 +89,7 @@ pub(in super::super) struct Position(u32);
8989

9090
impl Step for Position {
9191
#[inline(always)]
92-
fn steps_between(start: &Self, end: &Self) -> Option<usize> {
92+
fn steps_between(start: &Self, end: &Self) -> (usize, Option<usize>) {
9393
u32::steps_between(&start.0, &end.0)
9494
}
9595

crates/subspace-runtime/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
#![cfg_attr(not(feature = "std"), no_std)]
1818
#![feature(const_trait_impl, variant_count)]
19+
// `generic_const_exprs` is an incomplete feature
20+
#![allow(incomplete_features)]
21+
// TODO: This feature is not actually used in this crate, but is added as a workaround for
22+
// https://github.com/rust-lang/rust/issues/133199
23+
#![feature(generic_const_exprs)]
1924
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
2025
#![recursion_limit = "256"]
2126
// TODO: remove when upstream issue is fixed

crates/subspace-verification/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@
1818
#![forbid(unsafe_code)]
1919
#![warn(rust_2018_idioms, missing_debug_implementations, missing_docs)]
2020
#![feature(array_chunks, portable_simd)]
21+
// `generic_const_exprs` is an incomplete feature
22+
#![allow(incomplete_features)]
23+
// TODO: This feature is not actually used in this crate, but is added as a workaround for
24+
// https://github.com/rust-lang/rust/issues/133199
25+
#![feature(generic_const_exprs)]
2126
#![cfg_attr(not(feature = "std"), no_std)]
2227

2328
#[cfg(not(feature = "std"))]

docker/bootstrap-node.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This Dockerfile supports both native building and cross-compilation to x86-64, aarch64 and riscv64
22
FROM --platform=$BUILDPLATFORM ubuntu:22.04
33

4-
ARG RUSTC_VERSION=nightly-2024-10-22
4+
ARG RUSTC_VERSION=nightly-2024-12-24
55
ARG PROFILE=production
66
ARG RUSTFLAGS
77
# Incremental compilation here isn't helpful

docker/farmer.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This Dockerfile supports both native building and cross-compilation to x86-64, aarch64 and riscv64
22
FROM --platform=$BUILDPLATFORM ubuntu:22.04
33

4-
ARG RUSTC_VERSION=nightly-2024-10-22
4+
ARG RUSTC_VERSION=nightly-2024-12-24
55
ARG PROFILE=production
66
ARG RUSTFLAGS
77
# Incremental compilation here isn't helpful

docker/gateway.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This Dockerfile supports both native building and cross-compilation to x86-64, aarch64 and riscv64
22
FROM --platform=$BUILDPLATFORM ubuntu:22.04
33

4-
ARG RUSTC_VERSION=nightly-2024-10-22
4+
ARG RUSTC_VERSION=nightly-2024-12-24
55
ARG PROFILE=production
66
ARG RUSTFLAGS
77
# Incremental compilation here isn't helpful

docker/node.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This Dockerfile supports both native building and cross-compilation to x86-64, aarch64 and riscv64
22
FROM --platform=$BUILDPLATFORM ubuntu:22.04
33

4-
ARG RUSTC_VERSION=nightly-2024-10-22
4+
ARG RUSTC_VERSION=nightly-2024-12-24
55
ARG PROFILE=production
66
ARG RUSTFLAGS
77
# Incremental compilation here isn't helpful

docker/runtime.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This Dockerfile supports both native building and cross-compilation to x86-64, aarch64 and riscv64
22
FROM --platform=$BUILDPLATFORM ubuntu:22.04
33

4-
ARG RUSTC_VERSION=nightly-2024-10-22
4+
ARG RUSTC_VERSION=nightly-2024-12-24
55
ARG PROFILE=production
66
ARG RUSTFLAGS
77
# Incremental compilation here isn't helpful

domains/client/domain-operator/src/fraud_proof.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ where
560560

561561
let proof_data = if invalid_type
562562
.extrinsic_index()
563-
.map_or(false, |idx| bundle.extrinsics.len() as u32 <= idx)
563+
.is_some_and(|idx| bundle.extrinsics.len() as u32 <= idx)
564564
{
565565
// The bad receipt claims a non-exist extrinsic is invalid, in this case, generate a
566566
// `bundle_with_proof` as proof data is enough

domains/pallets/auto-id/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ impl<T: Config> Pallet<T> {
439439
);
440440

441441
ensure!(
442-
!CertificateRevocationList::<T>::get(issuer_id).map_or(false, |serials| {
442+
!CertificateRevocationList::<T>::get(issuer_id).is_some_and(|serials| {
443443
serials.iter().any(|s| {
444444
*s == issuer_auto_id.certificate.serial()
445445
|| *s == tbs_certificate.serial
@@ -517,7 +517,7 @@ impl<T: Config> Pallet<T> {
517517
Error::<T>::ExpiredCertificate
518518
);
519519
ensure!(
520-
!CertificateRevocationList::<T>::get(issuer_id).map_or(false, |serials| {
520+
!CertificateRevocationList::<T>::get(issuer_id).is_some_and(|serials| {
521521
serials.iter().any(|s| {
522522
*s == issuer_auto_id.certificate.serial()
523523
|| *s == tbs_certificate.serial
@@ -627,7 +627,7 @@ impl<T: Config> Pallet<T> {
627627
};
628628

629629
ensure!(
630-
!CertificateRevocationList::<T>::get(issuer_id).map_or(false, |serials| {
630+
!CertificateRevocationList::<T>::get(issuer_id).is_some_and(|serials| {
631631
serials.iter().any(|s| {
632632
*s == auto_id.certificate.serial() || *s == issuer_auto_id.certificate.serial()
633633
})

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
2-
channel = "nightly-2024-10-22"
2+
channel = "nightly-2024-12-24"
33
components = ["rust-src"]
44
targets = ["wasm32-unknown-unknown"]
55
profile = "default"

test/subspace-test-runtime/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616

1717
#![cfg_attr(not(feature = "std"), no_std)]
1818
#![feature(variant_count)]
19+
// `generic_const_exprs` is an incomplete feature
20+
#![allow(incomplete_features)]
21+
// TODO: This feature is not actually used in this crate, but is added as a workaround for
22+
// https://github.com/rust-lang/rust/issues/133199
23+
#![feature(generic_const_exprs)]
1924
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
2025
#![recursion_limit = "256"]
2126
// TODO: remove when upstream issue is fixed

0 commit comments

Comments
 (0)