1
Fork 0

Rollup merge of #126177 - carbotaniuman:unsafe_attr_errors, r=jieyouxu

Add hard error and migration lint for unsafe attrs

More implementation work for https://github.com/rust-lang/rust/issues/123757

This adds the migration lint for unsafe attributes, as well as making it a hard error in Rust 2024.
This commit is contained in:
Matthias Krüger 2024-06-24 06:27:12 +02:00 committed by GitHub
commit 9a591ea1ce
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 473 additions and 53 deletions

View file

@ -1883,7 +1883,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
let mut span: Option<Span> = None;
while let Some(attr) = attrs.next() {
rustc_ast_passes::feature_gate::check_attribute(attr, self.cx.sess, features);
validate_attr::check_attr(&self.cx.sess.psess, attr);
validate_attr::check_attr(features, &self.cx.sess.psess, attr);
let current_span = if let Some(sp) = span { sp.to(attr.span) } else { attr.span };
span = Some(current_span);