about summary refs log tree commit diff
path: root/src/test/ui/lint/dead-code/lint-dead-code-4.stderr
AgeCommit message (Collapse)AuthorLines
2023-01-11Move /src/test to /testsAlbert Larsan-66/+0
2022-06-22Rewrite dead-code pass to avoid fetching HIR.Camille GILLOT-3/+3
2022-06-22Uniform spans in dead code lint.Camille GILLOT-15/+11
2022-06-19collapse dead code warnings into a single diagnosticTakayuki Maeda-28/+26
add comments in `store_dead_field_or_variant` support multiple log level add a item ident label fix ui tests fix a ui test fix a rustdoc ui test use let chain refactor: remove `store_dead_field_or_variant` fix a tiny bug
2020-01-24Normalise notes with the/isvarkor-1/+1
2019-11-16Use "field is never read" instead of "field is never used"cosine-5/+5
2019-10-26Use ident instead of def_span in dead-code passPi Lanningham-2/+2
According to @estebank, def_span scans forward on the line until it finds a {, and if it can't find one, fallse back to the span for the whole item. This was apparently written before the identifier span was explicitly tracked on each node. This means that if an unused function signature spans multiple lines, the entire function (potentially hundreds of lines) gets flagged as dead code. This could, for example, cause IDEs to add error squiggly's to the whole function. By using the span from the ident instead, we narrow the scope of this in most cases. In a wider sense, it's probably safe to use ident.span instead of def_span in most locations throughout the whole code base, but since this is my first contribution, I kept it small. Some interesting points that came up while I was working on this: - I reorganized the tests a bit to bring some of the dead code ones all into the same location - A few tests were for things unrelated to dead code (like the path-lookahead for parens), so I added #![allow(dead_code)] and cleaned up the stderr file to reduce noise in the future - The same fix doesn't apply to const and static declarations. I tried adding these cases to the match expression, but that created a much wider change to tests and error messages, so I left it off until I could get some code review to validate the approach.
2019-10-26Move dead_code related tests to test/ui/dead-codePi Lanningham-0/+72
This helps organize the tests better. I also renamed several of the tests to remove redundant dead-code in the path, and better match what they're testing