Skip to content

Commit 9a5bf27

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. (backport <#4765>) (cherry picked from commit 4e4d9c2)
1 parent d87e81c commit 9a5bf27

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
@@ -4216,13 +4216,11 @@ fn test_linux(target: &str) {
42164216
|| name == "SO_DEVMEM_DMABUF"
42174217
|| name == "SO_DEVMEM_DONTNEED"
42184218
{
4219-
return true;
4219+
return true;
42204220
}
42214221
// FIXME(musl): Not in musl yet
4222-
if name == "SCM_DEVMEM_LINEAR"
4223-
|| name == "SCM_DEVMEM_DMABUF"
4224-
{
4225-
return true;
4222+
if name == "SCM_DEVMEM_LINEAR" || name == "SCM_DEVMEM_DMABUF" {
4223+
return true;
42264224
}
42274225
// FIXME: Does not exist on non-x86 architectures, slated for removal
42284226
// in libc in 1.0
@@ -4234,7 +4232,7 @@ fn test_linux(target: &str) {
42344232
// Constants that don't exist on the old version of musl we test with, but do exist
42354233
// on newer versions.
42364234
match name {
4237-
| "FAN_EVENT_INFO_TYPE_ERROR"
4235+
"FAN_EVENT_INFO_TYPE_ERROR"
42384236
| "FAN_EVENT_INFO_TYPE_NEW_DFID_NAME"
42394237
| "FAN_EVENT_INFO_TYPE_OLD_DFID_NAME"
42404238
| "FAN_FS_ERROR"
@@ -4256,8 +4254,7 @@ fn test_linux(target: &str) {
42564254
| "RLIM_NLIMITS"
42574255
| "SI_DETHREAD"
42584256
| "SO_BUSY_POLL_BUDGET"
4259-
| "SO_PREFER_BUSY_POLL"
4260-
=> return true,
4257+
| "SO_PREFER_BUSY_POLL" => return true,
42614258
// Values changed in newer musl versions on these arches
42624259
"O_LARGEFILE" if riscv64 || x86_64 => return true,
42634260
_ => (),
@@ -4268,13 +4265,13 @@ fn test_linux(target: &str) {
42684265
// and can therefore not be tested here
42694266
//
42704267
// The IPV6 constants are tested in the `linux_ipv6.rs` tests:
4271-
| "IPV6_FLOWINFO"
4268+
"IPV6_FLOWINFO"
42724269
| "IPV6_FLOWLABEL_MGR"
42734270
| "IPV6_FLOWINFO_SEND"
42744271
| "IPV6_FLOWINFO_FLOWLABEL"
4275-
| "IPV6_FLOWINFO_PRIORITY"
4272+
| "IPV6_FLOWINFO_PRIORITY" => true,
42764273
// The F_ fnctl constants are tested in the `linux_fnctl.rs` tests:
4277-
| "F_CANCELLK"
4274+
"F_CANCELLK"
42784275
| "F_ADD_SEALS"
42794276
| "F_GET_SEALS"
42804277
| "F_SEAL_SEAL"
@@ -4297,12 +4294,7 @@ fn test_linux(target: &str) {
42974294

42984295
// FIXME(linux): conflicts with glibc headers and is tested in
42994296
// `linux_termios.rs` below:
4300-
| "BOTHER"
4301-
| "IBSHIFT"
4302-
| "TCGETS2"
4303-
| "TCSETS2"
4304-
| "TCSETSW2"
4305-
| "TCSETSF2" => true,
4297+
"BOTHER" | "IBSHIFT" | "TCGETS2" | "TCSETS2" | "TCSETSW2" | "TCSETSF2" => true,
43064298

43074299
// FIXME(musl): on musl the pthread types are defined a little differently
43084300
// - these constants are used by the glibc implementation.
@@ -4322,13 +4314,17 @@ fn test_linux(target: &str) {
43224314
"SYS_clone3" if sparc64 => true,
43234315

43244316
// FIXME(linux): Not defined on ARM, gnueabihf, mips, musl, PowerPC, riscv64, s390x, and sparc64.
4325-
"SYS_memfd_secret" if arm | gnueabihf | mips | musl | ppc | riscv64 | s390x | sparc64 => true,
4317+
"SYS_memfd_secret"
4318+
if arm | gnueabihf | mips | musl | ppc | riscv64 | s390x | sparc64 =>
4319+
{
4320+
true
4321+
}
43264322

43274323
// Skip as this signal codes and trap reasons need newer headers
43284324
"TRAP_PERF" => true,
43294325

43304326
// kernel constants not available in uclibc 1.0.34
4331-
| "EXTPROC"
4327+
"EXTPROC"
43324328
| "IPPROTO_BEETPH"
43334329
| "IPPROTO_MPLS"
43344330
| "IPV6_HDRINCL"
@@ -4341,7 +4337,10 @@ fn test_linux(target: &str) {
43414337
| "SHM_EXEC"
43424338
| "UDP_GRO"
43434339
| "UDP_SEGMENT"
4344-
if uclibc => true,
4340+
if uclibc =>
4341+
{
4342+
true
4343+
}
43454344

43464345
// headers conflicts with linux/pidfd.h
43474346
"PIDFD_NONBLOCK" => true,
@@ -4384,17 +4383,18 @@ fn test_linux(target: &str) {
43844383
| "PR_SCHED_CORE_SCOPE_THREAD"
43854384
| "PR_SCHED_CORE_SCOPE_THREAD_GROUP"
43864385
| "PR_SCHED_CORE_SHARE_FROM"
4387-
| "PR_SCHED_CORE_SHARE_TO" if old_musl => true,
4386+
| "PR_SCHED_CORE_SHARE_TO"
4387+
if old_musl =>
4388+
{
4389+
true
4390+
}
43884391

43894392
// Not present in glibc
43904393
"PR_SME_VL_LEN_MAX" | "PR_SME_SET_VL_INHERIT" | "PR_SME_SET_VL_ONE_EXEC" if gnu => true,
43914394

43924395
// FIXME(linux): The below is no longer const in glibc 2.34:
43934396
// https://github.com/bminor/glibc/commit/5d98a7dae955bafa6740c26eaba9c86060ae0344
4394-
| "PTHREAD_STACK_MIN"
4395-
| "SIGSTKSZ"
4396-
| "MINSIGSTKSZ"
4397-
if gnu => true,
4397+
"PTHREAD_STACK_MIN" | "SIGSTKSZ" | "MINSIGSTKSZ" if gnu => true,
43984398

43994399
// value changed
44004400
"NF_NETDEV_NUMHOOKS" if sparc64 => true,
@@ -4421,7 +4421,10 @@ fn test_linux(target: &str) {
44214421
| "FAN_EVENT_INFO_TYPE_PIDFD"
44224422
| "FAN_NOPIDFD"
44234423
| "FAN_EPIDFD"
4424-
if musl => true,
4424+
if musl =>
4425+
{
4426+
true
4427+
}
44254428

44264429
// FIXME(linux): Requires >= 6.6 kernel headers.
44274430
"XDP_USE_SG" | "XDP_PKT_CONTD" => true,
@@ -4433,16 +4436,21 @@ fn test_linux(target: &str) {
44334436
"XDP_UMEM_TX_SW_CSUM"
44344437
| "XDP_TXMD_FLAGS_TIMESTAMP"
44354438
| "XDP_TXMD_FLAGS_CHECKSUM"
4436-
| "XDP_TX_METADATA"
4437-
=> true,
4439+
| "XDP_TX_METADATA" => true,
44384440

44394441
// FIXME(linux): Requires >= 6.11 kernel headers.
44404442
"XDP_UMEM_TX_METADATA_LEN" => true,
44414443

44424444
// FIXME(linux): Requires >= 6.11 kernel headers.
4443-
"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,
4445+
"NS_GET_MNTNS_ID"
4446+
| "NS_GET_PID_FROM_PIDNS"
4447+
| "NS_GET_TGID_FROM_PIDNS"
4448+
| "NS_GET_PID_IN_PIDNS"
4449+
| "NS_GET_TGID_IN_PIDNS" => true,
44444450
// FIXME(linux): Requires >= 6.12 kernel headers.
4445-
"MNT_NS_INFO_SIZE_VER0" | "NS_MNT_GET_INFO" | "NS_MNT_GET_NEXT" | "NS_MNT_GET_PREV" => true,
4451+
"MNT_NS_INFO_SIZE_VER0" | "NS_MNT_GET_INFO" | "NS_MNT_GET_NEXT" | "NS_MNT_GET_PREV" => {
4452+
true
4453+
}
44464454

44474455
// FIXME(linux): Requires >= 6.6 kernel headers.
44484456
"SYS_fchmodat2" => true,
@@ -4451,33 +4459,13 @@ fn test_linux(target: &str) {
44514459
"SYS_mseal" => true,
44524460

44534461
// FIXME(linux): seems to not be available all the time (from <include/linux/sched.h>:
4454-
"PF_VCPU"
4455-
| "PF_IDLE"
4456-
| "PF_EXITING"
4457-
| "PF_POSTCOREDUMP"
4458-
| "PF_IO_WORKER"
4459-
| "PF_WQ_WORKER"
4460-
| "PF_FORKNOEXEC"
4461-
| "PF_MCE_PROCESS"
4462-
| "PF_SUPERPRIV"
4463-
| "PF_DUMPCORE"
4464-
| "PF_SIGNALED"
4465-
| "PF_MEMALLOC"
4466-
| "PF_NPROC_EXCEEDED"
4467-
| "PF_USED_MATH"
4468-
| "PF_USER_WORKER"
4469-
| "PF_NOFREEZE"
4470-
| "PF_KSWAPD"
4471-
| "PF_MEMALLOC_NOFS"
4472-
| "PF_MEMALLOC_NOIO"
4473-
| "PF_LOCAL_THROTTLE"
4474-
| "PF_KTHREAD"
4475-
| "PF_RANDOMIZE"
4476-
| "PF_NO_SETAFFINITY"
4477-
| "PF_MCE_EARLY"
4478-
| "PF_MEMALLOC_PIN"
4479-
| "PF_BLOCK_TS"
4480-
| "PF_SUSPEND_TASK" => true,
4462+
"PF_VCPU" | "PF_IDLE" | "PF_EXITING" | "PF_POSTCOREDUMP" | "PF_IO_WORKER"
4463+
| "PF_WQ_WORKER" | "PF_FORKNOEXEC" | "PF_MCE_PROCESS" | "PF_SUPERPRIV"
4464+
| "PF_DUMPCORE" | "PF_SIGNALED" | "PF_MEMALLOC" | "PF_NPROC_EXCEEDED"
4465+
| "PF_USED_MATH" | "PF_USER_WORKER" | "PF_NOFREEZE" | "PF_KSWAPD"
4466+
| "PF_MEMALLOC_NOFS" | "PF_MEMALLOC_NOIO" | "PF_LOCAL_THROTTLE" | "PF_KTHREAD"
4467+
| "PF_RANDOMIZE" | "PF_NO_SETAFFINITY" | "PF_MCE_EARLY" | "PF_MEMALLOC_PIN"
4468+
| "PF_BLOCK_TS" | "PF_SUSPEND_TASK" => true,
44814469

44824470
// FIXME(linux): Requires >= 6.9 kernel headers.
44834471
"EPIOCSPARAMS" | "EPIOCGPARAMS" => true,
@@ -4489,14 +4477,12 @@ fn test_linux(target: &str) {
44894477
"SOF_TIMESTAMPING_OPT_RX_FILTER" => true,
44904478

44914479
// FIXME(linux): Requires >= 6.12 kernel headers.
4492-
"SO_DEVMEM_LINEAR"
4493-
| "SO_DEVMEM_DMABUF"
4494-
| "SO_DEVMEM_DONTNEED"
4495-
| "SCM_DEVMEM_LINEAR"
4496-
| "SCM_DEVMEM_DMABUF" => true,
4480+
"SO_DEVMEM_LINEAR" | "SO_DEVMEM_DMABUF" | "SO_DEVMEM_DONTNEED"
4481+
| "SCM_DEVMEM_LINEAR" | "SCM_DEVMEM_DMABUF" => true,
44974482

44984483
// FIXME(linux): Requires >= 6.4 kernel headers.
4499-
"PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG" | "PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG" => true,
4484+
"PTRACE_SET_SYSCALL_USER_DISPATCH_CONFIG"
4485+
| "PTRACE_GET_SYSCALL_USER_DISPATCH_CONFIG" => true,
45004486

45014487
// FIXME(linux): Requires >= 6.14 kernel headers.
45024488
"SECBIT_EXEC_DENY_INTERACTIVE"

0 commit comments

Comments
 (0)