Skip to content

Conversation

powerboat9
Copy link
Collaborator

@powerboat9 powerboat9 commented Aug 12, 2025

Pointers stored in Pieces::pieces_vector refer to objects with lifetimes tied to Pieces::handle. This commit also removes the move constructor for Pieces, as it's equivalent to the copy constructor.

Pointers stored in Pieces::pieces_vector refer to objects with lifetimes
tied to Pieces::handle. This commit also removes the move constructor
for Pieces, as it's equivalent to the copy constructor.

gcc/rust/ChangeLog:

	* ast/rust-fmt.cc (Pieces::Pieces): Reconstruct pieces_vector
	when copying, remove move constructor.
	(Pieces::operator=): Reconstruct pieces_vector when copying.
	* ast/rust-fmt.h (Pieces::Pieces): Remove move constructor.

Signed-off-by: Owen Avery <[email protected]>
@powerboat9
Copy link
Collaborator Author

I've removed the move constructor instead of creating an accurate implementation, as I'd want to be very careful about maintaining invariants on a moved-from ffi::FormatArgsHandle

@powerboat9 powerboat9 marked this pull request as draft August 12, 2025 14:43
@powerboat9
Copy link
Collaborator Author

Superseded by #4074

@powerboat9 powerboat9 closed this Aug 25, 2025
@powerboat9 powerboat9 deleted the fix-ffi branch August 25, 2025 22:29
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.

1 participant