Skip to content

rename internal_target_features β†’ rust_target_features - #166673

Open
RalfJung wants to merge 1 commit into
rust-lang:mainfrom
RalfJung:sess-target-features
Open

RalfJung wants to merge 1 commit into
rust-lang:mainfrom
RalfJung:sess-target-features

Conversation

@RalfJung

@RalfJung RalfJung commented Nov 27, 2026 •

Copy link
Copy Markdown
Member

Rename internal_target_features β†’ rust_target_features and global_backend_features β†’ backend_target_features.
I think that makes their role more clear.

Also updated some outdated comments I noticed along the way.

Basically, after some of the recent cleanup by @nnethercote and after #166008, the initialization flow is now:

  • compute "base" backend target features (does not include -Ctarget-feature) -- this only happens once (unlike in the past where we repeated this a lot)
  • then, separately
    • compute Rust target features from that, and add -Ctarget-feature, and then compute cfg(target_features) from that
    • add -Ctarget-feature to the backend target feature list and store that in sess.backend_target_features so it later gets used by codegen

In my head this is kind of clean now but in the code it's still rather messy, and I am not sure what would be a good central place to document this overall flow.

r? @nnethercote

@rustbot

rustbot commented Nov 27, 2026

Copy link
Copy Markdown
Collaborator

Some changes occurred in cfg and check-cfg configuration

cc @Urgau

rustc_codegen_cranelift is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_cranelift instead.

cc @bjorn3

rustc_codegen_gcc is developed in its own repository. If possible, consider making this change to rust-lang/rustc_codegen_gcc instead.

cc @antoyo, @GuillaumeGomez

miri is developed in its own repository. If the Miri part of this change can be broken out, consider making this change to rust-lang/miri instead. However, if Miri needs adjusting for rustc changes, just ignore this message.

cc @rust-lang/miri

@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. 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 Nov 27, 2026
@rust-log-analyzer

This comment has been minimized.

@RalfJung
RalfJung force-pushed the sess-target-features branch from 52592ea to dfac36c Compare November 27, 2026 19:30
@rustbot rustbot added the A-rustdoc-json Area: Rustdoc JSON backend label Nov 27, 2026
@RalfJung
RalfJung force-pushed the sess-target-features branch from dfac36c to 6515404 Compare November 27, 2026 19:33

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-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustdoc-json Area: Rustdoc JSON backend 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.

4 participants