Skip to content

Commit d45e131

Browse files
committed
Change uses of never type
1 parent 389fef3 commit d45e131

File tree

15 files changed

+198
-196
lines changed

15 files changed

+198
-196
lines changed

library/std/src/sys/hermit/fs.rs

+25-25
Original file line numberDiff line numberDiff line change
@@ -50,137 +50,137 @@ pub struct DirBuilder {}
5050

5151
impl FileAttr {
5252
pub fn size(&self) -> u64 {
53-
match self.0 {}
53+
self.0
5454
}
5555

5656
pub fn perm(&self) -> FilePermissions {
57-
match self.0 {}
57+
self.0
5858
}
5959

6060
pub fn file_type(&self) -> FileType {
61-
match self.0 {}
61+
self.0
6262
}
6363

6464
pub fn modified(&self) -> io::Result<SystemTime> {
65-
match self.0 {}
65+
self.0
6666
}
6767

6868
pub fn accessed(&self) -> io::Result<SystemTime> {
69-
match self.0 {}
69+
self.0
7070
}
7171

7272
pub fn created(&self) -> io::Result<SystemTime> {
73-
match self.0 {}
73+
self.0
7474
}
7575
}
7676

7777
impl Clone for FileAttr {
7878
fn clone(&self) -> FileAttr {
79-
match self.0 {}
79+
self.0
8080
}
8181
}
8282

8383
impl FilePermissions {
8484
pub fn readonly(&self) -> bool {
85-
match self.0 {}
85+
self.0
8686
}
8787

8888
pub fn set_readonly(&mut self, _readonly: bool) {
89-
match self.0 {}
89+
self.0
9090
}
9191
}
9292

9393
impl Clone for FilePermissions {
9494
fn clone(&self) -> FilePermissions {
95-
match self.0 {}
95+
self.0
9696
}
9797
}
9898

9999
impl PartialEq for FilePermissions {
100100
fn eq(&self, _other: &FilePermissions) -> bool {
101-
match self.0 {}
101+
self.0
102102
}
103103
}
104104

105105
impl Eq for FilePermissions {}
106106

107107
impl fmt::Debug for FilePermissions {
108108
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
109-
match self.0 {}
109+
self.0
110110
}
111111
}
112112

113113
impl FileType {
114114
pub fn is_dir(&self) -> bool {
115-
match self.0 {}
115+
self.0
116116
}
117117

118118
pub fn is_file(&self) -> bool {
119-
match self.0 {}
119+
self.0
120120
}
121121

122122
pub fn is_symlink(&self) -> bool {
123-
match self.0 {}
123+
self.0
124124
}
125125
}
126126

127127
impl Clone for FileType {
128128
fn clone(&self) -> FileType {
129-
match self.0 {}
129+
self.0
130130
}
131131
}
132132

133133
impl Copy for FileType {}
134134

135135
impl PartialEq for FileType {
136136
fn eq(&self, _other: &FileType) -> bool {
137-
match self.0 {}
137+
self.0
138138
}
139139
}
140140

141141
impl Eq for FileType {}
142142

143143
impl Hash for FileType {
144144
fn hash<H: Hasher>(&self, _h: &mut H) {
145-
match self.0 {}
145+
self.0
146146
}
147147
}
148148

149149
impl fmt::Debug for FileType {
150150
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
151-
match self.0 {}
151+
self.0
152152
}
153153
}
154154

155155
impl fmt::Debug for ReadDir {
156156
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
157-
match self.0 {}
157+
self.0
158158
}
159159
}
160160

161161
impl Iterator for ReadDir {
162162
type Item = io::Result<DirEntry>;
163163

164164
fn next(&mut self) -> Option<io::Result<DirEntry>> {
165-
match self.0 {}
165+
self.0
166166
}
167167
}
168168

169169
impl DirEntry {
170170
pub fn path(&self) -> PathBuf {
171-
match self.0 {}
171+
self.0
172172
}
173173

174174
pub fn file_name(&self) -> OsString {
175-
match self.0 {}
175+
self.0
176176
}
177177

178178
pub fn metadata(&self) -> io::Result<FileAttr> {
179-
match self.0 {}
179+
self.0
180180
}
181181

182182
pub fn file_type(&self) -> io::Result<FileType> {
183-
match self.0 {}
183+
self.0
184184
}
185185
}
186186

library/std/src/sys/hermit/net.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -415,14 +415,14 @@ pub struct LookupHost(!);
415415

416416
impl LookupHost {
417417
pub fn port(&self) -> u16 {
418-
match self.0 {}
418+
self.0
419419
}
420420
}
421421

422422
impl Iterator for LookupHost {
423423
type Item = SocketAddr;
424424
fn next(&mut self) -> Option<SocketAddr> {
425-
match self.0 {}
425+
self.0
426426
}
427427
}
428428

library/std/src/sys/hermit/os.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn chdir(_: &path::Path) -> io::Result<()> {
2929
unsupported()
3030
}
3131

32-
pub struct SplitPaths<'a>(&'a !);
32+
pub struct SplitPaths<'a>(!, PhantomData<&'a ()>);
3333

3434
pub fn split_paths(_unparsed: &OsStr) -> SplitPaths<'_> {
3535
panic!("unsupported")
@@ -38,7 +38,7 @@ pub fn split_paths(_unparsed: &OsStr) -> SplitPaths<'_> {
3838
impl<'a> Iterator for SplitPaths<'a> {
3939
type Item = PathBuf;
4040
fn next(&mut self) -> Option<PathBuf> {
41-
match *self.0 {}
41+
self.0
4242
}
4343
}
4444

library/std/src/sys/sgx/net.rs

+33-33
Original file line numberDiff line numberDiff line change
@@ -318,129 +318,129 @@ impl UdpSocket {
318318
}
319319

320320
pub fn peer_addr(&self) -> io::Result<SocketAddr> {
321-
match self.0 {}
321+
self.0
322322
}
323323

324324
pub fn socket_addr(&self) -> io::Result<SocketAddr> {
325-
match self.0 {}
325+
self.0
326326
}
327327

328328
pub fn recv_from(&self, _: &mut [u8]) -> io::Result<(usize, SocketAddr)> {
329-
match self.0 {}
329+
self.0
330330
}
331331

332332
pub fn peek_from(&self, _: &mut [u8]) -> io::Result<(usize, SocketAddr)> {
333-
match self.0 {}
333+
self.0
334334
}
335335

336336
pub fn send_to(&self, _: &[u8], _: &SocketAddr) -> io::Result<usize> {
337-
match self.0 {}
337+
self.0
338338
}
339339

340340
pub fn duplicate(&self) -> io::Result<UdpSocket> {
341-
match self.0 {}
341+
self.0
342342
}
343343

344344
pub fn set_read_timeout(&self, _: Option<Duration>) -> io::Result<()> {
345-
match self.0 {}
345+
self.0
346346
}
347347

348348
pub fn set_write_timeout(&self, _: Option<Duration>) -> io::Result<()> {
349-
match self.0 {}
349+
self.0
350350
}
351351

352352
pub fn read_timeout(&self) -> io::Result<Option<Duration>> {
353-
match self.0 {}
353+
self.0
354354
}
355355

356356
pub fn write_timeout(&self) -> io::Result<Option<Duration>> {
357-
match self.0 {}
357+
self.0
358358
}
359359

360360
pub fn set_broadcast(&self, _: bool) -> io::Result<()> {
361-
match self.0 {}
361+
self.0
362362
}
363363

364364
pub fn broadcast(&self) -> io::Result<bool> {
365-
match self.0 {}
365+
self.0
366366
}
367367

368368
pub fn set_multicast_loop_v4(&self, _: bool) -> io::Result<()> {
369-
match self.0 {}
369+
self.0
370370
}
371371

372372
pub fn multicast_loop_v4(&self) -> io::Result<bool> {
373-
match self.0 {}
373+
self.0
374374
}
375375

376376
pub fn set_multicast_ttl_v4(&self, _: u32) -> io::Result<()> {
377-
match self.0 {}
377+
self.0
378378
}
379379

380380
pub fn multicast_ttl_v4(&self) -> io::Result<u32> {
381-
match self.0 {}
381+
self.0
382382
}
383383

384384
pub fn set_multicast_loop_v6(&self, _: bool) -> io::Result<()> {
385-
match self.0 {}
385+
self.0
386386
}
387387

388388
pub fn multicast_loop_v6(&self) -> io::Result<bool> {
389-
match self.0 {}
389+
self.0
390390
}
391391

392392
pub fn join_multicast_v4(&self, _: &Ipv4Addr, _: &Ipv4Addr) -> io::Result<()> {
393-
match self.0 {}
393+
self.0
394394
}
395395

396396
pub fn join_multicast_v6(&self, _: &Ipv6Addr, _: u32) -> io::Result<()> {
397-
match self.0 {}
397+
self.0
398398
}
399399

400400
pub fn leave_multicast_v4(&self, _: &Ipv4Addr, _: &Ipv4Addr) -> io::Result<()> {
401-
match self.0 {}
401+
self.0
402402
}
403403

404404
pub fn leave_multicast_v6(&self, _: &Ipv6Addr, _: u32) -> io::Result<()> {
405-
match self.0 {}
405+
self.0
406406
}
407407

408408
pub fn set_ttl(&self, _: u32) -> io::Result<()> {
409-
match self.0 {}
409+
self.0
410410
}
411411

412412
pub fn ttl(&self) -> io::Result<u32> {
413-
match self.0 {}
413+
self.0
414414
}
415415

416416
pub fn take_error(&self) -> io::Result<Option<io::Error>> {
417-
match self.0 {}
417+
self.0
418418
}
419419

420420
pub fn set_nonblocking(&self, _: bool) -> io::Result<()> {
421-
match self.0 {}
421+
self.0
422422
}
423423

424424
pub fn recv(&self, _: &mut [u8]) -> io::Result<usize> {
425-
match self.0 {}
425+
self.0
426426
}
427427

428428
pub fn peek(&self, _: &mut [u8]) -> io::Result<usize> {
429-
match self.0 {}
429+
self.0
430430
}
431431

432432
pub fn send(&self, _: &[u8]) -> io::Result<usize> {
433-
match self.0 {}
433+
self.0
434434
}
435435

436436
pub fn connect(&self, _: io::Result<&SocketAddr>) -> io::Result<()> {
437-
match self.0 {}
437+
self.0
438438
}
439439
}
440440

441441
impl fmt::Debug for UdpSocket {
442442
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
443-
match self.0 {}
443+
self.0
444444
}
445445
}
446446

@@ -470,14 +470,14 @@ impl LookupHost {
470470
}
471471

472472
pub fn port(&self) -> u16 {
473-
match self.0 {}
473+
self.0
474474
}
475475
}
476476

477477
impl Iterator for LookupHost {
478478
type Item = SocketAddr;
479479
fn next(&mut self) -> Option<SocketAddr> {
480-
match self.0 {}
480+
self.0
481481
}
482482
}
483483

0 commit comments

Comments
 (0)