my favourite is the way rust does it: #[expect(whatever)] will emit a warning if no warning of category whatever is emitted. if you refactor things and that warning is no longer relevant, you need to remove the suppression, and using expect instead of allow is perfect for that.
View all comments
Show parent comment
7
u/Prawn1908 3h ago
Exactly. Warnings either get corrected or locally suppressed with a comment right above the
#pragmaexplaining exactly why it's safe.