delete the suffix stripping; an explicit name is the only publishing override - #235
Merged
Conversation
…override The name-based strip republished every type whose ident happened to end in the companion suffix — the trigger was pure spelling, so a consuming workspace could not name a type `XData` without it silently publishing as `X`. Measured in the consuming workspace: eleven pre-existing types retroactively renamed and two hard collisions. The one legitimate use, a companion stencil publishing under its real type's name, is what `#[model_schema(name = "...")]` already says explicitly. The strip is gone from both sides: the naming seam returns the ident unchanged, and the reference-side strip goes with it. A member key that happened to end in the suffix was being truncated through the same seam; that ends too. The override was already authoritative for references — the registry stores the export name and all three surfaces read it — so a declaration and its references agree in either declaration order: a forward reference falls back to the ident, and the renamed item publishes an alias at both spellings. Module naming stays derived from the ident, deliberately, where the task asked it to follow the override: an override-named module is one no forward reference can name, and the measured alternative — a module alias — emits unused-import warnings in consuming crates wherever nothing forward-references the type, fixable only by a suppression. The module is a Rust implementation detail; the name a document publishes is already the override everywhere observable. What no guard answered before is answered now: two items whose published names collide are a compile error at the ungated seam, not a silent merge, with an ident reclaiming its own name never a collision. The companion-suffix pins are inverted rather than dropped: no surface writes the shortened name for a suffixed ident, overrides publish and are referenced under the override for structs, enums and aliases alike, and the self-recursive untagged enum keeps its deferral under the overridden name. just fmt, just check, just quick, doctests, just lint-all across all 68 toggles, and the test powerset across all 68 in four partitions — all green.
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.
The name-based strip republished every type whose ident happened to end in the
companion suffix — the trigger was pure spelling, so a consuming workspace
could not name a type
XDatawithout it silently publishing asX. Measuredin the consuming workspace: eleven pre-existing types retroactively renamed and
two hard collisions. The one legitimate use, a companion stencil publishing
under its real type's name, is what
#[model_schema(name = "...")]alreadysays explicitly.
The strip is gone from both sides: the naming seam returns the ident unchanged,
and the reference-side strip goes with it. A member key that happened to end in
the suffix was being truncated through the same seam; that ends too.
The override was already authoritative for references — the registry stores the
export name and all three surfaces read it — so a declaration and its
references agree in either declaration order: a forward reference falls back to
the ident, and the renamed item publishes an alias at both spellings.
Module naming stays derived from the ident, deliberately, where the task asked
it to follow the override: an override-named module is one no forward reference
can name, and the measured alternative — a module alias — emits unused-import
warnings in consuming crates wherever nothing forward-references the type,
fixable only by a suppression. The module is a Rust implementation detail; the
name a document publishes is already the override everywhere observable.
What no guard answered before is answered now: two items whose published names
collide are a compile error at the ungated seam, not a silent merge, with an
ident reclaiming its own name never a collision.
The companion-suffix pins are inverted rather than dropped: no surface writes
the shortened name for a suffixed ident, overrides publish and are referenced
under the override for structs, enums and aliases alike, and the self-recursive
untagged enum keeps its deferral under the overridden name.
just fmt, just check, just quick, doctests, just lint-all across all 68
toggles, and the test powerset across all 68 in four partitions — all green.