How do I get the lint level from a Visitor given a Block?
问题 For various reasons I use a Visitor for the HIR tree traversal instead of relying on the lint context to walk the tree. However, this means my lint ignores #[allow/warn/deny(..)] annotations in the source. How can I get this back? I know of ctxt.levels , but those don't appear to help. The other functions (like with_lint_attrs(..) are private to the context. 回答1: Since there was no solution with the Rust we had, I created the necessary callbacks in Rustc: With tonight's nightly, our