Report the unsafe_attr_outside_unsafe lint at the closest node

This commit is contained in:
Urgau
2025-05-03 15:19:08 +02:00
parent 74a17fd049
commit f4e1ec111c
5 changed files with 39 additions and 8 deletions

View File

@@ -828,7 +828,7 @@ fn validate_generic_param_order(dcx: DiagCtxtHandle<'_>, generics: &[GenericPara
impl<'a> Visitor<'a> for AstValidator<'a> {
fn visit_attribute(&mut self, attr: &Attribute) {
validate_attr::check_attr(&self.sess.psess, attr);
validate_attr::check_attr(&self.sess.psess, attr, self.lint_node_id);
}
fn visit_ty(&mut self, ty: &'a Ty) {