about summary refs log tree commit diff
diff options
context:
space:
mode:
authorTrevor Gross <t.gross35@gmail.com>2025-04-29 12:28:25 -0400
committerGitHub <noreply@github.com>2025-04-29 12:28:25 -0400
commit561f6a13094100ad0023b3c8a92f643165ae1cfc (patch)
treea62cf71ed7c3990aa2f997267883053e6b27b420
parent1d642e5e4a4102a000dd09d318d205583564ff1b (diff)
parente3458dcf19cce424205eac5274ee1594c1413c72 (diff)
downloadrust-561f6a13094100ad0023b3c8a92f643165ae1cfc.tar.gz
rust-561f6a13094100ad0023b3c8a92f643165ae1cfc.zip
Rollup merge of #140432 - tgross35:target-config-docs-update, r=jieyouxu
Update documentation for `fn target_config`

This was missed as part of [1].

[1]: https://github.com/rust-lang/rust/pull/140323
-rw-r--r--compiler/rustc_codegen_ssa/src/traits/backend.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_codegen_ssa/src/traits/backend.rs b/compiler/rustc_codegen_ssa/src/traits/backend.rs
index e6b50cc7c0c..e2f1458d062 100644
--- a/compiler/rustc_codegen_ssa/src/traits/backend.rs
+++ b/compiler/rustc_codegen_ssa/src/traits/backend.rs
@@ -45,15 +45,14 @@ pub trait CodegenBackend {
 
     fn print(&self, _req: &PrintRequest, _out: &mut String, _sess: &Session) {}
 
-    /// Returns two feature sets:
-    /// - The first has the features that should be set in `cfg(target_features)`.
-    /// - The second is like the first, but also includes unstable features.
-    ///
-    /// RUSTC_SPECIFIC_FEATURES should be skipped here, those are handled outside codegen.
+    /// Collect target-specific options that should be set in `cfg(...)`, including
+    /// `target_feature` and support for unstable float types.
     fn target_config(&self, _sess: &Session) -> TargetConfig {
         TargetConfig {
             target_features: vec![],
             unstable_target_features: vec![],
+            // `true` is used as a default so backends need to acknowledge when they do not
+            // support the float types, rather than accidentally quietly skipping all tests.
             has_reliable_f16: true,
             has_reliable_f16_math: true,
             has_reliable_f128: true,