Commit ebe8df4
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
6 files changed
+118
-99
lines changed- src
- libstd
- net
- sys/redox/net
- rustc/libc_shim
6 files changed
+118
-99
lines changedLarge diffs are not rendered by default.
- .travis.yml+13-6
- Cargo.lock+59-59
- Cargo.toml+2-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/ios/deploy_and_run_on_ios_simulator.rs+1
- ci/run.sh+10-2
- libc-test/Cargo.toml+1
- libc-test/build.rs+65-20
- 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/b64.rs-2
- src/unix/bsd/apple/mod.rs+13-10
- 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/hermit/aarch64.rs+2
- src/unix/hermit/mod.rs+736
- src/unix/hermit/x86_64.rs+2
- src/unix/mod.rs+13-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/solaris/mod.rs+1
- 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 | |
|---|---|---|---|
| |||
252 | 252 | | |
253 | 253 | | |
254 | 254 | | |
| 255 | + | |
| 256 | + | |
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
| |||
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
| 286 | + | |
284 | 287 | | |
285 | 288 | | |
286 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | 19 | | |
22 | 20 | | |
23 | 21 | | |
| |||
340 | 338 | | |
341 | 339 | | |
342 | 340 | | |
343 | | - | |
| 341 | + | |
| 342 | + | |
344 | 343 | | |
345 | 344 | | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
354 | | - | |
| 355 | + | |
355 | 356 | | |
356 | 357 | | |
357 | 358 | | |
358 | 359 | | |
359 | 360 | | |
360 | 361 | | |
361 | 362 | | |
362 | | - | |
| 363 | + | |
363 | 364 | | |
364 | 365 | | |
365 | 366 | | |
366 | 367 | | |
367 | 368 | | |
368 | | - | |
369 | | - | |
370 | | - | |
| 369 | + | |
371 | 370 | | |
372 | | - | |
| 371 | + | |
373 | 372 | | |
374 | 373 | | |
375 | 374 | | |
376 | 375 | | |
377 | 376 | | |
378 | 377 | | |
379 | 378 | | |
380 | | - | |
| 379 | + | |
381 | 380 | | |
382 | 381 | | |
383 | 382 | | |
384 | 383 | | |
385 | 384 | | |
386 | | - | |
387 | | - | |
388 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
389 | 402 | | |
390 | 403 | | |
391 | 404 | | |
| |||
399 | 412 | | |
400 | 413 | | |
401 | 414 | | |
402 | | - | |
| 415 | + | |
403 | 416 | | |
404 | 417 | | |
405 | 418 | | |
| |||
573 | 586 | | |
574 | 587 | | |
575 | 588 | | |
576 | | - | |
577 | | - | |
| 589 | + | |
578 | 590 | | |
579 | 591 | | |
580 | 592 | | |
| |||
763 | 775 | | |
764 | 776 | | |
765 | 777 | | |
766 | | - | |
| 778 | + | |
767 | 779 | | |
768 | 780 | | |
769 | 781 | | |
| |||
856 | 868 | | |
857 | 869 | | |
858 | 870 | | |
859 | | - | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | | - | |
865 | | - | |
866 | | - | |
867 | | - | |
868 | | - | |
869 | | - | |
870 | | - | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
871 | 889 | | |
872 | 890 | | |
873 | | - | |
| 891 | + | |
874 | 892 | | |
875 | 893 | | |
876 | 894 | | |
877 | 895 | | |
878 | 896 | | |
879 | 897 | | |
880 | 898 | | |
881 | | - | |
| 899 | + | |
882 | 900 | | |
883 | 901 | | |
884 | 902 | | |
885 | 903 | | |
886 | 904 | | |
887 | | - | |
888 | | - | |
889 | | - | |
| 905 | + | |
890 | 906 | | |
891 | | - | |
| 907 | + | |
892 | 908 | | |
893 | 909 | | |
894 | 910 | | |
895 | 911 | | |
896 | 912 | | |
897 | 913 | | |
898 | 914 | | |
899 | | - | |
| 915 | + | |
900 | 916 | | |
901 | 917 | | |
902 | 918 | | |
903 | 919 | | |
904 | 920 | | |
905 | | - | |
906 | | - | |
907 | | - | |
| 921 | + | |
908 | 922 | | |
909 | 923 | | |
910 | 924 | | |
| |||
1414 | 1428 | | |
1415 | 1429 | | |
1416 | 1430 | | |
1417 | | - | |
1418 | | - | |
| 1431 | + | |
1419 | 1432 | | |
1420 | 1433 | | |
1421 | 1434 | | |
| |||
1846 | 1859 | | |
1847 | 1860 | | |
1848 | 1861 | | |
1849 | | - | |
1850 | | - | |
1851 | | - | |
1852 | | - | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
1853 | 1868 | | |
1854 | 1869 | | |
1855 | 1870 | | |
1856 | 1871 | | |
1857 | | - | |
1858 | | - | |
1859 | | - | |
1860 | | - | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
1861 | 1876 | | |
1862 | 1877 | | |
1863 | 1878 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | | - | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
0 commit comments