Add hir::HeaderSafety to make follow up commits simpler

This commit is contained in:
Oli Scherer 2024-12-13 12:19:46 +00:00
parent f5864d7137
commit 44560cbd79
8 changed files with 10 additions and 10 deletions

View file

@ -541,7 +541,7 @@ fn check_mut_from_ref<'tcx>(cx: &LateContext<'tcx>, sig: &FnSig<'_>, body: Optio
.collect();
if let Some(args) = args
&& !args.is_empty()
&& body.is_none_or(|body| sig.header.safety.is_unsafe() || contains_unsafe_block(cx, body.value))
&& body.is_none_or(|body| sig.header.is_unsafe() || contains_unsafe_block(cx, body.value))
{
span_lint_and_then(
cx,