You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was working on a rustc suggestion which turns tuple struct literal into a named struct literal. That is, it changes Struct(a) into Struct { 0: a }.
This change consists of two parts:
Changing parens into braces (() -> {})
Adding indices (0:)
The trivial way to do this is to replace the span of ( with { and then add 0: before a. However, this causes rustfix to panic with "cannot replace slice of data that was already replaced", even though the spans aren't overlapping!
The two spans are "the span of ( (1 length)" and "the span between ( and a (zero-length)". They are touching, but importantly not overlapping.