]> git.lizzy.rs Git - rust.git/commitdiff
rustc: Blanket whitelist `#[target_feature]`
authorAlex Crichton <alex@alexcrichton.com>
Fri, 20 Apr 2018 00:54:20 +0000 (17:54 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 20 Apr 2018 00:54:20 +0000 (17:54 -0700)
This commit transitions the `target_feature` attribute from `Normal` to
`Whitelisted`. Discovered in #50095 the fact of whether this attribute is used
or not is dependent on typechecking running and executing `check_name`, but
incremental compilation doesn't currently account for this, meaning that the
attribute ends up being flagged as unused when it shouldn't be.

I was a little too ambitious it seems hoping that `Normal` could be used, so
instead this transitions to `Whitelisted` to be the same as other codegen
attributes like `#[inline]`

Closes #50095

src/libsyntax/feature_gate.rs

index 7b7cfe5eea00b72a945a70e0f560de5084e4aa01..21d0fecea216394d7c65f1f67ee9b9bda10c29f7 100644 (file)
@@ -921,7 +921,7 @@ pub fn is_builtin_attr(attr: &ast::Attribute) -> bool {
                                  "the `#[naked]` attribute \
                                   is an experimental feature",
                                  cfg_fn!(naked_functions))),
-    ("target_feature", Normal, Ungated),
+    ("target_feature", Whitelisted, Ungated),
     ("export_name", Whitelisted, Ungated),
     ("inline", Whitelisted, Ungated),
     ("link", Whitelisted, Ungated),