Rollup merge of #134285 - oli-obk:push-vwrqsqlwnuxo, r=Urgau
Add some convenience helper methods on `hir::Safety` Makes a lot of call sites simpler and should make any refactorings needed for https://github.com/rust-lang/rust/pull/134090#issuecomment-2541332415 simpler, as fewer sites have to be touched in case we end up storing some information in the variants of `hir::Safety`
This commit is contained in:
commit
d48af09ffd
28 changed files with 74 additions and 70 deletions
|
@ -715,7 +715,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
|
|||
attrs: &[Attribute],
|
||||
) {
|
||||
match target {
|
||||
Target::Fn => {
|
||||
Target::Method(MethodKind::Trait { body: true } | MethodKind::Inherent)
|
||||
| Target::Fn => {
|
||||
// `#[target_feature]` is not allowed in lang items.
|
||||
if let Some((lang_item, _)) = hir::lang_items::extract(attrs)
|
||||
// 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
|
||||
// crates used this, so only emit a warning.
|
||||
Target::Statement => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue