You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A-lintArea: 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.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
// The attribute around the whole FFI block works.#[allow(improper_ctypes)]extern{// But this one on an individual FFI item doesn't.#[allow(improper_ctypes)]fnexit(_:&String);}
The problem arises because the lint iterates over the children of ForeignMod (extern {...}):
if nmod.abi != Abi::RustIntrinsic && nmod.abi != Abi::PlatformIntrinsic{
for ni in&nmod.items{
and it does so through check_item, but only check_foreign_item would be affected by attributes on the individual foreign fn / static / type children of the extern {...} block. check_foreign_item could be used instead, with the small change that the abi has to be obtained from cx.tcx.hir.get_foreign_abi(ni.id), instead of nmod's field (as nmod would be gone).
The text was updated successfully, but these errors were encountered:
eddyb
added
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
labels
Jul 17, 2018
A-lintArea: 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.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
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_item
would be affected by attributes on the individual foreignfn
/static
/type
children of theextern {...}
block.check_foreign_item
could be used instead, with the small change that theabi
has to be obtained fromcx.tcx.hir.get_foreign_abi(ni.id)
, instead ofnmod
's field (asnmod
would be gone).cc @nikomatsakis @Manishearth
The text was updated successfully, but these errors were encountered: