Skip to content
/ rust Public
forked from rust-lang/rust

Commit

Permalink
advice against negative features in target specs
Browse files Browse the repository at this point in the history
Co-authored-by: Jubilee <[email protected]>
  • Loading branch information
RalfJung and workingjubilee committed Dec 15, 2024
1 parent 0c9d42c commit 74e2ac4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/rustc_target/src/spec/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down

0 comments on commit 74e2ac4

Please sign in to comment.