Skip to content

Commit 4e4d9c2

Browse files
committed
style: Adjust a comment so rustfmt works
Rustfmt was skipping this entire block because it doesn't support comments in the middle of chained `|`. So, add a `=> true` after `IPV6_FLOWINFO_PRIORITY` and the whole closure starts to get formatted again.
1 parent a8b1532 commit 4e4d9c2

File tree

1 file changed

+49
-63
lines changed

1 file changed

+49
-63
lines changed

libc-test/build.rs

Lines changed: 49 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -4064,13 +4064,11 @@ fn test_linux(target: &str) {
40644064
|| name == "SO_DEVMEM_DMABUF"
40654065
|| name == "SO_DEVMEM_DONTNEED"
40664066
{
4067-
return true;
4067+
return true;
40684068
}
40694069
// FIXME(musl): Not in musl yet
4070-
if name == "SCM_DEVMEM_LINEAR"
4071-
|| name == "SCM_DEVMEM_DMABUF"
4072-
{
4073-
return true;
4070+
if name == "SCM_DEVMEM_LINEAR" || name == "SCM_DEVMEM_DMABUF" {
4071+
return true;
40744072
}
40754073
// FIXME: Does not exist on non-x86 architectures, slated for removal
40764074
// in libc in 1.0
@@ -4082,7 +4080,7 @@ fn test_linux(target: &str) {
40824080
// Constants that don't exist on the old version of musl we test with, but do exist
40834081
// on newer versions.
40844082
match name {
4085-
| "FAN_EVENT_INFO_TYPE_ERROR"
4083+
"FAN_EVENT_INFO_TYPE_ERROR"
40864084
| "FAN_EVENT_INFO_TYPE_NEW_DFID_NAME"
40874085
| "FAN_EVENT_INFO_TYPE_OLD_DFID_NAME"
40884086
| "FAN_FS_ERROR"
@@ -4104,8 +4102,7 @@ fn test_linux(target: &str) {
41044102
| "RLIM_NLIMITS"
41054103
| "SI_DETHREAD"
41064104
| "SO_BUSY_POLL_BUDGET"
4107-
| "SO_PREFER_BUSY_POLL"
4108-
=> return true,
4105+
| "SO_PREFER_BUSY_POLL" => return true,
41094106
// Values changed in newer musl versions on these arches
41104107
"O_LARGEFILE" if riscv64 || x86_64 => return true,
41114108
_ => (),
@@ -4116,13 +4113,13 @@ fn test_linux(target: &str) {
41164113
// and can therefore not be tested here
41174114
//
41184115
// The IPV6 constants are tested in the `linux_ipv6.rs` tests:
4119-
| "IPV6_FLOWINFO"
4116+
"IPV6_FLOWINFO"
41204117
| "IPV6_FLOWLABEL_MGR"
41214118
| "IPV6_FLOWINFO_SEND"
41224119
| "IPV6_FLOWINFO_FLOWLABEL"
4123-
| "IPV6_FLOWINFO_PRIORITY"
4120+
| "IPV6_FLOWINFO_PRIORITY" => true,
41244121
// The F_ fnctl constants are tested in the `linux_fnctl.rs` tests:
4125-
| "F_CANCELLK"
4122+
"F_CANCELLK"
41264123
| "F_ADD_SEALS"
41274124
| "F_GET_SEALS"
41284125
| "F_SEAL_SEAL"
@@ -4145,12 +4142,7 @@ fn test_linux(target: &str) {
41454142

41464143
// FIXME(linux): conflicts with glibc headers and is tested in
41474144
// `linux_termios.rs` below:
4148-
| "BOTHER"
4149-
| "IBSHIFT"
4150-
| "TCGETS2"
4151-
| "TCSETS2"
4152-
| "TCSETSW2"
4153-
| "TCSETSF2" => true,
4145+
"BOTHER" | "IBSHIFT" | "TCGETS2" | "TCSETS2" | "TCSETSW2" | "TCSETSF2" => true,
41544146

41554147
// FIXME(musl): on musl the pthread types are defined a little differently
41564148
// - these constants are used by the glibc implementation.
@@ -4170,13 +4162,17 @@ fn test_linux(target: &str) {
41704162
"SYS_clone3" if sparc64 => true,
41714163

41724164
// FIXME(linux): Not defined on ARM, gnueabihf, mips, musl, PowerPC, riscv64, s390x, and sparc64.
4173-
"SYS_memfd_secret" if arm | gnueabihf | mips | musl | ppc | riscv64 | s390x | sparc64 => true,
4165+
"SYS_memfd_secret"
4166+
if arm | gnueabihf | mips | musl | ppc | riscv64 | s390x | sparc64 =>
4167+
{
4168+
true
4169+
}
41744170

41754171
// Skip as this signal codes and trap reasons need newer headers
41764172
"TRAP_PERF" => true,
41774173

41784174
// kernel constants not available in uclibc 1.0.34
4179-
| "EXTPROC"
4175+
"EXTPROC"
41804176
| "IPPROTO_BEETPH"
41814177
| "IPPROTO_MPLS"
41824178
| "IPV6_HDRINCL"
@@ -4189,7 +4185,10 @@ fn test_linux(target: &str) {
41894185
| "SHM_EXEC"
41904186
| "UDP_GRO"
41914187
| "UDP_SEGMENT"
4192-
if uclibc => true,
4188+
if uclibc =>
4189+
{
4190+
true
4191+
}
41934192

41944193
// headers conflicts with linux/pidfd.h
41954194
"PIDFD_NONBLOCK" => true,
@@ -4232,17 +4231,18 @@ fn test_linux(target: &str) {
42324231
| "PR_SCHED_CORE_SCOPE_THREAD"
42334232
| "PR_SCHED_CORE_SCOPE_THREAD_GROUP"
42344233
| "PR_SCHED_CORE_SHARE_FROM"
4235-
| "PR_SCHED_CORE_SHARE_TO" if old_musl => true,
4234+
| "PR_SCHED_CORE_SHARE_TO"
4235+
if old_musl =>
4236+
{
4237+
true
4238+
}
42364239

42374240
// Not present in glibc
42384241
"PR_SME_VL_LEN_MAX" | "PR_SME_SET_VL_INHERIT" | "PR_SME_SET_VL_ONE_EXEC" if gnu => true,
42394242

42404243
// FIXME(linux): The below is no longer const in glibc 2.34:
42414244
// https://github.com/bminor/glibc/commit/5d98a7dae955bafa6740c26eaba9c86060ae0344
4242-
| "PTHREAD_STACK_MIN"
4243-
| "SIGSTKSZ"
4244-
| "MINSIGSTKSZ"
4245-
if gnu => true,
4245+
"PTHREAD_STACK_MIN" | "SIGSTKSZ" | "MINSIGSTKSZ" if gnu => true,
42464246

42474247
// value changed
42484248
"NF_NETDEV_NUMHOOKS" if sparc64 => true,
@@ -4266,7 +4266,10 @@ fn test_linux(target: &str) {
42664266
| "FAN_EVENT_INFO_TYPE_PIDFD"
42674267
| "FAN_NOPIDFD"
42684268
| "FAN_EPIDFD"
4269-
if musl => true,
4269+
if musl =>
4270+
{
4271+
true
4272+
}
42704273

42714274
// FIXME(linux): Requires >= 6.6 kernel headers.
42724275
"XDP_USE_SG" | "XDP_PKT_CONTD" => true,
@@ -4278,16 +4281,21 @@ fn test_linux(target: &str) {
42784281
"XDP_UMEM_TX_SW_CSUM"
42794282
| "XDP_TXMD_FLAGS_TIMESTAMP"
42804283
| "XDP_TXMD_FLAGS_CHECKSUM"
4281-
| "XDP_TX_METADATA"
4282-
=> true,
4284+
| "XDP_TX_METADATA" => true,
42834285

42844286
// FIXME(linux): Requires >= 6.11 kernel headers.
42854287
"XDP_UMEM_TX_METADATA_LEN" => true,
42864288

42874289
// FIXME(linux): Requires >= 6.11 kernel headers.
4288-
"NS_GET_MNTNS_ID" | "NS_GET_PID_FROM_PIDNS" | "NS_GET_TGID_FROM_PIDNS" | "NS_GET_PID_IN_PIDNS" | "NS_GET_TGID_IN_PIDNS" => true,
4290+
"NS_GET_MNTNS_ID"
4291+
| "NS_GET_PID_FROM_PIDNS"
4292+
| "NS_GET_TGID_FROM_PIDNS"
4293+
| "NS_GET_PID_IN_PIDNS"
4294+
| "NS_GET_TGID_IN_PIDNS" => true,
42894295
// FIXME(linux): Requires >= 6.12 kernel headers.
4290-
"MNT_NS_INFO_SIZE_VER0" | "NS_MNT_GET_INFO" | "NS_MNT_GET_NEXT" | "NS_MNT_GET_PREV" => true,
4296+
"MNT_NS_INFO_SIZE_VER0" | "NS_MNT_GET_INFO" | "NS_MNT_GET_NEXT" | "NS_MNT_GET_PREV" => {
4297+
true
4298+
}
42914299

42924300
// FIXME(linux): Requires >= 6.6 kernel headers.
42934301
"SYS_fchmodat2" => true,
@@ -4296,33 +4304,13 @@ fn test_linux(target: &str) {
42964304
"SYS_mseal" => true,
42974305

42984306
// FIXME(linux): seems to not be available all the time (from <include/linux/sched.h>:
4299-
"PF_VCPU"
4300-
| "PF_IDLE"
4301-
| "PF_EXITING"
4302-
| "PF_POSTCOREDUMP"
4303-
| "PF_IO_WORKER"
4304-
| "PF_WQ_WORKER"
4305-
| "PF_FORKNOEXEC"
4306-
| "PF_MCE_PROCESS"
4307-
| "PF_SUPERPRIV"
4308-
| "PF_DUMPCORE"
4309-
| "PF_SIGNALED"
4310-
| "PF_MEMALLOC"
4311-
| "PF_NPROC_EXCEEDED"
4312-
| "PF_USED_MATH"
4313-
| "PF_USER_WORKER"
4314-
| "PF_NOFREEZE"
4315-
| "PF_KSWAPD"
4316-
| "PF_MEMALLOC_NOFS"
4317-
| "PF_MEMALLOC_NOIO"
4318-
| "PF_LOCAL_THROTTLE"
4319-
| "PF_KTHREAD"
4320-
| "PF_RANDOMIZE"
4321-
| "PF_NO_SETAFFINITY"
4322-
| "PF_MCE_EARLY"
4323-
| "PF_MEMALLOC_PIN"
4324-
| "PF_BLOCK_TS"
4325-
| "PF_SUSPEND_TASK" => true,
4307+
"PF_VCPU" | "PF_IDLE" | "PF_EXITING" | "PF_POSTCOREDUMP" | "PF_IO_WORKER"
4308+
| "PF_WQ_WORKER" | "PF_FORKNOEXEC" | "PF_MCE_PROCESS" | "PF_SUPERPRIV"
4309+
| "PF_DUMPCORE" | "PF_SIGNALED" | "PF_MEMALLOC" | "PF_NPROC_EXCEEDED"
4310+
| "PF_USED_MATH" | "PF_USER_WORKER" | "PF_NOFREEZE" | "PF_KSWAPD"
4311+
| "PF_MEMALLOC_NOFS" | "PF_MEMALLOC_NOIO" | "PF_LOCAL_THROTTLE" | "PF_KTHREAD"
4312+
| "PF_RANDOMIZE" | "PF_NO_SETAFFINITY" | "PF_MCE_EARLY" | "PF_MEMALLOC_PIN"
4313+
| "PF_BLOCK_TS" | "PF_SUSPEND_TASK" => true,
43264314

43274315
// FIXME(linux): Requires >= 6.9 kernel headers.
43284316
"EPIOCSPARAMS" | "EPIOCGPARAMS" => true,
@@ -4334,14 +4322,12 @@ fn test_linux(target: &str) {
43344322
"SOF_TIMESTAMPING_OPT_RX_FILTER" => true,
43354323

43364324
// FIXME(linux): Requires >= 6.12 kernel headers.
4337-
"SO_DEVMEM_LINEAR"
4338-
| "SO_DEVMEM_DMABUF"
4339-
| "SO_DEVMEM_DONTNEED"
4340-
| "SCM_DEVMEM_LINEAR"
4341-
| "SCM_DEVMEM_DMABUF" => true,
4325+
"SO_DEVMEM_LINEAR" | "SO_DEVMEM_DMABUF" | "SO_DEVMEM_DONTNEED"
4326+
| "SCM_DEVMEM_LINEAR" | "SCM_DEVMEM_DMABUF" => true,
43424327

43434328
// FIXME(linux): Requires >= 6.4 kernel headers.
4344-
"PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG" | "PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG" => true,
4329+
"PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG"
4330+
| "PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG" => true,
43454331

43464332
// FIXME(linux): Requires >= 6.14 kernel headers.
43474333
"SECBIT_EXEC_DENY_INTERACTIVE"

0 commit comments

Comments
 (0)