You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After 1.0, a new field on an exhaustive struct with all-public fields, or a new variant on an exhaustive enum, is a major change. Several public types are expected to grow:
error enums, as new failure modes appear;
options, output, report, and identity records;
settings domains that follow Overwatch's lobby settings. SettingScope has already grown once, when Extensions was added.
ADR-0013 applied #[non_exhaustive] to Rule / Condition, and #256 applied it to PlayerEventKind / ModifyOp. The rest of the surface has not been audited for field or variant growth. Without this change, routine additions in 1.x would need major releases.
Scope
The classification below is taken from the v0.9.1 public surface. Mark these types #[non_exhaustive]:
Changing serde wire formats. #[non_exhaustive] does not affect them.
Adding builders beyond what an existing consumer needs to construct a type.
Constraints
If a WrightKit consumer builds one of the marked types with a struct literal, provide a constructor in the same PR. None were found on main at v0.9.1.
Pre-1.0 breaking change: the PR title uses a ! conventional-commit marker.
Acceptance criteria
Every type in the "mark" list is #[non_exhaustive], and every type in the "keep" list is unchanged.
cargo semver-checks reports exactly the listed types as newly non-exhaustive, and nothing else.
Out-of-crate code in this workspace (integration tests, workshop-rs-cli) compiles, with wildcard arms or .. patterns added where needed. Existing tests pass without weakened assertions.
The PR confirms that opy-rs and Wright compile against the change once their known exhaustive matches get a wildcard arm (see below).
Dependencies / ownership
Owner: workshop-rs.
Known downstream migrations, which the consumers own when they adopt the release:
opy-rs: the exhaustive WorkshopError match in crates/opy-rs/src/compiler/mod.rs.
Wright: the exhaustive WorkshopError match in crates/wright-driver/src/session.rs.
Parent: #252
Readiness: ready-for-implementation
Problem
After 1.0, a new field on an exhaustive struct with all-public fields, or a new variant on an exhaustive enum, is a major change. Several public types are expected to grow:
SettingScopehas already grown once, when Extensions was added.ADR-0013 applied
#[non_exhaustive]toRule/Condition, and #256 applied it toPlayerEventKind/ModifyOp. The rest of the surface has not been audited for field or variant growth. Without this change, routine additions in 1.x would need major releases.Scope
The classification below is taken from the v0.9.1 public surface. Mark these types
#[non_exhaustive]:WorkshopError,SourceMappingError,actions::ElementCountError,actions::ActionLayoutError,settings::SettingOperationError,settings::NumericBoundsError,source::SourceEditError,gameplay::GameplayDataError,gameplay::AbilityLookupError,gameplay::query::GameplayQueryError,gameplay::query::AbilityNameResolutionError,gameplay::query::CooldownError,gameplay::query::CooldownPercentageErrorCatalogErroremitter::EmitOptions,convert::ConvertOptions. Both already implementDefault, which stays the way to construct them.emitter::EmitOutput,convert::Conversion,MappedText,actions::ElementCountReport,actions::ElementCountNode,roundtrip::RoundTripRecord,rules::SemanticIssue,detect::Detectioncatalog::CatalogIdentity,catalog::TargetMeta,catalog::Provenance,catalog::LocaleCoverage,catalog::ParamCoercions,gameplay::GameplayDatasetIdentity,gameplay::SourceReference,settings::SettingSourcesettings::SettingScope,settings::SettingValueDomainKeep these exhaustive. They are closed by definition, or they are values that consumers construct:
source::Span,source::Position,Variable,Subroutine,gameplay::Quantity,gameplay::Fact,gameplay::query::AbilityMatch,settings::EffectiveNumber,settings::SettingOccurrence,settings::SettingPresentation,settings::Settings,settings::SettingsListElement,actions::ActionLayoutAction,Value,Event,EventTeam,EventTarget,catalog::Kind, and the remaining settings, gameplay, and rules classification enums, as decided in Audit externally extensible public enums and identities for 1.x semver #256. New Workshop content arrives through catalog ids andCall.Non-goals
Action/Value/Event.#[non_exhaustive]does not affect them.Constraints
mainat v0.9.1.!conventional-commit marker.Acceptance criteria
#[non_exhaustive], and every type in the "keep" list is unchanged.cargo semver-checksreports exactly the listed types as newly non-exhaustive, and nothing else.workshop-rs-cli) compiles, with wildcard arms or..patterns added where needed. Existing tests pass without weakened assertions.Dependencies / ownership
workshop-rs.WorkshopErrormatch incrates/opy-rs/src/compiler/mod.rs.WorkshopErrormatch incrates/wright-driver/src/session.rs.