@@ -23,12 +23,6 @@ version = "2.4.0"
23
23
source = " registry+https://github.com/rust-lang/crates.io-index"
24
24
checksum = " b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
25
25
26
- [[package ]]
27
- name = " cc"
28
- version = " 1.0.79"
29
- source = " registry+https://github.com/rust-lang/crates.io-index"
30
- checksum = " 50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
31
-
32
26
[[package ]]
33
27
name = " cfg-if"
34
28
version = " 1.0.0"
@@ -37,23 +31,12 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
37
31
38
32
[[package ]]
39
33
name = " errno"
40
- version = " 0.3.1 "
34
+ version = " 0.3.8 "
41
35
source = " registry+https://github.com/rust-lang/crates.io-index"
42
- checksum = " 4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a "
36
+ checksum = " a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245 "
43
37
dependencies = [
44
- " errno-dragonfly" ,
45
- " libc" ,
46
- " windows-sys" ,
47
- ]
48
-
49
- [[package ]]
50
- name = " errno-dragonfly"
51
- version = " 0.1.2"
52
- source = " registry+https://github.com/rust-lang/crates.io-index"
53
- checksum = " aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
54
- dependencies = [
55
- " cc" ,
56
38
" libc" ,
39
+ " windows-sys 0.52.0" ,
57
40
]
58
41
59
42
[[package ]]
@@ -120,15 +103,15 @@ dependencies = [
120
103
121
104
[[package ]]
122
105
name = " libc"
123
- version = " 0.2.150 "
106
+ version = " 0.2.153 "
124
107
source = " registry+https://github.com/rust-lang/crates.io-index"
125
- checksum = " 89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c "
108
+ checksum = " 9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd "
126
109
127
110
[[package ]]
128
111
name = " linux-raw-sys"
129
- version = " 0.4.5 "
112
+ version = " 0.4.13 "
130
113
source = " registry+https://github.com/rust-lang/crates.io-index"
131
- checksum = " 57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503 "
114
+ checksum = " 01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c "
132
115
133
116
[[package ]]
134
117
name = " memchr"
@@ -194,15 +177,15 @@ dependencies = [
194
177
195
178
[[package ]]
196
179
name = " rustix"
197
- version = " 0.38.8 "
180
+ version = " 0.38.31 "
198
181
source = " registry+https://github.com/rust-lang/crates.io-index"
199
- checksum = " 19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f "
182
+ checksum = " 6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949 "
200
183
dependencies = [
201
184
" bitflags 2.4.0" ,
202
185
" errno" ,
203
186
" libc" ,
204
187
" linux-raw-sys" ,
205
- " windows-sys" ,
188
+ " windows-sys 0.52.0 " ,
206
189
]
207
190
208
191
[[package ]]
@@ -230,7 +213,7 @@ dependencies = [
230
213
" fastrand" ,
231
214
" redox_syscall" ,
232
215
" rustix" ,
233
- " windows-sys" ,
216
+ " windows-sys 0.48.0 " ,
234
217
]
235
218
236
219
[[package ]]
@@ -313,7 +296,16 @@ version = "0.48.0"
313
296
source = " registry+https://github.com/rust-lang/crates.io-index"
314
297
checksum = " 677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
315
298
dependencies = [
316
- " windows-targets" ,
299
+ " windows-targets 0.48.1" ,
300
+ ]
301
+
302
+ [[package ]]
303
+ name = " windows-sys"
304
+ version = " 0.52.0"
305
+ source = " registry+https://github.com/rust-lang/crates.io-index"
306
+ checksum = " 282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d"
307
+ dependencies = [
308
+ " windows-targets 0.52.4" ,
317
309
]
318
310
319
311
[[package ]]
@@ -322,13 +314,28 @@ version = "0.48.1"
322
314
source = " registry+https://github.com/rust-lang/crates.io-index"
323
315
checksum = " 05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f"
324
316
dependencies = [
325
- " windows_aarch64_gnullvm" ,
326
- " windows_aarch64_msvc" ,
327
- " windows_i686_gnu" ,
328
- " windows_i686_msvc" ,
329
- " windows_x86_64_gnu" ,
330
- " windows_x86_64_gnullvm" ,
331
- " windows_x86_64_msvc" ,
317
+ " windows_aarch64_gnullvm 0.48.0" ,
318
+ " windows_aarch64_msvc 0.48.0" ,
319
+ " windows_i686_gnu 0.48.0" ,
320
+ " windows_i686_msvc 0.48.0" ,
321
+ " windows_x86_64_gnu 0.48.0" ,
322
+ " windows_x86_64_gnullvm 0.48.0" ,
323
+ " windows_x86_64_msvc 0.48.0" ,
324
+ ]
325
+
326
+ [[package ]]
327
+ name = " windows-targets"
328
+ version = " 0.52.4"
329
+ source = " registry+https://github.com/rust-lang/crates.io-index"
330
+ checksum = " 7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b"
331
+ dependencies = [
332
+ " windows_aarch64_gnullvm 0.52.4" ,
333
+ " windows_aarch64_msvc 0.52.4" ,
334
+ " windows_i686_gnu 0.52.4" ,
335
+ " windows_i686_msvc 0.52.4" ,
336
+ " windows_x86_64_gnu 0.52.4" ,
337
+ " windows_x86_64_gnullvm 0.52.4" ,
338
+ " windows_x86_64_msvc 0.52.4" ,
332
339
]
333
340
334
341
[[package ]]
@@ -337,38 +344,104 @@ version = "0.48.0"
337
344
source = " registry+https://github.com/rust-lang/crates.io-index"
338
345
checksum = " 91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
339
346
347
+ [[package ]]
348
+ name = " windows_aarch64_gnullvm"
349
+ version = " 0.52.4"
350
+ source = " registry+https://github.com/rust-lang/crates.io-index"
351
+ checksum = " bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9"
352
+
340
353
[[package ]]
341
354
name = " windows_aarch64_msvc"
342
355
version = " 0.48.0"
343
356
source = " registry+https://github.com/rust-lang/crates.io-index"
344
357
checksum = " b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
345
358
359
+ [[package ]]
360
+ name = " windows_aarch64_msvc"
361
+ version = " 0.52.4"
362
+ source = " registry+https://github.com/rust-lang/crates.io-index"
363
+ checksum = " da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675"
364
+
346
365
[[package ]]
347
366
name = " windows_i686_gnu"
348
367
version = " 0.48.0"
349
368
source = " registry+https://github.com/rust-lang/crates.io-index"
350
369
checksum = " 622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
351
370
371
+ [[package ]]
372
+ name = " windows_i686_gnu"
373
+ version = " 0.52.4"
374
+ source = " registry+https://github.com/rust-lang/crates.io-index"
375
+ checksum = " b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3"
376
+
352
377
[[package ]]
353
378
name = " windows_i686_msvc"
354
379
version = " 0.48.0"
355
380
source = " registry+https://github.com/rust-lang/crates.io-index"
356
381
checksum = " 4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
357
382
383
+ [[package ]]
384
+ name = " windows_i686_msvc"
385
+ version = " 0.52.4"
386
+ source = " registry+https://github.com/rust-lang/crates.io-index"
387
+ checksum = " 1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02"
388
+
358
389
[[package ]]
359
390
name = " windows_x86_64_gnu"
360
391
version = " 0.48.0"
361
392
source = " registry+https://github.com/rust-lang/crates.io-index"
362
393
checksum = " ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
363
394
395
+ [[package ]]
396
+ name = " windows_x86_64_gnu"
397
+ version = " 0.52.4"
398
+ source = " registry+https://github.com/rust-lang/crates.io-index"
399
+ checksum = " 5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03"
400
+
364
401
[[package ]]
365
402
name = " windows_x86_64_gnullvm"
366
403
version = " 0.48.0"
367
404
source = " registry+https://github.com/rust-lang/crates.io-index"
368
405
checksum = " 7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
369
406
407
+ [[package ]]
408
+ name = " windows_x86_64_gnullvm"
409
+ version = " 0.52.4"
410
+ source = " registry+https://github.com/rust-lang/crates.io-index"
411
+ checksum = " 77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177"
412
+
370
413
[[package ]]
371
414
name = " windows_x86_64_msvc"
372
415
version = " 0.48.0"
373
416
source = " registry+https://github.com/rust-lang/crates.io-index"
374
417
checksum = " 1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
418
+
419
+ [[package ]]
420
+ name = " windows_x86_64_msvc"
421
+ version = " 0.52.4"
422
+ source = " registry+https://github.com/rust-lang/crates.io-index"
423
+ checksum = " 32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8"
424
+ fn main() -> Result<(), Box<dyn std::error::Error>> {
425
+ // create a directory, get a FD to it, then unlink the directory but keep the FD
426
+ std::fs::create_dir("tmp_dir")?;
427
+ let dir_fd = rustix::fs::openat(
428
+ rustix::fs::CWD,
429
+ rustix::cstr!("tmp_dir"),
430
+ rustix::fs::OFlags::RDONLY | rustix::fs::OFlags::CLOEXEC,
431
+ rustix::fs::Mode::empty(),
432
+ )?;
433
+ std::fs::remove_dir("tmp_dir")?;
434
+
435
+ // iterator gets stuck in infinite loop and memory explodes
436
+ rustix::fs::Dir::read_from(dir_fd)?
437
+ // the iterator keeps returning `Some(Err(_))`, but never halts by returning `None`
438
+ // therefore if the implementation ignores the error (or otherwise continues
439
+ // after seeing the error instead of breaking), the loop will not halt
440
+ .filter_map(|dirent_maybe_error| dirent_maybe_error.ok())
441
+ .for_each(|dirent| {
442
+ // your happy path
443
+ println!("{dirent:?}");
444
+ });
445
+
446
+ Ok(())
447
+ }
0 commit comments