Skip to content

Commit 5afedf5

Browse files
Update to Rust stable 1.84.1 (#7625)
Ref paritytech/ci_cd#1107 We mainly need that so that we can finally compile the `pallet_revive` fixtures on stable. I did my best to keep the commits focused on one thing to make review easier. All the changes are needed because rustc introduced more warnings or is more strict about existing ones. Most of the stuff could just be fixed and the commits should be pretty self explanatory. However, there are a few this that are notable: A lot of runtimes to write `impl` blocks inside functions. This makes sense to reduce the amount of conditional compilation. I guess I could have moved them into a module instead. But I think allowing it here makes sense to avoid the code churn. The FRAME macros emit code that references various features like `std`, `runtime-benchmarks` or `try-runtime`. If a create that uses those macros does not have those features we get this warning. Those were mostly when defining a `mock` runtime. I opted for silencing the warning in this case rather than adding not needed features. For the benchmarking ui tests I opted for adding the `runtime-benchmark` feature to the `Cargo.toml`. I am bumping the `trybuild` version and regenerating the ui tests. The old version seems to be incompatible. This requires us to pass `deny_warnings` in `CARGO_ENCODED_RUSTFLAGS` as `RUSTFLAGS` is ignored in the new version. This is no longer needed since the latest stable will compile them fine using the `RUSTC_BOOTSTRAP=1`. --------- Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 8d560d7 commit 5afedf5

File tree

105 files changed

+406
-173
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+406
-173
lines changed

.github/env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
IMAGE="docker.io/paritytech/ci-unified:bullseye-1.81.0-2024-11-19-v202411281558"
1+
IMAGE="docker.io/paritytech/ci-unified:bullseye-1.84.1-2025-01-28-v202502131220"

.gitlab-ci.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ workflow:
2222

2323
variables:
2424
# CI_IMAGE: !reference [ .ci-unified, variables, CI_IMAGE ]
25-
CI_IMAGE: "docker.io/paritytech/ci-unified:bullseye-1.81.0-2024-11-19-v202411281558"
25+
CI_IMAGE: "docker.io/paritytech/ci-unified:bullseye-1.84.1-2025-01-28-v202502131220"
2626
# BUILDAH_IMAGE is defined in group variables
2727
BUILDAH_COMMAND: "buildah --storage-driver overlay2"
2828
RELENG_SCRIPTS_BRANCH: "master"
@@ -125,18 +125,18 @@ default:
125125
- cat .forklift/config-gitlab.toml > .forklift/config.toml
126126
- >
127127
if [ "$FORKLIFT_BYPASS" != "true" ]; then
128-
echo "FORKLIFT_BYPASS not set";
128+
echo "FORKLIFT_BYPASS not set";
129129
if command -v forklift >/dev/null 2>&1; then
130-
echo "forklift already exists";
130+
echo "forklift already exists";
131131
forklift version
132132
else
133133
echo "forklift does not exist, downloading";
134-
curl --header "PRIVATE-TOKEN: $FL_CI_GROUP_TOKEN" -o forklift -L "${CI_API_V4_URL}/projects/676/packages/generic/forklift/${FL_FORKLIFT_VERSION}/forklift_${FL_FORKLIFT_VERSION}_linux_amd64";
134+
curl --header "PRIVATE-TOKEN: $FL_CI_GROUP_TOKEN" -o forklift -L "${CI_API_V4_URL}/projects/676/packages/generic/forklift/${FL_FORKLIFT_VERSION}/forklift_${FL_FORKLIFT_VERSION}_linux_amd64";
135135
chmod +x forklift;
136136
export PATH=$PATH:$(pwd);
137137
echo ${FL_FORKLIFT_VERSION};
138138
fi
139-
echo "Creating alias cargo='forklift cargo'";
139+
echo "Creating alias cargo='forklift cargo'";
140140
shopt -s expand_aliases;
141141
alias cargo="forklift cargo";
142142
fi

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ trie-bench = { version = "0.40.0" }
13981398
trie-db = { version = "0.30.0", default-features = false }
13991399
trie-root = { version = "0.18.0", default-features = false }
14001400
trie-standardmap = { version = "0.16.0" }
1401-
trybuild = { version = "1.0.89" }
1401+
trybuild = { version = "1.0.103" }
14021402
tt-call = { version = "1.0.8" }
14031403
tuplex = { version = "0.1", default-features = false }
14041404
twox-hash = { version = "1.6.3", default-features = false }

bridges/modules/grandpa/src/lib.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -789,12 +789,9 @@ where
789789
pub fn synced_headers_grandpa_info() -> Vec<StoredHeaderGrandpaInfo<BridgedHeader<T, I>>> {
790790
frame_system::Pallet::<T>::read_events_no_consensus()
791791
.filter_map(|event| {
792-
if let Event::<T, I>::UpdatedBestFinalizedHeader { grandpa_info, .. } =
793-
event.event.try_into().ok()?
794-
{
795-
return Some(grandpa_info)
796-
}
797-
None
792+
let Event::<T, I>::UpdatedBestFinalizedHeader { grandpa_info, .. } =
793+
event.event.try_into().ok()?;
794+
Some(grandpa_info)
798795
})
799796
.collect()
800797
}

bridges/primitives/test-utils/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub fn make_justification_for_header<H: HeaderT>(
110110
);
111111

112112
// Roughly, how many vote ancestries do we want per fork
113-
let target_depth = (ancestors + forks - 1) / forks;
113+
let target_depth = ancestors.div_ceil(forks);
114114

115115
let mut unsigned_precommits = vec![];
116116
for i in 0..forks {

bridges/relays/lib-substrate-relay/src/messages/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,7 @@ mod tests {
820820
}
821821

822822
// mock runtime with `pallet_bridge_messages`
823+
#[allow(unexpected_cfgs)]
823824
mod mock {
824825
use super::super::*;
825826
use bp_messages::{target_chain::ForbidInboundMessages, HashedLaneId};

cumulus/parachains/runtimes/assets/asset-hub-rococo/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,6 +1685,7 @@ impl_runtime_apis! {
16851685
(list, storage_info)
16861686
}
16871687

1688+
#[allow(non_local_definitions)]
16881689
fn dispatch_benchmark(
16891690
config: frame_benchmarking::BenchmarkConfig
16901691
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, alloc::string::String> {

cumulus/parachains/runtimes/assets/asset-hub-westend/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1886,6 +1886,7 @@ impl_runtime_apis! {
18861886
(list, storage_info)
18871887
}
18881888

1889+
#[allow(non_local_definitions)]
18891890
fn dispatch_benchmark(
18901891
config: frame_benchmarking::BenchmarkConfig
18911892
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, alloc::string::String> {

cumulus/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,7 @@ impl_runtime_apis! {
10881088
(list, storage_info)
10891089
}
10901090

1091+
#[allow(non_local_definitions)]
10911092
fn dispatch_benchmark(
10921093
config: frame_benchmarking::BenchmarkConfig
10931094
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, alloc::string::String> {

cumulus/parachains/runtimes/bridge-hubs/bridge-hub-westend/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,6 +1004,7 @@ impl_runtime_apis! {
10041004
(list, storage_info)
10051005
}
10061006

1007+
#[allow(non_local_definitions)]
10071008
fn dispatch_benchmark(
10081009
config: frame_benchmarking::BenchmarkConfig
10091010
) -> Result<Vec<frame_benchmarking::BenchmarkBatch>, alloc::string::String> {

0 commit comments

Comments
 (0)