diff options
| author | bors <bors@rust-lang.org> | 2021-07-17 22:51:07 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-17 22:51:07 +0000 |
| commit | eb0b95b55a0b38d91e834dd30902b67627ed2eb0 (patch) | |
| tree | 79654f38a443096137846f8e7f0a781b738ced16 /compiler/rustc_builtin_macros/src/source_util.rs | |
| parent | c7331d65bdbab1187f5a9b8f5b918248678ebdb9 (diff) | |
| parent | dc639c944af8a47c5017317eebe2764087c8f776 (diff) | |
| download | rust-eb0b95b55a0b38d91e834dd30902b67627ed2eb0.tar.gz rust-eb0b95b55a0b38d91e834dd30902b67627ed2eb0.zip | |
Auto merge of #87129 - FabianWolff:issue-75356, r=varkor
Warn about useless assignments of variables/fields to themselves This PR fixes #75356. Following `@varkor's` suggestion in https://github.com/rust-lang/rust/issues/75356#issuecomment-700339154, I have implemented this warning as part of the `dead_code` lint. Unlike the `-Wself-assign` implementation in [Clang](https://github.com/llvm/llvm-project/blob/56e6d4742e6909bd7d2db201cc5e0e3e77c6f282/clang/lib/Sema/SemaExpr.cpp#L13875-L13909), my implementation also warns about self-assignments of struct fields (`s.x = s.x`). r? `@varkor`
Diffstat (limited to 'compiler/rustc_builtin_macros/src/source_util.rs')
0 files changed, 0 insertions, 0 deletions
