diff options
| author | bors <bors@rust-lang.org> | 2023-07-13 08:39:33 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-07-13 08:39:33 +0000 |
| commit | 631faa1bc7601b31f6256693558eea967515a5cf (patch) | |
| tree | 5bd2263cd938da95da532af21cf7368ed699054a /compiler/rustc_codegen_llvm/src | |
| parent | b10a0aa057c619a2bacc5a9581d9fcbbf1ad09f9 (diff) | |
| parent | 4102a309d782522a2a6f378ec748cb3a3a4fed8d (diff) | |
| download | rust-631faa1bc7601b31f6256693558eea967515a5cf.tar.gz rust-631faa1bc7601b31f6256693558eea967515a5cf.zip | |
Auto merge of #11146 - hydro-project:tuple-array-conversions, r=Centri3,xFrednet
[`tuple_array_conversions`]: move from `complexity` to `nursery` The lint suggestion is arguably often less readable and more complex than the original code. For example, which of the following is the most readable: ```rust let _vertices = edges.flat_map(|(src, dst)| [src, dst]); let _vertices = edges.flat_map(<_ as Into<[i32; 2]>>::into); let _vertices = edges.flat_map(<[i32; 2]>::from); ``` The lint can be useful, but really only applies if the tuple is either long enough that naming the fields is silly (maybe at least 4 entries long), or if the author intends the fields to be homogenous, which is author intent and can't be determined by the lint. Therefore I think the lint should be marked as pedantic. Currently, there are also a lot of false positives with the lint: * https://github.com/rust-lang/rust-clippy/issues/11082 * https://github.com/rust-lang/rust-clippy/issues/11085 * https://github.com/rust-lang/rust-clippy/issues/11100 (https://github.com/rust-lang/rust-clippy/pull/11105) * https://github.com/rust-lang/rust-clippy/issues/11124 * https://github.com/rust-lang/rust-clippy/issues/11144 Should fix those issues before enabling it for everyone. --- changelog: Move [`tuple_array_conversions`] to `nursery` (Now allow-by-default) <!-- FIY: Ignore this change, if the commit gets backported --> [#11146](https://github.com/rust-lang/rust-clippy/pull/11146)
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions
