Also forbid target_feature annotated methods from being lang items
This commit is contained in:
parent
5a6036a180
commit
3a64bef2ba
1 changed files with 2 additions and 2 deletions
|
@ -715,7 +715,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
|
||||||
attrs: &[Attribute],
|
attrs: &[Attribute],
|
||||||
) {
|
) {
|
||||||
match target {
|
match target {
|
||||||
Target::Fn => {
|
Target::Method(MethodKind::Trait { body: true } | MethodKind::Inherent)
|
||||||
|
| Target::Fn => {
|
||||||
// `#[target_feature]` is not allowed in lang items.
|
// `#[target_feature]` is not allowed in lang items.
|
||||||
if let Some((lang_item, _)) = hir::lang_items::extract(attrs)
|
if let Some((lang_item, _)) = hir::lang_items::extract(attrs)
|
||||||
// Calling functions with `#[target_feature]` is
|
// Calling functions with `#[target_feature]` is
|
||||||
|
@ -732,7 +733,6 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Target::Method(MethodKind::Trait { body: true } | MethodKind::Inherent) => {}
|
|
||||||
// FIXME: #[target_feature] was previously erroneously allowed on statements and some
|
// FIXME: #[target_feature] was previously erroneously allowed on statements and some
|
||||||
// crates used this, so only emit a warning.
|
// crates used this, so only emit a warning.
|
||||||
Target::Statement => {
|
Target::Statement => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue