refactor(api)!: mark growing public types #[non_exhaustive] - #317
Merged
Merged
Conversation
Mark the error enums, error records, options, outputs, reports, identity and metadata records, and settings domains listed in #312 as release. Closed program-model enums and consumer-constructed values stay exhaustive, as decided in #256. Add constructors for the marked records that WrightKit consumers build: MappedText::new (opy-rs, Wright tests), SourceReference::new/with_note and GameplayDatasetIdentity::new (gameplay integration tests). Closes #312 Co-authored-by: Indent <noreply@indent.com>
Co-authored-by: Indent <noreply@indent.com>
e54-bot
force-pushed
the
feat/non-exhaustive-312
branch
from
September 27, 2026 11:03
fde02d5 to
9dd704b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
#[non_exhaustive]: 13 error enums,CatalogError,EmitOptions/ConvertOptions, 8 output/report/record structs, 8 identity/metadata structs, andSettingScope/SettingValueDomain. Types on the "keep" list are unchanged.MappedText::new(text, map): opy-rscrates/opy-rs/src/compiler/mod.rsand Wrightcrates/wright-driver/tests/source_provider.rsbuild it. Mark growing public structs, error enums, and settings domains #[non_exhaustive] before 1.0 #312 said no consumer did; these call sites turned up when I built the consumers against this branch.gameplay::SourceReference::new(source, locator)+with_note(..), andgameplay::GameplayDatasetIdentity::new(..): the out-of-crate gameplay integration tests build them to callGameplayCatalog::new.with_noteexists becausetests/gameplay_data.rssets a note.workshop-rs-cli: builds options asDefaultfollowed by field assignment, and adds a wildcard arm to the censusSettingValueDomainmatch (unreachable!, matching the existing census capability match).tests/public_api.rs: adds an out-of-crate test forMappedText::new.docs/compatibility-facades.md: adds a short "Growth without breaking changes" section. It says which public types are extensible, how to build them, and which stay exhaustive per Audit externally extensible public enums and identities for 1.x semver #256.Why
After 1.0, adding a field or variant to an exhaustive public type needs a major release. The types marked here are expected to grow as new failure modes, options, report fields, and lobby settings appear.
Verification
Run locally on this branch after rebasing onto
359df0c(#316):cargo fmt --all --check,cargo clippy --workspace --all-targets -- -D warnings,cargo run -p workshop-rs --bin workshop-catalog-gen -- check,git diff --check: all pass.cargo test --workspace --all-targets: 373 passed, 0 failed, 3 ignored. That is the same test list asmainplus the newpublic_api::mapped_text_is_constructible_outside_the_crate.cargo semver-checks -p workshop-rs --baseline-rev origin/main(0.50.0): exactly 2 failing lints,enum_marked_non_exhaustive(15 enums) andstruct_marked_non_exhaustive(19 structs). Together that is the 34 listed types; some appear twice in the output because of re-export paths. Nothing else fails. The new constructors are additive.311ff50/v0.9.1; refactor!: remove catalog-generated typed constructors from the public API #316 carries its own downstream migrations), using[patch.crates-io] workshop-rs = { path = ... }on each consumer'sorigin/main. These are throwaway local edits; the consumers own the real migrations under Migrate to the workshop-rs 1.0 public API opy-rs#359 and the Wright 1.0 candidate verification:f151daa(v0.1.60): needed a_ => Nonearm inworkshop_error_spanplusMappedText::new(..)instead of the struct literal (both incrates/opy-rs/src/compiler/mod.rs). Thencargo clippy --workspace --all-targets --all-features -D warningsis clean andcargo test --workspace --all-featurespasses 539/539.7d111b5(v0.2.40): needed a wildcard arm in theWorkshopErrormatch incrates/wright-driver/src/session.rsplusMappedText::new(..)incrates/wright-driver/tests/source_provider.rs. Then clippy is clean andcargo test --workspace --all-featurespasses 258/258.workshop-rs = "=0.3.7"and is not affected.Closes #312
Tag
@indentto continue the conversation here.