about summary refs log tree commit diff
diff options
context:
space:
mode:
authorvarkor <github@varkor.com>2019-10-14 17:36:13 +0100
committervarkor <github@varkor.com>2019-10-25 23:28:50 +0100
commit6446f192c7aaf913fe32bbaf779b36d53936f867 (patch)
tree0a7234b9366a187b0665e1f3797bd278de59fab3
parente8566fba0e8b48ec2378301c34b5ecc91d331488 (diff)
downloadrust-6446f192c7aaf913fe32bbaf779b36d53936f867.tar.gz
rust-6446f192c7aaf913fe32bbaf779b36d53936f867.zip
Permit `#[target_feature]` on method implementations
-rw-r--r--src/librustc/hir/check_attr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc/hir/check_attr.rs b/src/librustc/hir/check_attr.rs
index 55ac95f4ac4..a67a4566615 100644
--- a/src/librustc/hir/check_attr.rs
+++ b/src/librustc/hir/check_attr.rs
@@ -278,7 +278,7 @@ impl CheckAttrVisitor<'tcx> {
     /// Checks if the `#[target_feature]` attribute on `item` is valid. Returns `true` if valid.
     fn check_target_feature(&self, attr: &Attribute, span: &Span, target: Target) -> bool {
         match target {
-            Target::Fn => true,
+            Target::Fn | Target::Method { body: true } => true,
             _ => {
                 self.tcx.sess
                     .struct_span_err(attr.span, "attribute should be applied to a function")