Skip to content

Conversation

@bjorn3
Copy link
Member

@bjorn3 bjorn3 commented Jan 12, 2026

This flag tells the codegen backend to immediately execute the code it builds. This is exactly what miri needs as it is unable to produce real executables. Adding a builtin flag would allow cargo to add native support for this without miri needing to do a bunch of hacks in its cargo wrapper. Furthermore cg_clif also has a jit mode that benefits from it.

This flag tells the codegen backend to immediately execute the code it
builds. This is exactly what miri needs as it is unable to produce real
executables. Adding a builtin flag would allow cargo to add native
support for this without miri needing to do a bunch of hacks in its
cargo wrapper. Furthermore cg_clif also has a jit mode that benefits
from it.
If cargo gets native support for -Zjit-mode, this should allow
simplifying cargo-miri a fair bit.
@rustbot
Copy link
Collaborator

rustbot commented Jan 12, 2026

The Miri subtree was changed

cc @rust-lang/miri

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 12, 2026
@rustbot
Copy link
Collaborator

rustbot commented Jan 12, 2026

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@Urgau
Copy link
Member

Urgau commented Jan 12, 2026

This is kind-of a nit, but the naming of the flag implies to me that we generate a binary that calls back rustc at runtime to generate the machine code where necessary. What about -Zrun instead? or -Zexecute?

@rust-log-analyzer

This comment has been minimized.

@bjorn3
Copy link
Member Author

bjorn3 commented Jan 12, 2026

What about -Zrun instead? or -Zexecute?

I like those names. I don't have much of a preference which of the two to use.

@JayanAXHF JayanAXHF added A-codegen Area: Code generation A-CLI Area: Command-line interface (CLI) to the compiler labels Jan 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-CLI Area: Command-line interface (CLI) to the compiler A-codegen Area: Code generation S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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.

6 participants