Commit 06fab15
committed
Unrolled build for #158580
Rollup merge of #158580 - valentynkit:enotsup-unsupported, r=workingjubilee
std: map ENOTSUP to ErrorKind::Unsupported
`ENOTSUP` and `EOPNOTSUPP` both mean the operation isn't supported. They're the same value on some targets (Linux, FreeBSD), where the existing `EOPNOTSUPP => Unsupported` arm (#139822) already covers both, and different on others (Apple, OpenBSD), where `ENOTSUP` decodes to `Uncategorized` instead. I don't see a reason to treat it differently, so this maps `ENOTSUP` to `Unsupported` as well.
It uses a match guard rather than an or-pattern, since the two are equal on the targets where they alias and an or-pattern would be unreachable there. Same shape as the `EAGAIN`/`EWOULDBLOCK` arm just below:
```rust
x if x == libc::EOPNOTSUPP || x == libc::ENOTSUP => Unsupported,
```
This was raised once before (#125228) and closed, since both errnos were left out of the original `Unsupported` PR (#78880). #139822 has since added `EOPNOTSUPP`, so the same reasoning now covers `ENOTSUP`.
I didn't add a test, since the decode arms aren't tested today.
r? libs1 file changed
Lines changed: 6 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
157 | 157 | | |
158 | 158 | | |
159 | 159 | | |
160 | | - | |
161 | 160 | | |
162 | 161 | | |
163 | 162 | | |
| |||
175 | 174 | | |
176 | 175 | | |
177 | 176 | | |
178 | | - | |
179 | 177 | | |
180 | 178 | | |
181 | 179 | | |
182 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
183 | 187 | | |
184 | 188 | | |
185 | 189 | | |
| |||
0 commit comments