Skip to content

Commit 4e66976

Browse files
bors[bot]Bromeon
andauthored
Merge #871
871: Rust 2021 Edition r=Bromeon a=Bromeon Updates edition to 2021 and MSRV to 1.56. Adjusts CI accordingly. bors try Co-authored-by: Jan Haller <bromeon@gmail.com>
2 parents 5e58f6b + 86ccc88 commit 4e66976

File tree

32 files changed

+56
-45
lines changed

32 files changed

+56
-45
lines changed

.github/workflows/full-ci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ env:
3434
# Note: using variables is limited at the moment, see https://github.com/actions/runner/issues/480
3535
GDRUST_FEATURES: "gdnative/async,gdnative/serde"
3636
CARGO_DENY_VERSION: "0.11.0"
37+
CARGO_DINGHY_VERSION: "0.4.68"
3738

3839
on:
3940
push:
@@ -121,7 +122,7 @@ jobs:
121122
- rust: { toolchain: 'nightly' }
122123
testflags: '-- --skip ui_tests'
123124
- os: { id: ubuntu-latest, name: linux }
124-
rust: { toolchain: '1.51', postfix: ' (msrv 1.51)' }
125+
rust: { toolchain: '1.56', postfix: ' (msrv 1.56)' }
125126
testflags: '-- --skip ui_tests'
126127
- os: { id: ubuntu-latest, name: linux }
127128
rust: { toolchain: 'stable', postfix: ' (minimal-deps)', special: 'minimal-deps' }
@@ -194,10 +195,10 @@ jobs:
194195
- name: "Install cargo-dinghy"
195196
run: |
196197
rustup target add x86_64-apple-ios
197-
curl -L https://github.com/sonos/dinghy/releases/download/0.4.62/cargo-dinghy-macos-0.4.62.tgz -o cargo-dinghy-macos.tar.gz
198+
curl -L https://github.com/sonos/dinghy/releases/download/$CARGO_DINGHY_VERSION/cargo-dinghy-macos-$CARGO_DINGHY_VERSION.tgz -o cargo-dinghy-macos.tar.gz
198199
tar -zxvf cargo-dinghy-macos.tar.gz
199200
mkdir -p $HOME/.cargo/bin
200-
cp cargo-dinghy-0.4.62/cargo-dinghy $HOME/.cargo/bin
201+
cp cargo-dinghy-$CARGO_DINGHY_VERSION/cargo-dinghy $HOME/.cargo/bin
201202
- name: "Cross-compile to iOS"
202203
run: |
203204
RUNTIME_ID=$(xcrun simctl list runtimes | grep iOS | cut -d ' ' -f 7 | tail -1)
@@ -253,9 +254,9 @@ jobs:
253254
- rust: nightly
254255
godot: "3.4.1"
255256
postfix: ' (nightly)'
256-
- rust: '1.51'
257+
- rust: '1.56'
257258
godot: "3.4.1"
258-
postfix: ' (msrv 1.51)'
259+
postfix: ' (msrv 1.56)'
259260

260261
# Test with oldest supported engine version
261262
- rust: stable

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4343

4444
### Changed
4545

46-
- MSRV is now 1.51 ([#833](https://github.com/godot-rust/godot-rust/pull/833))
46+
- MSRV is now 1.56 ([#833](https://github.com/godot-rust/godot-rust/pull/833), [#870](https://github.com/godot-rust/godot-rust/pull/870))
47+
- Rust edition is now 2021 ([#870](https://github.com/godot-rust/godot-rust/pull/870))
4748
- `euclid` vector library replaced with `glam`, no longer part of public API ([#713](https://github.com/godot-rust/godot-rust/pull/713))
4849
- `Variant` has now a redesigned conversion API ([#819](https://github.com/godot-rust/godot-rust/pull/819))
4950
- Type renames (815, 828)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
The bindings cover most of the exposed API of Godot 3.4, and are being used on a number of projects in development, but we still expect non-trivial breaking changes in the API in the coming releases. godot-rust adheres to [Cargo's semantic versioning](https://doc.rust-lang.org/cargo/reference/semver.html).
1616

17+
Minimum supported Rust version (MSRV) is **1.56**.
18+
1719
## Engine compatibility
1820

1921
We are committed to keeping compatibility with the latest stable patch releases of all minor versions of the engine, starting from Godot 3.2:

bindings-generator/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ homepage = "https://godot-rust.github.io/"
88
license = "MIT"
99
version = "0.10.0-rc.0"
1010
workspace = ".."
11-
edition = "2018"
11+
edition = "2021"
12+
rust-version = "1.56"
1213

1314
[features]
1415
debug = []

bindings-generator/src/classes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub(crate) fn generate_class_constants(class: &GodotClass) -> TokenStream {
7676
class.constants.iter().collect();
7777
class_constants.sort_by(constant_sorter);
7878

79-
for (name, value) in &class_constants {
79+
for (name, value) in class_constants {
8080
let name = format_ident!("{}", name);
8181
let constant = quote! {
8282
pub const #name: i64 = #value;

bindings-generator/src/godot_version.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ fn test_godot_versions() {
5454
];
5555

5656
// From Rust 1.56: 'for (...) in good_versions'
57-
for (full, major, minor, patch, stability) in good_versions.iter().cloned() {
57+
for (full, major, minor, patch, stability) in good_versions {
5858
let parsed: GodotVersion = parse_godot_version(full).unwrap();
5959
assert_eq!(parsed.major, major);
6060
assert_eq!(parsed.minor, minor);
6161
assert_eq!(parsed.patch, patch);
6262
assert_eq!(parsed.stability, stability);
6363
}
6464

65-
for full in bad_versions.iter() {
65+
for full in bad_versions {
6666
let parsed = parse_godot_version(full);
6767
assert!(parsed.is_err());
6868
}

bindings-generator/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ pub(crate) mod test_prelude {
225225

226226
let api = Api::new(include_str!("../../gdnative-bindings/api.json"));
227227
let mut buffer = BufWriter::new(Vec::with_capacity(16384));
228-
for class in &api.classes {
228+
for class in api.classes {
229229
let mut icalls = HashMap::new();
230230

231231
let code = generate_module_doc(&class);

examples/array-export/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
name = "array_export"
33
version = "0.1.0"
44
authors = ["The godot-rust developers"]
5-
edition = "2018"
5+
edition = "2021"
6+
rust-version = "1.56"
67
license = "MIT"
78
publish = false
89

examples/dodge-the-creeps/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name = "dodge_the_creeps"
33
version = "0.1.0"
44
authors = ["The godot-rust developers"]
55
publish = false
6-
edition = "2018"
6+
edition = "2021"
7+
rust-version = "1.56"
78
license = "MIT"
89

910
[lib]

examples/hello-world/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ name = "hello_world"
33
version = "0.1.0"
44
authors = ["The godot-rust developers"]
55
publish = false
6-
edition = "2018"
6+
edition = "2021"
7+
rust-version = "1.56"
78
license = "MIT"
89

910
[lib]

0 commit comments

Comments
 (0)