diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2023-05-03 16:42:47 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-03 16:42:47 -0700 |
| commit | 84d8159ebff3ba1d21da0affb53ed1d4b582ec12 (patch) | |
| tree | 8b76f3ee0b6e3efdc43eb94a4bca4741101e8a0c /tests/codegen/src-hash-algorithm | |
| parent | 473f916d836cc662c5bdbb0d40af9fb4678fab9e (diff) | |
| parent | de105164ea8733b2cab14cf8920f859a17574715 (diff) | |
| download | rust-84d8159ebff3ba1d21da0affb53ed1d4b582ec12.tar.gz rust-84d8159ebff3ba1d21da0affb53ed1d4b582ec12.zip | |
Rollup merge of #97594 - WaffleLapkin:array_tuple_conv, r=ChrisDenton
Implement tuple<->array convertions via `From`
This PR adds the following impls that convert between homogeneous tuples and arrays of the corresponding lengths:
```rust
impl<T> From<[T; 1]> for (T,) { ... }
impl<T> From<[T; 2]> for (T, T) { ... }
/* ... */
impl<T> From<[T; 12]> for (T, T, T, T, T, T, T, T, T, T, T, T) { ... }
impl<T> From<(T,)> for [T; 1] { ... }
impl<T> From<(T, T)> for [T; 2] { ... }
/* ... */
impl<T> From<(T, T, T, T, T, T, T, T, T, T, T, T)> for [T; 12] { ... }
```
IMO these are quite uncontroversial but note that they are, just like any other trait impls, insta-stable.
Diffstat (limited to 'tests/codegen/src-hash-algorithm')
0 files changed, 0 insertions, 0 deletions
