A type declared with typedef inside a function is never used

tx0/c:unused-local-typedefrecommendedwarningmaintainability/dead-codedepth fastsmell

What it finds

A typedef in a block that nothing in the block refers to is left over from code that was removed or never written.

From the rule's source, unused_local_typedef.rs.

Example from the rule's tests
int sum(const int *items, int n){  typedef unsigned long wide;tx0 reports: the type wide is never used  int total = 0;  for (int i = 0; i < n; i++)    total += items[i];  return total;}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/c:unused-local-typedef" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/c:unused-local-typedef] reason="..."

tx0 explain tx0/c:unused-local-typedef shows the same in the terminal. Found a false positive? Report it.