Skip to content

Implement the Default trait with more specific code than the derived Default, for DuplicateFlags.#1630

Draft
rsethc wants to merge 1 commit into
godot-rust:masterfrom
rsethc:specific-default-impl-for-some-bitfields
Draft

Implement the Default trait with more specific code than the derived Default, for DuplicateFlags.#1630
rsethc wants to merge 1 commit into
godot-rust:masterfrom
rsethc:specific-default-impl-for-some-bitfields

Conversation

@rsethc

@rsethc rsethc commented Jun 9, 2026

Copy link
Copy Markdown

This was split off from: #1627

This would be a breaking change since any code that currently uses Default::default() and gets 0, for the types which are receiving a more specific implementation here, will get something different.

It will be a silently breaking change too (code that is broken by this change will likely still compile). It may be preferable to remove the derived Default, instead of implementing it differently, so that code broken by this change catches API users' attention much more noticeably.

Needs:

  • Consideration as to whether Default should even remain implemented (with the specialized implementation, as current) or whether the derive should simply be entirely removed instead.
  • To have tests added or updated?
  • To be squashed.

@Bromeon Bromeon added breaking-change Requires SemVer bump quality-of-life No new functionality, but improves ergonomics/internals labels Jun 9, 2026
@Bromeon Bromeon added this to the 0.6 milestone Jun 9, 2026
@Bromeon Bromeon added the c: engine Godot classes (nodes, resources, ...) label Jun 9, 2026
@GodotRust

Copy link
Copy Markdown

API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-1630

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change Requires SemVer bump c: engine Godot classes (nodes, resources, ...) quality-of-life No new functionality, but improves ergonomics/internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants