mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-04 13:02:50 -05:00
The check did not read lint attributes inside cfg_attr at all, and it does not evaluate cfg conditions. Two roots passed although the condition all() is always true: - #![cfg_attr(all(), forbid(unsafe_code))] with doc-test deny: the library forbids unsafe code, so its doc tests need forbid. - #![doc(test(attr(deny(unsafe_code), cfg_attr(all(), allow(unsafe_code)))))]: the allow lowers the deny. A cfg_attr now counts only in the direction that is never too lenient: a forbid inside one asks the doc tests for forbid, and an allow, warn or expect inside one lowers the doc tests' level. A deny or forbid inside cfg_attr in the doc-test list still does not count. The comment and literal scanner also skips raw C strings (cr"..."), so text such as #![forbid(unsafe_code)] inside one is not read as an attribute. Tests cover each case.