1
Fork 0

Adjust #[no_mangle]-related checks and lints for impl items

This commit is contained in:
hyd-dev 2021-08-08 02:10:57 +08:00
parent c84beefd83
commit 0bb2ea653e
No known key found for this signature in database
GPG key ID: 74FA7FD5B8DA14B8
13 changed files with 573 additions and 56 deletions

View file

@ -1499,6 +1499,10 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
}
fn visit_assoc_item(&mut self, item: &'a AssocItem, ctxt: AssocCtxt) {
if self.session.contains_name(&item.attrs, sym::no_mangle) {
self.check_nomangle_item_asciionly(item.ident, item.span);
}
if ctxt == AssocCtxt::Trait || !self.in_trait_impl {
self.check_defaultness(item.span, item.kind.defaultness());
}