Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd a lint for unused type parameters #26684
Conversation
rust-highfive
assigned
nikomatsakis
Jun 30, 2015
This comment has been minimized.
This comment has been minimized.
|
(rust_highfive has picked a reviewer for you, use r? to override) |
huonw
reviewed
Jun 30, 2015
| @@ -63,6 +63,7 @@ | |||
| #![feature(no_std)] | |||
| #![no_std] | |||
| #![allow(raw_pointer_derive)] | |||
| #![allow(unused_type_parameters)] | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
huonw
Jun 30, 2015
Member
Oh, hm. Shouldn't extern fns with type params consider them used? (But, in general, it makes sense that there may be a few things like that.)
This comment has been minimized.
This comment has been minimized.
|
It looks like there's a number of legitimate use cases for having "unused" parameters, so can this be an allow-by-default lint instead of warn-by-default? |
This comment has been minimized.
This comment has been minimized.
|
The reason this is a lint (and not a hard error, unlike |
This comment has been minimized.
This comment has been minimized.
|
I understand my viewpoint on whether lints should be warn by default is subject, by my believe is that any false positive on a lint means that it should not be warn-by-default. I've found that over time projects end up gaining dozens of little |
This comment has been minimized.
This comment has been minimized.
|
This is not the first time you argued for allow-by-default. In #10477 you wrote:
But dead_code lint was accepted warn-by-default. I am curious what changed your mind, because like @huonw on that thread, I think this should be warn-by-default. |
sanxiyn
referenced this pull request
Jul 1, 2015
Closed
Should have lint to disallow unused type parameters #25871
This comment has been minimized.
This comment has been minimized.
I agree! I have historically been very anti-lints as I feel we have far too many already and generate too many warnings for false positives.
Right, but that was almost two years ago. I would want it to be allow-by-default today. |
This comment has been minimized.
This comment has been minimized.
|
This is an interesting discussion. I wonder if we should adopt the convention that you can write |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
Closing due to inactivity, but feel free to resubmit with a rebase! |
sanxiyn commentedJun 30, 2015
Fix #25871.