()
| 136 | } |
| 137 | |
| 138 | fn error_empty_slice() { |
| 139 | use rustix::buffer::Buffer; |
| 140 | |
| 141 | fn read<B: Buffer<u8>>(_: B) {} |
| 142 | |
| 143 | // Functions that take `&mut [u8]` can be passed `&mut []`, but with |
| 144 | // `Buffer` passing `&mut []` gets: |
| 145 | // "type annotations needed". |
| 146 | /* |
| 147 | read(&mut []); |
| 148 | */ |
| 149 | |
| 150 | // The fix: make the element type explicit. |
| 151 | read(&mut [0_u8; 0]); |
| 152 | } |
| 153 | |
| 154 | fn error_array_by_value() { |
| 155 | use rustix::buffer::Buffer; |