Skip to content

Commit e2d9049

Browse files
chore: Upgrade to Rust edition 2024 (#2125)
* contract-build: Update new project and metadata templates to 2024 edition * manifests: Update edition to 2024 * rustfmt: Update edition to 2024 * manifest: Update rust-version to 1.88 * contract-build: unsafe `env::set_var` * transcode: unsafe extern * tests: unsafe `env::set_var` * Update changelog * chore: clippy fix * chore: fmt * Update `Cargo.lock`
1 parent d844358 commit e2d9049

Some content is hidden

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

69 files changed

+504
-414
lines changed

.rustfmt.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ trailing_comma = "Vertical"
4343
match_block_trailing_comma = false
4444
blank_lines_upper_bound = 1
4545
blank_lines_lower_bound = 0
46-
edition = "2021" # changed
47-
version = "One"
46+
edition = "2024" # changed
47+
style_edition = "2024"
4848
merge_derives = true
4949
use_try_shorthand = true # changed
5050
use_field_init_shorthand = true # changed
@@ -54,7 +54,7 @@ color = "Auto"
5454
unstable_features = true # changed
5555
disable_all_formatting = false
5656
skip_children = false
57-
hide_parse_errors = false
57+
show_parse_errors = true
5858
error_on_line_overflow = false
5959
error_on_unformatted = false
6060
ignore = []

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- Upgrade to `subxt` `0.44`[2127](https://github.com/use-ink/cargo-contract/pull/2127)
1111
- Synchronized with `polkadot-sdk/c40b36c3a7c208f9a6837b80812473af3d9ba7f7`[2102](https://github.com/use-ink/cargo-contract/pull/2102)
1212
- Re-enable `rustc` overflow checks - [#2116](https://github.com/use-ink/cargo-contract/pull/2116)
13+
- chore: Upgrade to Rust edition 2024 - [#2125](https://github.com/use-ink/cargo-contract/pull/2125)
1314

1415
### Removed
1516
- Removed chain extension functionality ‒ [2120](https://github.com/use-ink/cargo-contract/pull/2120)

Cargo.lock

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
[workspace]
2-
resolver = "2"
2+
resolver = "3"
33
members = ["crates/*"]
44

5+
[workspace.package]
6+
rust-version = "1.88"
7+
58
[workspace.dependencies]
69
ink_metadata = { git = "https://github.com/use-ink/ink", branch = "master", version = "6.0.0-alpha.1", default-features = false, features = ["std", "derive"] }
710
ink_env = { git = "https://github.com/use-ink/ink", branch = "master", version = "6.0.0-alpha.1", features = ["unstable-hostfn"] }

crates/analyze/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "contract-analyze"
33
version = "6.0.0-alpha.1"
44
authors = ["Use Ink <[email protected]>"]
5-
edition = "2021"
5+
edition = "2024"
66

77
license = "Apache-2.0"
88
readme = "README.md"

crates/analyze/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
#![deny(unused_crate_dependencies)]
1818

1919
use anyhow::{
20-
bail,
2120
Result,
21+
bail,
2222
};
2323
pub use contract_metadata::Language;
2424

crates/build/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "contract-build"
33
version = "6.0.0-alpha.1"
44
authors = ["Use Ink <[email protected]>"]
5-
edition = "2021"
5+
edition = "2024"
66

77
license = "Apache-2.0"
88
readme = "README.md"

crates/build/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use std::{
1919
ffi::OsStr,
2020
fs::File,
2121
io::{
22-
prelude::*,
2322
Write,
23+
prelude::*,
2424
},
2525
iter::Iterator,
2626
path::{
@@ -32,9 +32,9 @@ use std::{
3232
use anyhow::Result;
3333
use walkdir::WalkDir;
3434
use zip::{
35-
write::FileOptions,
3635
CompressionMethod,
3736
ZipWriter,
37+
write::FileOptions,
3838
};
3939

4040
const DEFAULT_UNIX_PERMISSIONS: u32 = 0o755;

crates/build/src/crate_metadata.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,10 +312,10 @@ mod tests {
312312
package_abi,
313313
};
314314
use crate::{
315-
new_contract_project,
316-
util::tests::with_tmp_dir,
317315
Abi,
318316
ManifestPath,
317+
new_contract_project,
318+
util::tests::with_tmp_dir,
319319
};
320320

321321
#[test]

crates/build/src/docker.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@
3535
use std::{
3636
cmp::Ordering,
3737
collections::{
38-
hash_map::DefaultHasher,
3938
HashMap,
39+
hash_map::DefaultHasher,
4040
},
4141
hash::{
4242
Hash,
@@ -55,6 +55,7 @@ use anyhow::{
5555
Result,
5656
};
5757
use bollard::{
58+
Docker,
5859
container::{
5960
AttachContainerOptions,
6061
AttachContainerResults,
@@ -76,7 +77,6 @@ use bollard::{
7677
Mount,
7778
MountTypeEnum,
7879
},
79-
Docker,
8080
};
8181
use contract_metadata::ContractMetadata;
8282
use tokio_stream::{
@@ -85,11 +85,11 @@ use tokio_stream::{
8585
};
8686

8787
use crate::{
88-
verbose_eprintln,
8988
BuildResult,
9089
CrateMetadata,
9190
ExecuteArgs,
9291
Verbosity,
92+
verbose_eprintln,
9393
};
9494

9595
use colored::Colorize;

0 commit comments

Comments
 (0)