We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a6036a commit 3a64befCopy full SHA for 3a64bef
compiler/rustc_passes/src/check_attr.rs
@@ -715,7 +715,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
715
attrs: &[Attribute],
716
) {
717
match target {
718
- Target::Fn => {
+ Target::Method(MethodKind::Trait { body: true } | MethodKind::Inherent)
719
+ | Target::Fn => {
720
// `#[target_feature]` is not allowed in lang items.
721
if let Some((lang_item, _)) = hir::lang_items::extract(attrs)
722
// Calling functions with `#[target_feature]` is
@@ -732,7 +733,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
732
733
});
734
}
735
- Target::Method(MethodKind::Trait { body: true } | MethodKind::Inherent) => {}
736
// FIXME: #[target_feature] was previously erroneously allowed on statements and some
737
// crates used this, so only emit a warning.
738
Target::Statement => {
0 commit comments