-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Warn write-only fields #81473
Warn write-only fields #81473
Conversation
r? @oli-obk (rust-highfive has picked a reviewer for you, use r? to override) |
Co-authored-by: Oli Scherer <github35764891676564198441@oli-obk.de>
This comment has been minimized.
This comment has been minimized.
@bors r+ squash |
📌 Commit 85ad773 has been approved by |
Rollup of 16 pull requests Successful merges: - rust-lang#79023 (Add `core::stream::Stream`) - rust-lang#80562 (Consider Scalar to be a bool only if its unsigned) - rust-lang#80886 (Stabilize raw ref macros) - rust-lang#80959 (Stabilize `unsigned_abs`) - rust-lang#81291 (Support FRU pattern with `[feature(capture_disjoint_fields)]`) - rust-lang#81409 (Slight simplification of chars().count()) - rust-lang#81468 (cfg(version): treat nightlies as complete) - rust-lang#81473 (Warn write-only fields) - rust-lang#81495 (rustdoc: Remove unnecessary optional) - rust-lang#81499 (Updated Vec::splice documentation) - rust-lang#81501 (update rustfmt to v1.4.34) - rust-lang#81505 (`fn cold_path` doesn't need to be pub) - rust-lang#81512 (Add missing variants in match binding) - rust-lang#81515 (Fix typo in pat.rs) - rust-lang#81519 (Don't print error output from rustup when detecting default build triple) - rust-lang#81520 (Don't clone LLVM submodule when download-ci-llvm is set) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Consider auto derefs before warning about write only fields Changes from rust-lang#81473 extended the dead code lint with an ability to detect fields that are written to but never read from. The implementation skips over fields on the left hand side of an assignment, without marking them as live. A field access might involve an automatic dereference and de-facto read the field. Conservatively mark expressions with deref adjustments as live to avoid generating false positive warnings. Closes rust-lang#81626.
Consider auto derefs before warning about write only fields Changes from rust-lang#81473 extended the dead code lint with an ability to detect fields that are written to but never read from. The implementation skips over fields on the left hand side of an assignment, without marking them as live. A field access might involve an automatic dereference and de-facto read the field. Conservatively mark expressions with deref adjustments as live to avoid generating false positive warnings. Closes rust-lang#81626.
Consider auto derefs before warning about write only fields Changes from rust-lang#81473 extended the dead code lint with an ability to detect fields that are written to but never read from. The implementation skips over fields on the left hand side of an assignment, without marking them as live. A field access might involve an automatic dereference and de-facto read the field. Conservatively mark expressions with deref adjustments as live to avoid generating false positive warnings. Closes rust-lang#81626.
We discussed this PR in the compiler triage meeting. In short #81473 injected some issues, namely #81626 and #81658, that have leaked into the beta release.
We decided in the compiler triage meeting to revert #81473 on the 1.51 beta branch. We'll leave it in place on nightly 1.52 branch, since we expect #81658 will be resolved before the nightly-to-beta-1.52 promotion. I'll be posting a revert PR shortly. |
…-fields, r=Mark-Simulacrum Revert PR 81473 to resolve (on beta) issues 81626 and 81658. Revert PR rust-lang#81473 to resolve (on beta) issues rust-lang#81626 and rust-lang#81658. Revert "Add missing brace" This reverts commit 85ad773. Revert "Simplify base_expr" This reverts commit 899aae4. Revert "Warn write-only fields" This reverts commit d3c69a4.
cc @Boscop's example in #49256.