Skip to content

Conversation

@WaffleLapkin
Copy link
Contributor

See rust-lang/rust#145457, we want to remove unconditional [T; 0]: Default impl. That would be a breaking change breaking this crate.

Unfortunately, fixing this is a breaking change to the public API of this crate (I think?), because it requires removing Settings impl for [T; 0] where T: Debug + Clone + 'static (but not T: Default).

Copy link
Collaborator

@TheJokr TheJokr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are correct that this is technically a breaking change. However, the Settings impl for a type is only really relevant in 2 cases:

  1. As the root type for foundations' config interface. A unit type like [T; 0] makes little sense there, since it conveys no information.
  2. As a nested type when using #[derive(Settings)]. Our macro depends on all fields of a struct implementing Settings as well.

I'm ok with breaking semver for 1), since I doubt anyone uses [T; 0] like that. For 2), we can work around it in our macro. Any generic uses like [T; N] already require T: Settings for the non-zero case, so we can check for a literal 0.

E: I will add a commit to your PR to make the macro changes. It's not perfect (e.g., type aliases will break it), but imo good enough.

@TheJokr TheJokr merged commit 7b2c1c2 into cloudflare:main Oct 28, 2025
18 checks passed
@WaffleLapkin WaffleLapkin deleted the undefault branch October 29, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants