mozilla/rust — pull request #11135 by fhahn (2013-12-25 00:07:35+00:00)
Title: Lint for unnecessary type casts

This patch adds a lint for unnecessary casts and removes a couple of unnecessary casts as mentioned in the discussion of #7313.

The main problem I have with this lint is handling macros. Some macros contain typecasts, which are necessary for most expansions, but for some expansion they are unnecessary. This leads to a lot of, probably useless, lint warnings (/errors) during compilation.
I found no way to find out, if nodes in the ast were expanded from a macro, to disable type cast checks for macros. Is there a way to find out, if an expression was expanded from a macro during linting?