]> git.lizzy.rs Git - rust.git/commit
dead-code lint: say "constructed" for structs
authorZack M. Davis <code@zackmdavis.net>
Sun, 22 Jul 2018 00:55:34 +0000 (17:55 -0700)
committerZack M. Davis <code@zackmdavis.net>
Sun, 22 Jul 2018 01:30:33 +0000 (18:30 -0700)
commit6c50ee5abc1f41aaf587f74cc317819ff8eca7d8
tree15e2270a8d94f6fa51c40ec1ae382b7743598014
parent874dec25ed4c08d36f17d396b6872ca50313fc8e
dead-code lint: say "constructed" for structs

This is a sequel to November 2017's #46103 / 1a9dc2e9. It had been
reported (more than onceā€”at least #19140, #44083, and #44565) that the
"never used" language was confusing for enum variants that were "used"
as match patterns, so the wording was changed to say never
"constructed" specifically for enum variants. More recently, the same
issue was raised for structs (#52325). It seems consistent to say
"constructed" here, too, for the same reasons.

We considered using more specific word "called" for unused functions
and methods (while we declined to do this in #46103, the rationale
given in the commit message doesn't actually make sense), but it turns
out that Cargo's test suite expects the "never used" message, and
maybe we don't care enough even to make a Cargo PR over such a petty
and subjective wording change.

This resolves #52325.
src/librustc/middle/dead.rs
src/test/compile-fail/lint-dead-code-1.rs
src/test/compile-fail/lint-dead-code-3.rs
src/test/ui/span/macro-span-replacement.rs
src/test/ui/span/macro-span-replacement.stderr
src/test/ui/span/unused-warning-point-at-signature.rs
src/test/ui/span/unused-warning-point-at-signature.stderr