Skip to content

Commit 74e2ac4

Browse files
advice against negative features in target specs
Co-authored-by: Jubilee <workingjubilee@gmail.com>
1 parent 0c9d42c commit 74e2ac4

File tree

1 file changed

+4
-0
lines changed
  • compiler/rustc_target/src/spec

1 file changed

+4
-0
lines changed

compiler/rustc_target/src/spec/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -2213,6 +2213,10 @@ pub struct TargetOptions {
22132213
/// `-Ctarget-cpu` but can be overwritten with `-Ctarget-features`.
22142214
/// Corresponds to `llc -mattr=$features`.
22152215
/// Note that these are LLVM feature names, not Rust feature names!
2216+
///
2217+
/// Generally it is a bad idea to use negative target features because they often interact very
2218+
/// poorly with how `-Ctarget-cpu` works. Instead, try to use a lower "base CPU" and enable the
2219+
/// features you want to use.
22162220
pub features: StaticCow<str>,
22172221
/// Direct or use GOT indirect to reference external data symbols
22182222
pub direct_access_external_data: Option<bool>,

0 commit comments

Comments
 (0)