diff options
| author | Ralf Jung <post@ralfj.de> | 2024-12-15 11:20:00 +0100 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-12-15 11:23:21 +0100 |
| commit | 74e2ac406ba620aeff8732d2dde96c0839dcacbf (patch) | |
| tree | 8d94254081cefcbb996aa548e3e153c6c448a03c | |
| parent | 0c9d42cc56626bb383cbab3bb8529a8f1a117fed (diff) | |
| download | rust-74e2ac406ba620aeff8732d2dde96c0839dcacbf.tar.gz rust-74e2ac406ba620aeff8732d2dde96c0839dcacbf.zip | |
advice against negative features in target specs
Co-authored-by: Jubilee <workingjubilee@gmail.com>
| -rw-r--r-- | compiler/rustc_target/src/spec/mod.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index f7cf12215f3..a44d2af6b90 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -2213,6 +2213,10 @@ pub struct TargetOptions { /// `-Ctarget-cpu` but can be overwritten with `-Ctarget-features`. /// Corresponds to `llc -mattr=$features`. /// Note that these are LLVM feature names, not Rust feature names! + /// + /// Generally it is a bad idea to use negative target features because they often interact very + /// poorly with how `-Ctarget-cpu` works. Instead, try to use a lower "base CPU" and enable the + /// features you want to use. pub features: StaticCow<str>, /// Direct or use GOT indirect to reference external data symbols pub direct_access_external_data: Option<bool>, |
