Add suggestion to THIR unsafe_op_in_unsafe_fn lint
This commit is contained in:
parent
2b2c0f9886
commit
2b59992736
13 changed files with 381 additions and 54 deletions
|
@ -3566,6 +3566,15 @@ impl<'hir> OwnerNode<'hir> {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn fn_sig(self) -> Option<&'hir FnSig<'hir>> {
|
||||
match self {
|
||||
OwnerNode::TraitItem(TraitItem { kind: TraitItemKind::Fn(fn_sig, _), .. })
|
||||
| OwnerNode::ImplItem(ImplItem { kind: ImplItemKind::Fn(fn_sig, _), .. })
|
||||
| OwnerNode::Item(Item { kind: ItemKind::Fn(fn_sig, _, _), .. }) => Some(fn_sig),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn fn_decl(self) -> Option<&'hir FnDecl<'hir>> {
|
||||
match self {
|
||||
OwnerNode::TraitItem(TraitItem { kind: TraitItemKind::Fn(fn_sig, _), .. })
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue