Commit facbc12
committed
Auto merge of #52872 - faern:use-modern-alignment-libc, r=TimNN
Make IpvXAddr::new const fns and the well known addresses associated constants
Implements/fixes #44582
I just got a PR towards libc (rust-lang/libc#1044) merged. With the new feature added in that PR it is now possible to create `in6_addr` instances as consts. This enables us to finally make the constructors of the IP structs const fns and to make the localhost/unspecified addresses associated constants, as agreed in the above mentioned tracking issue.
I also added a BROADCAST constant. Personally this is the well known address I tend to need the most often.File tree
5 files changed
+73
-52
lines changed- src
- libstd
- net
- rustc/libc_shim
5 files changed
+73
-52
lines changed- Cargo.lock+1-1
- Cargo.toml+1
- README.md+13-1
- ci/docker/aarch64-unknown-linux-musl/Dockerfile+6-6
- ci/docker/arm-unknown-linux-musleabihf/Dockerfile+6-6
- ci/docker/i686-unknown-linux-musl/Dockerfile+7-6
- ci/docker/sparc64-unknown-linux-gnu/Dockerfile+4-1
- ci/docker/x86_64-unknown-linux-musl/Dockerfile+6-6
- ci/run.sh+10-2
- libc-test/Cargo.toml+1
- libc-test/build.rs+9-9
- src/fuchsia/mod.rs+110-38
- src/lib.rs+1-1
- src/macros.rs+19-2
- src/redox/net.rs+2
- src/unix/bsd/apple/mod.rs+4
- src/unix/bsd/freebsdlike/dragonfly/mod.rs+24
- src/unix/bsd/freebsdlike/freebsd/mod.rs+28
- src/unix/bsd/netbsdlike/mod.rs-13
- src/unix/bsd/netbsdlike/netbsd/mod.rs+14
- src/unix/bsd/netbsdlike/openbsdlike/mod.rs+11-1
- src/unix/bsd/netbsdlike/openbsdlike/openbsd/mod.rs+203-1
- src/unix/mod.rs+4-2
- src/unix/newlib/mod.rs+72-23
- src/unix/notbsd/android/mod.rs+7
- src/unix/notbsd/emscripten.rs+27-12
- src/unix/notbsd/linux/mips/mips32.rs+52-54
- src/unix/notbsd/linux/mips/mips64.rs+52-54
- src/unix/notbsd/linux/mips/mod.rs+5
- src/unix/notbsd/linux/mod.rs+132-38
- src/unix/notbsd/linux/musl/b32/arm.rs+85
- src/unix/notbsd/linux/musl/b32/mips.rs+85
- src/unix/notbsd/linux/musl/b32/mod.rs+4-84
- src/unix/notbsd/linux/musl/b32/powerpc.rs+866
- src/unix/notbsd/linux/musl/b32/x86.rs+85
- src/unix/notbsd/linux/musl/mod.rs+2-1
- src/unix/notbsd/linux/other/b32/mod.rs+52-54
- src/unix/notbsd/linux/other/b64/aarch64.rs+28-27
- src/unix/notbsd/linux/other/b64/not_x32.rs+52-54
- src/unix/notbsd/linux/other/b64/powerpc64.rs+52-54
- src/unix/notbsd/linux/other/b64/sparc64.rs+25-24
- src/unix/notbsd/linux/other/b64/x32.rs+25-24
- src/unix/notbsd/linux/other/mod.rs+5
- src/unix/notbsd/linux/s390x.rs+30-24
- src/unix/uclibc/mips/mips32.rs+5
- src/unix/uclibc/mips/mips64.rs+5
- src/unix/uclibc/mod.rs+72-23
- src/unix/uclibc/x86_64/mod.rs+67-11
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| 257 | + | |
| 258 | + | |
257 | 259 | | |
258 | 260 | | |
259 | 261 | | |
| |||
292 | 294 | | |
293 | 295 | | |
294 | 296 | | |
| 297 | + | |
295 | 298 | | |
296 | 299 | | |
297 | 300 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
340 | 339 | | |
341 | 340 | | |
342 | 341 | | |
343 | | - | |
| 342 | + | |
| 343 | + | |
344 | 344 | | |
345 | 345 | | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
350 | 352 | | |
351 | 353 | | |
352 | 354 | | |
353 | 355 | | |
354 | | - | |
| 356 | + | |
355 | 357 | | |
356 | 358 | | |
357 | 359 | | |
358 | 360 | | |
359 | 361 | | |
360 | 362 | | |
361 | 363 | | |
362 | | - | |
| 364 | + | |
363 | 365 | | |
364 | 366 | | |
365 | 367 | | |
366 | 368 | | |
367 | 369 | | |
368 | | - | |
369 | | - | |
370 | | - | |
| 370 | + | |
371 | 371 | | |
372 | | - | |
| 372 | + | |
373 | 373 | | |
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
379 | 379 | | |
380 | | - | |
| 380 | + | |
381 | 381 | | |
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | 385 | | |
386 | | - | |
387 | | - | |
388 | | - | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
389 | 403 | | |
390 | 404 | | |
391 | 405 | | |
| |||
399 | 413 | | |
400 | 414 | | |
401 | 415 | | |
402 | | - | |
| 416 | + | |
403 | 417 | | |
404 | 418 | | |
405 | 419 | | |
| |||
573 | 587 | | |
574 | 588 | | |
575 | 589 | | |
576 | | - | |
577 | | - | |
| 590 | + | |
578 | 591 | | |
579 | 592 | | |
580 | 593 | | |
| |||
763 | 776 | | |
764 | 777 | | |
765 | 778 | | |
766 | | - | |
| 779 | + | |
767 | 780 | | |
768 | 781 | | |
769 | 782 | | |
| |||
856 | 869 | | |
857 | 870 | | |
858 | 871 | | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
871 | 890 | | |
872 | 891 | | |
873 | | - | |
| 892 | + | |
874 | 893 | | |
875 | 894 | | |
876 | 895 | | |
877 | 896 | | |
878 | 897 | | |
879 | 898 | | |
880 | 899 | | |
881 | | - | |
| 900 | + | |
882 | 901 | | |
883 | 902 | | |
884 | 903 | | |
885 | 904 | | |
886 | 905 | | |
887 | | - | |
888 | | - | |
889 | | - | |
| 906 | + | |
890 | 907 | | |
891 | | - | |
| 908 | + | |
892 | 909 | | |
893 | 910 | | |
894 | 911 | | |
895 | 912 | | |
896 | 913 | | |
897 | 914 | | |
898 | 915 | | |
899 | | - | |
| 916 | + | |
900 | 917 | | |
901 | 918 | | |
902 | 919 | | |
903 | 920 | | |
904 | 921 | | |
905 | | - | |
906 | | - | |
907 | | - | |
| 922 | + | |
908 | 923 | | |
909 | 924 | | |
910 | 925 | | |
| |||
1846 | 1861 | | |
1847 | 1862 | | |
1848 | 1863 | | |
1849 | | - | |
1850 | | - | |
1851 | | - | |
1852 | | - | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
1853 | 1870 | | |
1854 | 1871 | | |
1855 | 1872 | | |
1856 | 1873 | | |
1857 | | - | |
1858 | | - | |
1859 | | - | |
1860 | | - | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
1861 | 1878 | | |
1862 | 1879 | | |
1863 | 1880 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
0 commit comments