Skip to content

Use Rust 1.49 in CI - #3574

Open
CohenArthur wants to merge 2 commits into
Rust-GCC:masterfrom
CohenArthur:rust-1.49-ci
Open

Use Rust 1.49 in CI#3574
CohenArthur wants to merge 2 commits into
Rust-GCC:masterfrom
CohenArthur:rust-1.49-ci

Conversation

@CohenArthur

Copy link
Copy Markdown
Member

Fixes #3569

@CohenArthur CohenArthur added this to the Downgrade to Rust 1.49 milestone Mar 26, 2025
@tschwinge

Copy link
Copy Markdown
Member

Does this switch all or just a few pipelines to 1.49? I guess we'll want to mix of "old" (minimum; 1.49), "common" (whatever different distributions ship), and "latest"?

@CohenArthur

Copy link
Copy Markdown
Member Author

@tschwinge I think we should stick with 1.49 in the goal of compiling it with gccrs as early as possible. I'm also happy doing it with multiple toolchains to ensure we don't rely on behavior that's removed in later Rust versions, maybe in a later PR? Also maybe something we could do daily like the bootstrap build?

@CohenArthur

Copy link
Copy Markdown
Member Author

(so at the moment all pipelines are switched to 1.49)

CohenArthur and others added 2 commits August 14, 2025 10:41
Fixes gccrs#3569

ChangeLog:

	* .github/workflows/ccpp.yml: Switch to Rust 1.49.
	* .github/workflows/ccpp32alpine.yml: Likewise.
This should remove a use-after-free as well as simplify the FFI
interface.

gcc/rust/ChangeLog:

	* ast/rust-fmt.cc (Pieces::collect): Handle changes to ffi
	interface.
	(Pieces::~Pieces): Remove function definition.
	(Pieces::Pieces): Likewise.
	(Pieces::operator=): Likewise.
	* ast/rust-fmt.h: Include "optional.h".
	(rust_ffi_alloc): New extern "C" function declaration.
	(rust_ffi_dealloc): Likewise.
	(class FFIVec): New class.
	(class FFIOpt): Likewise.
	(RustHamster::RustHamster): New constructor accepting const
	std::string reference.
	(struct FormatSpec): Use FFIOpt.
	(struct PieceSlice): Remove struct.
	(struct RustString): Likewise.
	(struct FormatArgsHandle): Likewise.
	(collect_pieces): Change function signature.
	(clone_pieces): Likewise.
	(destroy_pieces): Remove extern "C" function declaration.
	(Pieces::~Pieces): Remove function declaration.
	(Pieces::operator=): Likewise.
	(Pieces::get_pieces): Handle changes to class fields.
	(Pieces::Pieces): Remove copy and move constructor declarations,
	adjust signature of remaining constructor declaration.
	(Pieces::pieces_vector): Remove member variable.
	(Pieces::handle): Likewise.
	(Pieces::data): Add member variable.
	* expand/rust-macro-builtins-asm.cc (expand_inline_asm_strings):
	Use references to avoid copying.

libgrust/ChangeLog:

	* libformat_parser/src/lib.rs (struct FFIVec): New.
	(trait StringLeakExt): Remove.
	(struct FFIOpt): New.
	(trait IntoFFI): Adjust implementation for Option.
	(struct RustHamster): Add lifetime and adjust conversion to and
	from &str.
	(enum Piece): Adjust definition to handle changes to
	RustHamster.
	(struct Argument): Likewise.
	(struct FormatSpec): Use FFIOpt and RustHamster.
	(enum Position): Use RustHamster.
	(enum Count): Likewise.
	(struct PieceSlice): Replace with...
	(typedef PieceVec): ...this.
	(struct RustString): Remove.
	(struct FormatArgsHandle): Likewise.
	(fn collect_pieces): Adjust signature, greatly simplifying
	implementation.
	(fn clone_pieces): Likewise.
	(fn destroy_pieces): Remove.
	(trait LayoutExt): New.
	(fn rust_ffi_alloc): New.
	(fn rust_ffi_dealloc): New.

Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
@powerboat9

Copy link
Copy Markdown
Collaborator

Yeah, I'll need to work more on #4074.

@powerboat9

Copy link
Copy Markdown
Collaborator

@CohenArthur still relevant?

@powerboat9 powerboat9 added merge conflicts failing build CI One or more build CI actions aren't passing labels Jun 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

failing build CI One or more build CI actions aren't passing merge conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Rust 1.49 in CI

3 participants