Skip to content

internal: Remove clone_for_update from flip_range_expr#21857

Draft
Amit5601 wants to merge 1 commit intorust-lang:masterfrom
Amit5601:remove-clone-flip-range
Draft

internal: Remove clone_for_update from flip_range_expr#21857
Amit5601 wants to merge 1 commit intorust-lang:masterfrom
Amit5601:remove-clone-flip-range

Conversation

@Amit5601
Copy link
Contributor

This PR removes the use of .clone_for_update() in the flip_range_expr assist. The SyntaxEditor can handle the insertion of the immutable nodes directly, so the mutable clones are no longer necessary.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 23, 2026
@ChayimFriedman2
Copy link
Contributor

Thanks!

@A4-Tacks
Copy link
Member

The original tree can be auto mutable and only supports replaces, not inserts

crates/syntax/src/syntax_editor/edit_algo.rs:197

@Amit5601 Amit5601 force-pushed the remove-clone-flip-range branch from af37bd8 to d5d9815 Compare March 23, 2026 15:33
@A4-Tacks
Copy link
Member

This PR is wrong

Unless you add features to edit_algo

@Amit5601 Amit5601 marked this pull request as draft March 23, 2026 15:39
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 23, 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.

4 participants