Commit 26f505c
authored
Rollup merge of rust-lang#90430 - jkugelman:must-use-std-a-through-n, r=joshtriplett
Add #[must_use] to remaining std functions (A-N)
I've run out of compelling reasons to group functions together across crates so I'm just going to go module-by-module. This is half of the remaining items from the `std` crate, from A-N.
I added these functions myself. Clippy predictably ignored the `mut` ones, but I don't know why the rest weren't flagged. Check them closely, please? Maybe I overlooked good reasons.
```rust
std::backtrace::Backtrace const fn disabled() -> Backtrace;
std::backtrace::Backtrace<'a> fn frames(&'a self) -> &'a [BacktraceFrame];
std::collections::hash_map::RawOccupiedEntryMut<'a, K, V> fn key_mut(&mut self) -> &mut K;
std::collections::hash_map::RawOccupiedEntryMut<'a, K, V> fn get_mut(&mut self) -> &mut V;
std::collections::hash_map::RawOccupiedEntryMut<'a, K, V> fn get_key_value(&mut self) -> (&K, &V);
std::collections::hash_map::RawOccupiedEntryMut<'a, K, V> fn get_key_value_mut(&mut self) -> (&mut K, &mut V);
std::env fn var_os<K: AsRef<OsStr>>(key: K) -> Option<OsString>;
std::env fn split_paths<T: AsRef<OsStr> + ?Sized>(unparsed: &T) -> SplitPaths<'_>;
std::io::Error fn get_mut(&mut self) -> Option<&mut (dyn error::Error + Send + Sync + 'static)>;
```
Parent issue: rust-lang#89692
r? `@joshtriplett`File tree
18 files changed
+68
-14
lines changed- library/std/src
- collections/hash
- ffi
- io
- net
- src/test/ui
- rust-2018/uniform-paths
- uniform-paths
18 files changed
+68
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
355 | 356 | | |
356 | 357 | | |
357 | 358 | | |
| 359 | + | |
358 | 360 | | |
359 | 361 | | |
360 | 362 | | |
| |||
366 | 368 | | |
367 | 369 | | |
368 | 370 | | |
| 371 | + | |
369 | 372 | | |
370 | 373 | | |
371 | 374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1707 | 1707 | | |
1708 | 1708 | | |
1709 | 1709 | | |
| 1710 | + | |
1710 | 1711 | | |
1711 | 1712 | | |
1712 | 1713 | | |
1713 | 1714 | | |
1714 | 1715 | | |
1715 | 1716 | | |
1716 | 1717 | | |
| 1718 | + | |
1717 | 1719 | | |
1718 | 1720 | | |
1719 | 1721 | | |
| |||
1730 | 1732 | | |
1731 | 1733 | | |
1732 | 1734 | | |
| 1735 | + | |
1733 | 1736 | | |
1734 | 1737 | | |
1735 | 1738 | | |
| |||
1746 | 1749 | | |
1747 | 1750 | | |
1748 | 1751 | | |
| 1752 | + | |
1749 | 1753 | | |
1750 | 1754 | | |
1751 | 1755 | | |
1752 | 1756 | | |
1753 | 1757 | | |
1754 | 1758 | | |
1755 | 1759 | | |
| 1760 | + | |
1756 | 1761 | | |
1757 | 1762 | | |
1758 | 1763 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
116 | 117 | | |
117 | 118 | | |
118 | 119 | | |
| |||
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| |||
244 | 246 | | |
245 | 247 | | |
246 | 248 | | |
| 249 | + | |
247 | 250 | | |
248 | 251 | | |
249 | 252 | | |
| |||
384 | 387 | | |
385 | 388 | | |
386 | 389 | | |
| 390 | + | |
387 | 391 | | |
388 | 392 | | |
389 | 393 | | |
| |||
564 | 568 | | |
565 | 569 | | |
566 | 570 | | |
| 571 | + | |
567 | 572 | | |
568 | 573 | | |
569 | 574 | | |
| |||
603 | 608 | | |
604 | 609 | | |
605 | 610 | | |
| 611 | + | |
606 | 612 | | |
607 | 613 | | |
608 | 614 | | |
| |||
690 | 696 | | |
691 | 697 | | |
692 | 698 | | |
| 699 | + | |
693 | 700 | | |
694 | 701 | | |
695 | 702 | | |
| |||
706 | 713 | | |
707 | 714 | | |
708 | 715 | | |
| 716 | + | |
709 | 717 | | |
710 | 718 | | |
711 | 719 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1009 | 1009 | | |
1010 | 1010 | | |
1011 | 1011 | | |
| 1012 | + | |
1012 | 1013 | | |
1013 | 1014 | | |
1014 | 1015 | | |
| |||
1107 | 1108 | | |
1108 | 1109 | | |
1109 | 1110 | | |
| 1111 | + | |
1110 | 1112 | | |
1111 | 1113 | | |
1112 | 1114 | | |
| |||
1456 | 1458 | | |
1457 | 1459 | | |
1458 | 1460 | | |
| 1461 | + | |
1459 | 1462 | | |
1460 | 1463 | | |
1461 | 1464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
| 242 | + | |
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
| |||
709 | 710 | | |
710 | 711 | | |
711 | 712 | | |
| 713 | + | |
712 | 714 | | |
713 | 715 | | |
714 | 716 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| 377 | + | |
377 | 378 | | |
378 | 379 | | |
379 | 380 | | |
| |||
983 | 984 | | |
984 | 985 | | |
985 | 986 | | |
| 987 | + | |
986 | 988 | | |
987 | 989 | | |
988 | 990 | | |
| |||
1100 | 1102 | | |
1101 | 1103 | | |
1102 | 1104 | | |
| 1105 | + | |
1103 | 1106 | | |
1104 | 1107 | | |
1105 | 1108 | | |
| |||
1247 | 1250 | | |
1248 | 1251 | | |
1249 | 1252 | | |
| 1253 | + | |
1250 | 1254 | | |
1251 | 1255 | | |
1252 | 1256 | | |
| |||
1441 | 1445 | | |
1442 | 1446 | | |
1443 | 1447 | | |
| 1448 | + | |
1444 | 1449 | | |
1445 | 1450 | | |
1446 | 1451 | | |
| |||
1536 | 1541 | | |
1537 | 1542 | | |
1538 | 1543 | | |
| 1544 | + | |
1539 | 1545 | | |
1540 | 1546 | | |
1541 | 1547 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
442 | 442 | | |
443 | 443 | | |
444 | 444 | | |
| 445 | + | |
445 | 446 | | |
446 | 447 | | |
447 | 448 | | |
| |||
509 | 510 | | |
510 | 511 | | |
511 | 512 | | |
| 513 | + | |
512 | 514 | | |
513 | 515 | | |
514 | 516 | | |
| |||
547 | 549 | | |
548 | 550 | | |
549 | 551 | | |
| 552 | + | |
550 | 553 | | |
551 | 554 | | |
552 | 555 | | |
| |||
620 | 623 | | |
621 | 624 | | |
622 | 625 | | |
| 626 | + | |
623 | 627 | | |
624 | 628 | | |
625 | 629 | | |
| |||
688 | 692 | | |
689 | 693 | | |
690 | 694 | | |
| 695 | + | |
691 | 696 | | |
692 | 697 | | |
693 | 698 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1308 | 1308 | | |
1309 | 1309 | | |
1310 | 1310 | | |
| 1311 | + | |
1311 | 1312 | | |
1312 | 1313 | | |
1313 | 1314 | | |
| |||
1322 | 1323 | | |
1323 | 1324 | | |
1324 | 1325 | | |
| 1326 | + | |
1325 | 1327 | | |
1326 | 1328 | | |
1327 | 1329 | | |
1328 | 1330 | | |
1329 | 1331 | | |
1330 | 1332 | | |
1331 | 1333 | | |
| 1334 | + | |
1332 | 1335 | | |
1333 | 1336 | | |
1334 | 1337 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
| 304 | + | |
304 | 305 | | |
305 | 306 | | |
306 | 307 | | |
| |||
674 | 675 | | |
675 | 676 | | |
676 | 677 | | |
| 678 | + | |
677 | 679 | | |
678 | 680 | | |
679 | 681 | | |
| |||
954 | 956 | | |
955 | 957 | | |
956 | 958 | | |
| 959 | + | |
957 | 960 | | |
958 | 961 | | |
959 | 962 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
112 | 113 | | |
113 | 114 | | |
114 | 115 | | |
| 116 | + | |
115 | 117 | | |
116 | 118 | | |
117 | 119 | | |
| |||
192 | 194 | | |
193 | 195 | | |
194 | 196 | | |
| 197 | + | |
195 | 198 | | |
196 | 199 | | |
197 | 200 | | |
| |||
0 commit comments