144862ede8
Add check_unused_messages in tidy From https://github.com/rust-lang/rust/pull/115728#issuecomment-1715490553 The check is not 100% accurate, I guess it's enough for now.
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.