-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dead-code lint: say "constructed" for structs #52332
dead-code lint: say "constructed" for structs #52332
Conversation
r? @pnkfelix (rust_highfive has picked a reviewer for you, use r? to override) |
The job Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
acccb8d
to
8cc4fd6
Compare
I agree with this PR's change of "constructed" instead of "used". As for the broader change... I didn't mind the previous terminology of "use" instead of where it says "call" here, but I don't particularly care either way. If people like "call" then fine. I guess I'll just let this land and if someone complains we can change it back. |
@bors r+ |
📌 Commit 8cc4fd6 has been approved by |
…y_2_electric_boogaloo, r=pnkfelix dead-code lint: say "constructed", "called" for structs, functions Respectively. This is a sequel to November 2017's rust-lang#46103 / 1a9dc2e. It had been reported (more than once—at least rust-lang#19140, rust-lang#44083, and rust-lang#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 (rust-lang#52325). It seems consistent to say "constructed" here, too, for the same reasons. While we're here, we can also use more specific word "called" for unused functions and methods. (We declined to do this in rust-lang#46103, but the rationale given in the commit message doesn't actually make sense.) This resolves rust-lang#52325.
Rollup of 16 pull requests Successful merges: - #51962 (Provide llvm-strip in llvm-tools component) - #52003 (Implement `Option::replace` in the core library) - #52156 (Update std::ascii::ASCIIExt deprecation notes) - #52242 (NLL: Suggest `ref mut` and `&mut self`) - #52244 (Don't display default generic parameters in diagnostics that compare types) - #52290 (Deny bare trait objects in src/librustc_save_analysis) - #52293 (Deny bare trait objects in librustc_typeck) - #52299 (Deny bare trait objects in src/libserialize) - #52300 (Deny bare trait objects in librustc_target and libtest) - #52302 (Deny bare trait objects in the rest of rust) - #52310 (Backport 1.27.1 release notes to master) - #52314 (Fix ICE when using a pointer cast as array size) - #52315 (Resolve FIXME(#27942)) - #52316 (task: remove wrong comments about non-existent LocalWake trait) - #52322 (Update llvm-rebuild-trigger in light of LLVM 7 upgrade) - #52332 (dead-code lint: say "constructed", "called" for structs, functions) Failed merges: r? @ghost
@bors r- |
@zackmdavis the simplest solution might to be continue using the word "used" instead of "called" for functions, since it seems like cargo's test suite has that phrasing built into their current test suite. (Otherwise I don't know how easy it would be to update cargo's test suite in sync with making the change to the wording proposed here.) |
Yes, have to leave now, but I can revise this PR tonight. Updating Cargo's tests wouldn't be difficult, but I'm not actually super-passionate about "called" |
(Okay, maybe not tonight tonight, but soon) |
This is a sequel to November 2017's rust-lang#46103 / 1a9dc2e. It had been reported (more than once—at least rust-lang#19140, rust-lang#44083, and rust-lang#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 (rust-lang#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 rust-lang#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 rust-lang#52325.
8cc4fd6
to
6c50ee5
Compare
@pnkfelix updated 🏁 |
Ping from triage @pnkfelix! This PR needs your review. |
@bors r+ rollup |
📌 Commit 6c50ee5 has been approved by |
…y_2_electric_boogaloo, r=pnkfelix dead-code lint: say "constructed" for structs Respectively. This is a sequel to November 2017's rust-lang#46103 / 1a9dc2e. It had been reported (more than once—at least rust-lang#19140, rust-lang#44083, and rust-lang#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 (rust-lang#52325). It seems consistent to say "constructed" here, too, for the same reasons. ~~While we're here, we can also use more specific word "called" for unused functions and methods. (We declined to do this in rust-lang#46103, but the rationale given in the commit message doesn't actually make sense.)~~ This resolves rust-lang#52325.
Rollup of 31 pull requests Successful merges: - #52332 (dead-code lint: say "constructed" for structs) - #52340 (Document From trait implementations for OsStr, OsString, CString, and CStr) - #52628 (Cleanup some rustdoc code) - #52732 (Remove unstable and deprecated APIs) - #52745 (Update clippy to latest master) - #52756 (rustc: Disallow machine applicability in foreign macros) - #52771 (Clarify thread::park semantics) - #52810 ([NLL] Don't make "fake" match variables mutable) - #52821 (pretty print for std::collections::vecdeque) - #52822 (Fix From<LocalWaker>) - #52824 (Fix -Wpessimizing-move warnings in rustllvm/PassWrapper) - #52831 (remove references to AUTHORS.txt file) - #52835 (Fix Alias intra doc ICE) - #52842 (update comment) - #52846 (Add timeout to use of `curl` in bootstrap.py.) - #52851 (Make the tool_lints actually usable) - #52853 (Improve bootstrap help on stages) - #52859 (Use Vec::extend in SmallVec::extend when applicable) - #52861 (Add targets for HermitCore (https://hermitcore.org) to the Rust compiler and port libstd to it.) - #52867 (releases.md: fix 2 typos) - #52870 (Implement Unpin for FutureObj and LocalFutureObj) - #52876 (run-pass/const-endianness: negate before to_le()) - #52878 (Fix wrong issue number in the test name) - #52883 (Include lifetime in mutability suggestion in NLL messages) - #52904 (NLL: sort diagnostics by span) - #52905 (Fix a typo in unsize.rs) - #52907 (NLL: On "cannot move out of type" error, print original before rewrite) - #52908 (Use SetLenOnDrop in Vec::truncate()) - #52914 (Only run the sparc-abi test on sparc) - #52918 (Backport 1.27.2 release notes) - #52929 (Update compatibility note for 1.28.0 to be correct) Failed merges: - #52758 (Cleanup for librustc::session) - #52799 (Use BitVector for global sets of AttrId) r? @ghost
@bors r- rollup- RLS's test cases need to be updated as well. It contained 3 tests which still expects the old error messages. See #52931 (comment) |
↑ (This was sufficiently demoralizing and #52325 is sufficiently low-priority that I'm just going to close this for now to get it out of the way.) |
Hm, I don't quite follow -- why are we blocking this on RLS test cases? We should be able to land things in tree even if they break RLS, no? |
This PR was r+'ed during the beta week unfortunately 🙁. |
@bors r=pnkfelix We should see if there's something we can do to provide better feedback for that case. |
📌 Commit 6c50ee5 has been approved by |
@bors rollup since we're outside the beta week now. |
…c_boogaloo, r=pnkfelix dead-code lint: say "constructed" for structs Respectively. This is a sequel to November 2017's #46103 / 1a9dc2e. 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. ~~While we're here, we can also use more specific word "called" for unused functions and methods. (We declined to do this in #46103, but the rationale given in the commit message doesn't actually make sense.)~~ This resolves #52325.
☀️ Test successful - status-appveyor, status-travis |
Tested on commit rust-lang/rust@7c98d2e. Direct link to PR: <rust-lang/rust#52332> 💔 rls on windows: test-pass → test-fail (cc @nrc, @rust-lang/infra). 💔 rls on linux: test-pass → test-fail (cc @nrc, @rust-lang/infra).
Respectively.
This is a sequel to November 2017's #46103 / 1a9dc2e. 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.
While we're here, we can also use more specific word "called" for unusedfunctions and methods. (We declined to do this in #46103, but the
rationale given in the commit message doesn't actually make sense.)
This resolves #52325.