Description
The source_scopes
field of mir::Body
contains a lint_root
HirId
for figuring out the correct lint levels when reporting lints in MIR processing. Not only does this break our abstractions between HIR and MIR, this makes inlining functions from other crates super weird, because right now we just outright stop reporting any lints on the code from the other crates, no matter who wrote any kind of lint level.
We should instead figure out a system that stores all the lint level information directly in the MIR. To prevent duplication between mir bodies, we should consider some interning scheme (e.g. a query taking a DefId
and returning an interned lint level information struct that may have a parent
field pointing to the parent lint level datastructure).