Skip to content

Commit bf185b6

Browse files
bors[bot]burrbull
andauthored
Merge #14
14: const generics r=eldruin a=burrbull Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
2 parents b2fd84b + 29f42a4 commit bf185b6

File tree

5 files changed

+9
-54
lines changed

5 files changed

+9
-54
lines changed

.github/bors.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ status = [
55
"ci-linux (stable, x86_64-unknown-linux-gnu)",
66
"ci-linux (stable, thumbv6m-none-eabi)",
77
"ci-linux (stable, thumbv7m-none-eabi)",
8-
"ci-linux (1.37.0, x86_64-unknown-linux-gnu)",
8+
"ci-linux (1.51.0, x86_64-unknown-linux-gnu)",
99
]

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
include:
1919
# Test MSRV
20-
- rust: 1.37.0
20+
- rust: 1.51.0
2121
TARGET: x86_64-unknown-linux-gnu
2222

2323

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414

1515
include:
1616
# Test MSRV
17-
- rust: 1.37.0
17+
- rust: 1.51.0
1818

1919
# Test nightly but don't fail
2020
- rust: nightly

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This project is developed and maintained by the [HAL team][team].
88

99
## Minimum Supported Rust Version (MSRV)
1010

11-
This crate is guaranteed to compile on stable Rust 1.37.0 and up. It *might*
11+
This crate is guaranteed to compile on stable Rust 1.51.0 and up. It *might*
1212
compile with older versions but that may change in any new patch release.
1313

1414
## License

src/lib.rs

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -184,58 +184,13 @@ unsafe impl<T: WriteTarget> WriteTarget for [T] {
184184
type Word = T::Word;
185185
}
186186

187-
macro_rules! dma_target_array_impls {
188-
( $( $i:expr, )+ ) => {
189-
$(
190-
unsafe impl<T: ReadTarget> ReadTarget for [T; $i] {
191-
type Word = T::Word;
192-
}
193-
194-
unsafe impl<T: WriteTarget> WriteTarget for [T; $i] {
195-
type Word = T::Word;
196-
}
197-
)+
198-
};
187+
unsafe impl<T: ReadTarget, const N: usize> ReadTarget for [T; N] {
188+
type Word = T::Word;
199189
}
200190

201-
#[rustfmt::skip]
202-
dma_target_array_impls!(
203-
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
204-
10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
205-
20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
206-
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
207-
40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
208-
50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
209-
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
210-
70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
211-
80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
212-
90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
213-
100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
214-
110, 111, 112, 113, 114, 115, 116, 117, 118, 119,
215-
120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
216-
130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
217-
140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
218-
150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
219-
160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
220-
170, 171, 172, 173, 174, 175, 176, 177, 178, 179,
221-
180, 181, 182, 183, 184, 185, 186, 187, 188, 189,
222-
190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
223-
200, 201, 202, 203, 204, 205, 206, 207, 208, 209,
224-
210, 211, 212, 213, 214, 215, 216, 217, 218, 219,
225-
220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
226-
230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
227-
240, 241, 242, 243, 244, 245, 246, 247, 248, 249,
228-
250, 251, 252, 253, 254, 255, 256,
229-
230-
1 << 9,
231-
1 << 10,
232-
1 << 11,
233-
1 << 12,
234-
1 << 13,
235-
1 << 14,
236-
1 << 15,
237-
1 << 16,
238-
);
191+
unsafe impl<T: WriteTarget, const N: usize> WriteTarget for [T; N] {
192+
type Word = T::Word;
193+
}
239194

240195
unsafe impl<T: WriteTarget> WriteTarget for MaybeUninit<T> {
241196
type Word = T::Word;

0 commit comments

Comments
 (0)