about summary refs log tree commit diff
path: root/compiler/rustc_middle
diff options
context:
space:
mode:
authorCaleb Zulawski <caleb.zulawski@gmail.com>2024-08-04 23:51:59 -0400
committerCaleb Zulawski <caleb.zulawski@gmail.com>2024-08-07 00:43:52 -0400
commit83276f568032f14b1af7e5cd9f7d928734af8d09 (patch)
treef137dd36c2b2121ecf72e267ec6fc2d7ba87cf73 /compiler/rustc_middle
parent6b96a60611c5edaa107b109b5a50e58a64a33fc2 (diff)
downloadrust-83276f568032f14b1af7e5cd9f7d928734af8d09.tar.gz
rust-83276f568032f14b1af7e5cd9f7d928734af8d09.zip
Hide implicit target features from diagnostics when possible
Diffstat (limited to 'compiler/rustc_middle')
-rw-r--r--compiler/rustc_middle/src/middle/codegen_fn_attrs.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs b/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs
index ff6a3a9c12d..b7d290e58d2 100644
--- a/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs
+++ b/compiler/rustc_middle/src/middle/codegen_fn_attrs.rs
@@ -28,7 +28,7 @@ pub struct CodegenFnAttrs {
     pub link_ordinal: Option<u16>,
     /// The `#[target_feature(enable = "...")]` attribute and the enabled
     /// features (only enabled features are supported right now).
-    pub target_features: Vec<Symbol>,
+    pub target_features: Vec<TargetFeature>,
     /// The `#[linkage = "..."]` attribute on Rust-defined items and the value we found.
     pub linkage: Option<Linkage>,
     /// The `#[linkage = "..."]` attribute on foreign items and the value we found.
@@ -52,6 +52,15 @@ pub struct CodegenFnAttrs {
 }
 
 #[derive(Copy, Clone, Debug, TyEncodable, TyDecodable, HashStable)]
+pub struct TargetFeature {
+    /// The name of the target feature (e.g. "avx")
+    pub name: Symbol,
+    /// The feature is implied by another feature, rather than explicitly added by the
+    /// `#[target_feature]` attribute
+    pub implied: bool,
+}
+
+#[derive(Copy, Clone, Debug, TyEncodable, TyDecodable, HashStable)]
 pub struct PatchableFunctionEntry {
     /// Nops to prepend to the function
     prefix: u8,