Skip to content

Qualify Some/String/Vec paths in generated code#1032

Draft
danieleades wants to merge 1 commit into
oxidecomputer:mainfrom
danieleades:fix/qualify-paths
Draft

Qualify Some/String/Vec paths in generated code#1032
danieleades wants to merge 1 commit into
oxidecomputer:mainfrom
danieleades:fix/qualify-paths

Conversation

@danieleades

@danieleades danieleades commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Generated code mostly uses fully-qualified paths (::std::...) so that output compiles even when the schema defines types named Some, String, or Vec (see the rust-collisions test schema). A few emitted blocks still used bare paths:

  • the schemars::JsonSchema impl for deny-value newtypes used bare Some
  • the TryFrom impl proxied through an inner type's FromStr used bare String
  • the ConversionError From impl used bare String
  • sets were rendered as bare Vec<T>

This qualifies all of these. Pure path qualification — no change to the set of impls generated (+83/−83 across goldens).

An earlier revision of this PR also re-introduced a TryFrom<&String> impl at the FromStr-proxy site; that was dropped since it reverts #946, which deliberately removed it as non-idiomatic.

@danieleades danieleades marked this pull request as draft July 12, 2026 06:43
Generated code mostly uses fully-qualified paths (::std::...) so that
output compiles even when the schema defines types with names like
Some, String, or Vec. A few emitted blocks still used bare paths:

- the schemars::JsonSchema impl for deny-value newtypes used bare Some
- the TryFrom impl proxied through an inner type's FromStr used bare
  String
- the ConversionError From impl used bare String
- sets were rendered as bare Vec<T>

Qualify all of these.
@danieleades danieleades changed the title Qualify Some/String/Vec paths in generated code; add missing TryFrom<&String> impls Qualify Some/String/Vec paths in generated code Jul 12, 2026
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.

1 participant