Skip to content

Commit f00b523

Browse files
committed
Merge branch 'master' into feature/signals
Change ConnectFlags from enum to bitfield.
2 parents 1137114 + 5bf9f8d commit f00b523

File tree

27 files changed

+224
-84
lines changed

27 files changed

+224
-84
lines changed

.github/workflows/full-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ jobs:
104104

105105
# Note: could use `-- --no-deps` to not lint dependencies, however it doesn't really speed up and also skips deps in workspace.
106106
- name: "Check clippy"
107+
# TODO(Rust 1.86): remove -A clippy::precedence; see https://github.com/godot-rust/gdext/pull/1055.
107108
run: |
108109
cargo clippy --all-targets $CLIPPY_FEATURES -- \
109110
-D clippy::suspicious \
@@ -113,7 +114,8 @@ jobs:
113114
-D clippy::dbg_macro \
114115
-D clippy::todo \
115116
-D clippy::unimplemented \
116-
-D warnings
117+
-D warnings \
118+
-A clippy::precedence
117119
118120
unit-test:
119121
name: unit-test (${{ matrix.name }}${{ matrix.rust-special }})

.github/workflows/minimal-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ jobs:
9696
components: clippy
9797

9898
- name: "Check clippy"
99+
# TODO(Rust 1.86): remove -A clippy::precedence; see https://github.com/godot-rust/gdext/pull/1055.
99100
run: |
100101
cargo clippy --all-targets $CLIPPY_FEATURES -- \
101102
-D clippy::suspicious \
@@ -105,7 +106,8 @@ jobs:
105106
-D clippy::dbg_macro \
106107
-D clippy::todo \
107108
-D clippy::unimplemented \
108-
-D warnings
109+
-D warnings \
110+
-A clippy::precedence
109111
110112
111113
unit-test:

.github/workflows/release-version.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ jobs:
133133
-D clippy::dbg_macro \
134134
-D clippy::todo \
135135
-D clippy::unimplemented \
136-
-D warnings
136+
-D warnings \
137+
-A clippy::precedence
137138
138139
rustfmt:
139140
runs-on: ubuntu-latest

Changelog.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,50 @@ Cutting-edge API docs of the `master` branch are available [here](https://godot-
1010

1111
## Quick navigation
1212

13-
- [v0.2.0](#v020), [v0.2.1](#v021), [v0.2.2](#v022), [v0.2.3](#v023)
13+
- [v0.2.0](#v020), [v0.2.1](#v021), [v0.2.2](#v022), [v0.2.3](#v023), [v0.2.4](#v024)
1414
- [v0.1.1](#v011), [v0.1.2](#v012), [v0.1.3](#v013)
1515

1616

17+
## [v0.2.4](https://docs.rs/godot/0.2.4)
18+
19+
_24 February 2025_
20+
21+
### 🌻 Features
22+
23+
- Support additional doc comment markdown ([#1017](https://github.com/godot-rust/gdext/pull/1017))
24+
- Provide safe way for implementing `IScriptExtension::instance_has` ([#1013](https://github.com/godot-rust/gdext/pull/1013))
25+
- Global main thread ID ([#1045](https://github.com/godot-rust/gdext/pull/1045))
26+
- Add `validate_property` virtual func ([#1030](https://github.com/godot-rust/gdext/pull/1030))
27+
28+
### 📈 Performance
29+
30+
- Speed up creating and extending packed arrays from iterators up to 63× ([#1023](https://github.com/godot-rust/gdext/pull/1023))
31+
32+
### 🧹 Quality of life
33+
34+
- Test generation of proc-macro code via declarative macro ([#1008](https://github.com/godot-rust/gdext/pull/1008))
35+
- Test: support switching API versions in check.sh ([#1016](https://github.com/godot-rust/gdext/pull/1016))
36+
- Support `Variant::object_id()` for Godot <4.4; add `object_id_unchecked()` ([#1034](https://github.com/godot-rust/gdext/pull/1034))
37+
- Rename `Basis` + `Quaternion` methods, closer to Godot ([#1035](https://github.com/godot-rust/gdext/pull/1035))
38+
- Compare scripts via object_id ([#1036](https://github.com/godot-rust/gdext/pull/1036))
39+
- Add Godot 4.3 to minimal CI ([#1044](https://github.com/godot-rust/gdext/pull/1044))
40+
- Add .uid files for GDScript + GDExtension resources; update script cache ([#1050](https://github.com/godot-rust/gdext/pull/1050))
41+
- Add `#[allow(...)]` directives to macro-generated entries ([#1049](https://github.com/godot-rust/gdext/pull/1049))
42+
- Clippy: disable excessive operator-precedence lint ([#1055](https://github.com/godot-rust/gdext/pull/1055))
43+
44+
### 🛠️ Bugfixes
45+
46+
- Fix `Variant` -> `Gd` conversions not taking into account dead objects ([#1033](https://github.com/godot-rust/gdext/pull/1033))
47+
- Fix `DynGd<T,D>` export, implement proper export for `Array<DynGd<T,D>>` ([#1056](https://github.com/godot-rust/gdext/pull/1056))
48+
- In `#[var]s`, handle renamed `#[func]`s ([#1019](https://github.com/godot-rust/gdext/pull/1019))
49+
- 🌊 `#[signal]`: validate that there is no function body ([#1032](https://github.com/godot-rust/gdext/pull/1032))
50+
- Disambiguate virtual method calls ([#1020](https://github.com/godot-rust/gdext/pull/1020))
51+
- Parse doc strings with litrs ([#1015](https://github.com/godot-rust/gdext/pull/1015))
52+
- Register-docs: don't duplicate brief in description ([#1053](https://github.com/godot-rust/gdext/pull/1053))
53+
- Move some compile-time validations from godot to godot-ffi ([#1058](https://github.com/godot-rust/gdext/pull/1058))
54+
- Clippy: fix "looks like a formatting argument but it is not part of a formatting macro" ([#1041](https://github.com/godot-rust/gdext/pull/1041))
55+
56+
1757
## [v0.2.3](https://docs.rs/godot/0.2.3)
1858

1959
_30 January 2025_
@@ -149,6 +189,12 @@ See [devlog article](https://godot-rust.github.io/dev/november-2024-update) for
149189
- Vector conversion functions ([#824](https://github.com/godot-rust/gdext/pull/824))
150190
- Add Mul operator for Quaternion + Vector3 ([#894](https://github.com/godot-rust/gdext/pull/894))
151191

192+
### 📈 Performance
193+
194+
- `RawGd`: cache pointer to internal storage ([#831](https://github.com/godot-rust/gdext/pull/831))
195+
- `ClassName` now dynamic and faster ([#834](https://github.com/godot-rust/gdext/pull/834))
196+
- Pass-by-ref for non-`Copy` builtins (backend) ([#906](https://github.com/godot-rust/gdext/pull/906))
197+
152198
### 🧹 Quality of life
153199

154200
- Renames and removals
@@ -214,12 +260,6 @@ See [devlog article](https://godot-rust.github.io/dev/november-2024-update) for
214260
- Math
215261
- `Vecor3::sign()` gives incorrect results due to `i32` conversion ([#865](https://github.com/godot-rust/gdext/pull/865))
216262

217-
### 📈 Performance
218-
219-
- `RawGd`: cache pointer to internal storage ([#831](https://github.com/godot-rust/gdext/pull/831))
220-
- `ClassName` now dynamic and faster ([#834](https://github.com/godot-rust/gdext/pull/834))
221-
- Pass-by-ref for non-`Copy` builtins (backend) ([#906](https://github.com/godot-rust/gdext/pull/906))
222-
223263
### 📚 Documentation
224264

225265
- Builtin docs (impl blocks, navigation table, link to Godot) ([#821](https://github.com/godot-rust/gdext/pull/821))

check.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ function cmd_fmt() {
146146
}
147147

148148
function cmd_clippy() {
149+
# TODO(Rust 1.86): remove `-A clippy::precedence`.
150+
# In Rust 1.85, `clippy::precedence` includes bitmasking and shift operations. Rigid adherence to this rule results in more noisy code, with
151+
# little benefits (being aware of bit operator precedence is something we can expect + bit manipulations are common in Godot).
152+
# This behavior will be reverted in 1.86 and moved into new lint `precedence_bits` included in `restriction` category.
153+
# See https://github.com/godot-rust/gdext/pull/1055 and https://github.com/rust-lang/rust-clippy/pull/14115.
154+
149155
run cargo clippy --all-targets "${extraCargoArgs[@]}" -- \
150156
-D clippy::suspicious \
151157
-D clippy::style \
@@ -154,7 +160,8 @@ function cmd_clippy() {
154160
-D clippy::dbg_macro \
155161
-D clippy::todo \
156162
-D clippy::unimplemented \
157-
-D warnings
163+
-D warnings \
164+
-A clippy::precedence
158165
}
159166

160167
function cmd_klippy() {

godot-bindings/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "godot-bindings"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55
rust-version = "1.80"
66
license = "MPL-2.0"

godot-cell/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "godot-cell"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55
rust-version = "1.80"
66
license = "MPL-2.0"

godot-codegen/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "godot-codegen"
3-
version = "0.2.3"
3+
version = "0.2.4"
44
edition = "2021"
55
rust-version = "1.80"
66
license = "MPL-2.0"
@@ -21,7 +21,7 @@ experimental-godot-api = []
2121
experimental-threads = []
2222

2323
[dependencies]
24-
godot-bindings = { path = "../godot-bindings", version = "=0.2.3" }
24+
godot-bindings = { path = "../godot-bindings", version = "=0.2.4" }
2525

2626
heck = "0.5"
2727
nanoserde = "0.1.35"
@@ -35,7 +35,7 @@ quote = "1.0.29"
3535
regex = { version = "1.5.5", default-features = false, features = ["std", "unicode-bool", "unicode-gencat"] }
3636

3737
[build-dependencies]
38-
godot-bindings = { path = "../godot-bindings", version = "=0.2.3" } # emit_godot_version_cfg
38+
godot-bindings = { path = "../godot-bindings", version = "=0.2.4" } # emit_godot_version_cfg
3939

4040
# https://docs.rs/about/metadata
4141
[package.metadata.docs.rs]

godot-codegen/src/models/domain_mapping.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,8 @@ impl UtilityFunction {
559559
impl Enum {
560560
pub fn from_json(json_enum: &JsonEnum, surrounding_class: Option<&TyName>) -> Self {
561561
let godot_name = &json_enum.name;
562-
let is_bitfield = json_enum.is_bitfield;
562+
let is_bitfield = special_cases::is_enum_bitfield(surrounding_class, godot_name)
563+
.unwrap_or(json_enum.is_bitfield);
563564
let is_private = special_cases::is_enum_private(surrounding_class, godot_name);
564565
let is_exhaustive = special_cases::is_enum_exhaustive(surrounding_class, godot_name);
565566

godot-codegen/src/special_cases/special_cases.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,21 @@ pub fn is_enum_exhaustive(class_name: Option<&TyName>, enum_name: &str) -> bool
855855
}
856856
}
857857

858+
/// Overrides Godot's enum/bitfield status.
859+
/// * `Some(true)` -> bitfield
860+
/// * `Some(false)` -> enum
861+
/// * `None` -> keep default
862+
#[rustfmt::skip]
863+
pub fn is_enum_bitfield(class_name: Option<&TyName>, enum_name: &str) -> Option<bool> {
864+
let class_name = class_name.map(|c| c.godot_ty.as_str());
865+
match (class_name, enum_name) {
866+
| (Some("Object"), "ConnectFlags")
867+
868+
=> Some(true),
869+
_ => None
870+
}
871+
}
872+
858873
/// Whether an enum can be combined with another enum (return value) for bitmasking purposes.
859874
///
860875
/// If multiple masks are ever necessary, this can be extended to return a slice instead of Option.

0 commit comments

Comments
 (0)