Closes #2569
This way it's much easier to add lints throughout compilation correctly, and functions on impls can alter the way lints are emitted.