Repository navigation
fix(text): TextSpec is 224 bytes again, so rune compiles - #2227
Merged
Merged
Conversation
#2206 added a bool (selectable_cursor) to TextSpec, which made it 232 bytes; the compile-time assert on its size (224, the budget of #579) then failed, and rune no longer compiled on any 64-bit target. fade_em, the width of a truncate_fade edge that few texts set, moves behind the cold box, where a text's rarely set fields wait; the new flag takes its room. The usual width is the cold block's default, so truncate_fade allocates nothing.
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.
devdoes not compile since #2206:TextSpecgrew from 224 to 232 bytes, and the compile-time assert on its size fails on every 64-bit target. This puts it back at 224 without raising the number.Why
crates/rune/src/el/text_spec.rsassertssize_of::<TextSpec>() == 224. That is the weight every text carries (#579 brought it from 744). #2206 added oneboolto the struct,selectable_cursor, which no longer fit in the padding:Seen on Windows x64 and on macOS at
349970042. Every commit from38f8dc54con has it.What changes
fade_em, the width in ems of atruncate_fadeedge, moves fromTextSpecintoTextCold, where a text's rarely set fields wait behind one box. The new flag takes the room it leaves.TRUNCATE_FADE_EM, 1.5) is the cold block's default, soEl::truncate_fade()writes nothing and allocates nothing. OnlyEl::truncate_fade_widthwith another width writes it.spec.cold.fade_em. Nothing else read the field.What it can change for an app
Nothing it can see: the same fade at the same width. A text is 224 bytes again instead of 232.
Run
dev349970042plus this):runecompiles.cargo test -p rune --lib -- truncate selection_enabled fade inline_icon: 69 passed, 0 failed.cargo test -p rune-kit --test integration: 308 passed, 0 failed.runecompiles; its library tests are green (3,338 passed, 0 failed), and every other test binary is green except one test ofrune-kit's integration tests,diff_custom::file_header_replaces_built_in_header_in_list_and_sticky_overlay_and_toggles_collapse(307 passed, 1 failed). That one was red on macOS beforedevstopped compiling, passes on Windows, and is a paint-keep self-check, not this change; it is being looked at separately.