Repository navigation
Match enable-only compat flags when Rust is built with ASan - #8924
Conversation
There was a problem hiding this comment.
Superseded by the review of
4d114518.
This review, of 2a1fde12
✅ Approved — This rewrite of flags_in_match_order() behaves the same as before and keeps the disable_flag_first order. The new test builds its expected slot map on its own, so it would catch a dropped enable-only flag. No issues found.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
The change only alters how an internal iterator is built; flag lookup behaves the same. It touches no trust boundary, input handling or access control, and the new test is test-only.
📋 Code Quality: ✅ LGTM
[first, second].into_iter().flatten() yields the same pairs in the same order as first.into_iter().chain(second). It also keeps the disable_flag_first ordering that the first-wins insertion in FlagTable::read depends on.
maps_every_flag_to_its_slot builds its expected map straight from enable_flag and disable_flag, with the same first-wins entry semantics, so it does not rely on flags_in_match_order. If an enable-only flag goes missing from slots, the test fails.
The new comment explains why the array form is used and names the test that guards it, which fits the repository's comment guidelines.
📝 Documentation: ✅ LGTM
No documentation issues.
Reviewed commit: 2a1fde12
With -Zsanitizer=address at opt-level 3, rustc compiled FlagInfo::flags_in_match_order(), inlined into FlagTable::read(), so that `first.into_iter().chain(second)` yielded nothing when `first` was the enable flag and `second` was None. FlagTable::slots then had no entry for any of the 54 flags without a disable flag, among them `experimental` and `python_workers`, and with RUST_COMPAT_DATE on, naming any of them failed with "No such compatibility flag". In such a build, compat-date_test's gates_experimental_flags fails, as does compatibility-date-legacy-test's comparison with the C++ compiler. Build the iterator from a two-element array instead, which that build compiles correctly. maps_every_flag_to_its_slot checks the whole table against the schema's flags, and fails in that build without the fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2a1fde1 to
4d11451
Compare
There was a problem hiding this comment.
✅ Approved — This rewrite of flags_in_match_order() behaves the same as before and keeps the disable_flag_first order. The new test builds its expected slot map on its own, so it would catch a dropped enable-only flag. No issues found.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
🔒 Security: ✅ LGTM
The change only alters how an internal iterator is built; flag lookup behaves the same. It touches no trust boundary, input handling or access control, and the new test is test-only.
📋 Code Quality: ✅ LGTM
[first, second].into_iter().flatten() yields the same pairs in the same order as first.into_iter().chain(second). It also keeps the disable_flag_first ordering that the first-wins insertion in FlagTable::read depends on.
maps_every_flag_to_its_slot builds its expected map straight from enable_flag and disable_flag, with the same first-wins entry semantics, so it does not rely on flags_in_match_order. If an enable-only flag goes missing from slots, the test fails.
The new comment explains why the array form is used and names the test that guards it, which fits the repository's comment guidelines.
📝 Documentation: ✅ LGTM
No documentation issues.
Reviewed commit: 4d114518 — same changes as 2a1fde12, so this is that commit's review (no new review was run; line numbers are as of 2a1fde12)
With
-Zsanitizer=addressat opt-level 3, rustc compilesFlagInfo::flags_in_match_order(), inlined intoFlagTable::read(), so thatfirst.into_iter().chain(second)yields nothing whenfirstis the enable flag andsecondisNone.FlagTable::slotsthen has no entry for any of the 54 flags without a disable flag (experimental,python_workers,html_rewriter_treats_esi_include_as_void_tag, ...). WithRUST_COMPAT_DATEon, naming any of them fails with "No such compatibility flag".In such a build:
compat-date_test'sgates_experimental_flagsfails (assertion failed: is_on(&c, "obsolete19")).compatibility-date-legacy-test's "the Rust compiler agrees with the C++ compiler" fails onesiIncludeIsVoidTag.This builds the iterator from a two-element array instead, which that build compiles correctly. The new
maps_every_flag_to_its_slottest checks the whole table against the schema's flags. Without the fix it fails in that build, with 310 of 364 names present and none under a wrong slot.Tested with an ASan, opt-level 3 build:
compat-date_test,compatibility-date-legacy-test, and the@all-autogatestest variants pass with the fix.🤖 Generated with Claude Code