Skip to content

Check supported features per CodegenBackend - #164714

Draft
TechnoPorg wants to merge 1 commit into
rust-lang:mainfrom
TechnoPorg:codegen-backend-supported-features
Draft

TechnoPorg wants to merge 1 commit into
rust-lang:mainfrom
TechnoPorg:codegen-backend-supported-features

Conversation

@TechnoPorg

@TechnoPorg TechnoPorg commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Closes #164533

Of the possible designs discussed in that issue, this goes with the struct option rather than the CodegenBackend method option, as the former is easier to attach to Session, whereas the latter would require passing around the CodegenBackend.

There is a remarkable number of LLVM-specific compiler options that get ignored by other backends, and I'm not sure which of these, if any, we should attempt to validate with other backends.

This PR is a draft because I'm not familiar enough with the compiler yet to say what the best design is, and I think it's easier to iterate on it with actual code in front of us:

  • Should all the validation be done at once when creating the Session, rather than in its methods?
    • If yes, a method to check supported features might be better than the struct
  • As mentioned above, which features should be validated vs. ignored?

r? @ZuseZ4

cc @RalfJung, @antoyo, @GuillaumeGomez, @bjorn3 as participants on the issue thread.
@rustbot label C-cleanup T-compiler A-codegen

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-codegen Area: Code generation C-cleanup Category: PRs that clean code up or issues documenting cleanup. labels Oct 22, 2026
@rust-log-analyzer

This comment has been minimized.

@rustbot rustbot added the PG-exploit-mitigations Project group: Exploit mitigations label Oct 24, 2026
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Comment thread tests/ui/sanitizer/leak.rs Resolved
@TechnoPorg
TechnoPorg force-pushed the codegen-backend-supported-features branch from d911333 to 5a76d73 Compare October 28, 2026 23:42
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Oct 28, 2026
@rust-log-analyzer

This comment has been minimized.

@TechnoPorg
TechnoPorg force-pushed the codegen-backend-supported-features branch 2 times, most recently from 7d42993 to 303edbe Compare October 29, 2026 12:40
@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Oct 29, 2026
@TechnoPorg
TechnoPorg force-pushed the codegen-backend-supported-features branch from 303edbe to d009976 Compare October 30, 2026 12:46
@rust-bors

rust-bors Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

☔ The latest upstream changes (presumably #165918) made this pull request unmergeable. Please resolve the merge conflicts by rebasing.

This branch has not been deployed

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

Labels

A-codegen Area: Code generation A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-testsuite Area: The testsuite used to check the correctness of rustc C-cleanup Category: PRs that clean code up or issues documenting cleanup. PG-exploit-mitigations Project group: Exploit mitigations S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) 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.

Add CodegenBackend method to check supported features

5 participants