-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
improper_ctypes lint unaffected by lint attributes on the foreign items themselves. #52456
Copy link
Copy link
Closed
Closed
Copy link
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The problem arises because the lint iterates over the children of
ForeignMod(extern {...}):rust/src/librustc_lint/types.rs
Lines 788 to 792 in 2ddc0cb
and it does so through
check_item, but onlycheck_foreign_itemwould be affected by attributes on the individual foreignfn/static/typechildren of theextern {...}block.check_foreign_itemcould be used instead, with the small change that theabihas to be obtained fromcx.tcx.hir.get_foreign_abi(ni.id), instead ofnmod's field (asnmodwould be gone).cc @nikomatsakis @Manishearth