Repository navigation
[57_maintenance] fix: UnionFields::from_iter should validate input - #11726
Merged
Merged
Conversation
# Which issue does this PR close? <!-- It is not necessary to raise an issue, but it is encouraged if it is a non-trivial enhancement/bug. If this PR relates to an existing issue, but does not fully resolve it, please change the wording below from "Closes #NNN" to "Relates to #NNN" or "Part of #NNN" to avoid false closing an issue. --> - None # Rationale for this change <!-- Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed. Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes. Please try to explain the problem you are trying to solve in terms of the user-visible behavior, rather than the implementation. --> Make it impossible to create an invalid `UnionFields` via safe APIs. This makes it easier for downstream uses of `UnionFields` (in other parts of the codebase), since they can rely on the data being valid, instead of needing to check each time. # What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> Make sure `UnionFields::from_iter` validates its input before construction a `UnionFields`, similar to `UnionFields::try_new` # Are these changes tested? <!-- We typically require tests for all PRs in order to: 1. Prevent the code from being accidentally broken by subsequent changes 2. Serve as another way to document the expected behavior of the code If tests are not included in your PR, please explain why (for example, are they covered by existing tests, if so identify these tests)? If this PR claims a performance improvement, please include evidence such as benchmark results. DO NOT simply paste a list of commands ran to verify the code; this is what our CI is for and it pollutes the PR. ONLY explain if testing was included with this PR, or why it wasn't. --> Added new unit test. # Are there any significant user-facing changes? <!-- Significant user-facing changes include: - Breaking public API change - Significant change to existing functionality (e.g. function returns something different) These need to be explicitly called out to ensure we have proper documentation if required and to ensure we follow proper semantic versioning. DO NOT restate the changes of this PR; if a bug was fixed and already explained above, we don't need this to be restated as a user-facing change. --> `UnionFields::from_iter` can now panic on invalid input data. This can be reachable via a `collect()` into a `UnionFields` for example. (cherry picked from commit b2e2c2d)
Contributor
Author
|
I expect CI to fail with MSRV check, which is fixed in |
4 of 5 tasks
Rich-T-kid
approved these changes
Oct 20, 2026
Jefffrey
added a commit
that referenced
this pull request
Oct 21, 2026
…9888, #10433, #11305 (#11728) # Which issue does this PR close? - Part of #11666 (57.3.2 release) # Rationale for this change The `Verify MSRV` job fails on PRs against `57_maintenance` (for example #11726) for reasons unrelated to those PRs. # What changes are included in this PR? Check in the root `Cargo.lock` (same approach as #9941 on `main`). This PR also carries the following backports needed to get CI green on `57_maintenance`: - #11305: remove redundant homepage and doc links (via the `59_maintenance` backport #11354) - #9888: - #10433: (fixes MIRI CI) - Fix Audit and MSRV CI jobs: install `cargo-audit` / `cargo-msrv` with `--locked` and ignore RUSTSEC-2026-0194/0195/0176/0177 (as on `59_maintenance`) # Are these changes tested? CI # Are there any user-facing changes? No. This only affects dependency resolution for workspace builds and CI. --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Jeffrey Vo <jeffrey.vo.australia@gmail.com> Co-authored-by: Dewey Dunnington <dewey@wherobots.com> Co-authored-by: Copilot <copilot@github.com> Co-authored-by: Aditya Mishra <bit2swaz@gmail.com>
Contributor
Author
|
Gah, needs some more CI love |
Contributor
Author
Jefffrey
added a commit
that referenced
this pull request
Oct 22, 2026
…stall-action & pinning ubuntu (#11777) # Which issue does this PR close? - Part of #11666 (57.3.2 release) # Rationale for this change The `Verify MSRV` job fails on PRs against `57_maintenance` (for example #11726) for reasons unrelated to those PRs: ``` error: cannot install package `cargo-msrv 0.19.5`, it requires rustc 1.94.1 or newer, while the currently active rustc version is 1.91.1 `cargo-msrv 0.19.3` supports rustc 1.91.1 ``` `cargo-msrv` 0.19.4 and 0.19.5 were released today (2026-10-21) and require rustc 1.94.1, but `57_maintenance` pins the toolchain to 1.91 in `rust-toolchain.toml`. `cargo install cargo-msrv --locked` (added in #11728) does not help because `--locked` only pins the dependency graph, not the `cargo-msrv` version itself. # What changes are included in this PR? Install `cargo-msrv` using `taiki-e/install-action` (which downloads a prebuilt binary and does not need to compile anything with the pinned toolchain), the same way `main` does since #10589. The action is pinned to the same commit as on `main`. # Are these changes tested? CI # Are there any user-facing changes? No, CI only. --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Jefffrey <jeffrey.vo.australia@gmail.com>
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.
UnionFields::from_itershould validate input #1153357.3.2(October 2026) #11666Cherry-pick of b2e2c2d