Skip to content

Port most of --print=target-cpus to Rust - #132514

Merged
bors merged 3 commits into
rust-lang:masterfrom
Zalathar:print-target-cpus
Nov 3, 2024
Merged

bors merged 3 commits into
rust-lang:masterfrom
Zalathar:print-target-cpus

Conversation

@Zalathar

@Zalathar Zalathar commented Nov 2, 2024 •

Copy link
Copy Markdown
Member

The logic and formatting needed by --print=target-cpus has historically been carried out in C++ code. Originally it used printf to write directly to the console, but later it switched over to writing to a std::ostringstream and then passing its buffer to a callback function pointer.

This PR replaces that C++ code with a very simple function that writes a list of CPU names to a &RustString, with the rest of the logic and formatting being handled by ordinary safe Rust code.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants