From 2874ca2921c91f339fcdfffeb8033f9abf3a234f Mon Sep 17 00:00:00 2001 From: Douglas Raillard Date: Wed, 12 Feb 2025 12:45:27 +0000 Subject: [PATCH] tools/trace-parser: Update dependencies Update all dependencies, most notably nom from v7 to v8. Since this is a major version bump, there were some breaking changes so changes were needed on our side. --- tools/recipes/trace-tools.recipe | 4 +- tools/trace-parser/trace-tools/Cargo.lock | 357 +++++++++--------- tools/trace-parser/trace-tools/Cargo.toml | 12 +- .../src/lib/tracedat/parquet/dump.rs | 6 +- tools/trace-parser/traceevent/Cargo.lock | 99 ++--- tools/trace-parser/traceevent/Cargo.toml | 9 +- tools/trace-parser/traceevent/src/array.rs | 20 +- tools/trace-parser/traceevent/src/buffer.rs | 137 ++++--- tools/trace-parser/traceevent/src/cinterp.rs | 16 +- tools/trace-parser/traceevent/src/cparser.rs | 126 +++---- tools/trace-parser/traceevent/src/grammar.rs | 21 +- tools/trace-parser/traceevent/src/header.rs | 29 +- tools/trace-parser/traceevent/src/io.rs | 15 +- tools/trace-parser/traceevent/src/parser.rs | 85 +++-- tools/trace-parser/traceevent/src/print.rs | 32 +- tools/trace-parser/traceevent/src/scratch.rs | 42 +-- tools/trace-parser/traceevent/src/str.rs | 24 +- 17 files changed, 514 insertions(+), 520 deletions(-) diff --git a/tools/recipes/trace-tools.recipe b/tools/recipes/trace-tools.recipe index d4f4b9899..279cab9af 100644 --- a/tools/recipes/trace-tools.recipe +++ b/tools/recipes/trace-tools.recipe @@ -1,6 +1,6 @@ #! /bin/bash -ALPINE_VERSION=v3.20 +ALPINE_VERSION=v3.21 ALPINE_BUILD_DEPENDENCIES=(bash git curl musl-dev clang lld) BROKEN_CROSS_COMPILATION=0 @@ -43,7 +43,7 @@ install_rust() { build_tracedump() { cd trace-parser/trace-tools && - time RUSTFLAGS="$RUSTFLAGS -C target-feature=+crt-static" cargo build --profile release-lisa --target="$(make_triplet)" + time RUSTFLAGS="$RUSTFLAGS -C target-feature=+crt-static" cargo build --locked --profile release-lisa --target="$(make_triplet)" } download() { diff --git a/tools/trace-parser/trace-tools/Cargo.lock b/tools/trace-parser/trace-tools/Cargo.lock index ed8fb0c54..06070420a 100644 --- a/tools/trace-parser/trace-tools/Cargo.lock +++ b/tools/trace-parser/trace-tools/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "ahash" @@ -42,9 +42,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -57,43 +57,44 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys", ] [[package]] name = "arrow" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45aef0d9cf9a039bf6cd1acc451b137aca819977b0928dece52bd92811b640ba" +checksum = "755b6da235ac356a869393c23668c663720b8749dd6f15e52b6c214b4b964cc7" dependencies = [ "arrow-arith", "arrow-array", @@ -109,24 +110,23 @@ dependencies = [ [[package]] name = "arrow-arith" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03675e42d1560790f3524800e41403b40d0da1c793fe9528929fde06d8c7649a" +checksum = "64656a1e0b13ca766f8440752e9a93e11014eec7b67909986f83ed0ab1fe37b8" dependencies = [ "arrow-array", "arrow-buffer", "arrow-data", "arrow-schema", "chrono", - "half", "num", ] [[package]] name = "arrow-array" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd2bf348cf9f02a5975c5962c7fa6dee107a2009a7b41ac5fb1a027e12dc033f" +checksum = "57a4a6d2896083cfbdf84a71a863b22460d0708f8206a8373c52e326cc72ea1a" dependencies = [ "ahash", "arrow-buffer", @@ -140,9 +140,9 @@ dependencies = [ [[package]] name = "arrow-buffer" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3092e37715f168976012ce52273c3989b5793b0db5f06cbaa246be25e5f0924d" +checksum = "cef870583ce5e4f3b123c181706f2002fb134960f9a911900f64ba4830c7a43a" dependencies = [ "bytes", "half", @@ -151,9 +151,9 @@ dependencies = [ [[package]] name = "arrow-cast" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ce1018bb710d502f9db06af026ed3561552e493e989a79d0d0f5d9cf267a785" +checksum = "1ac7eba5a987f8b4a7d9629206ba48e19a1991762795bbe5d08497b7736017ee" dependencies = [ "arrow-array", "arrow-buffer", @@ -171,9 +171,9 @@ dependencies = [ [[package]] name = "arrow-data" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4ac0c4ee79150afe067dc4857154b3ee9c1cd52b5f40d59a77306d0ed18d65" +checksum = "b095e8a4f3c309544935d53e04c3bfe4eea4e71c3de6fe0416d1f08bb4441a83" dependencies = [ "arrow-buffer", "arrow-schema", @@ -183,13 +183,12 @@ dependencies = [ [[package]] name = "arrow-ipc" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb307482348a1267f91b0912e962cd53440e5de0f7fb24c5f7b10da70b38c94a" +checksum = "65c63da4afedde2b25ef69825cd4663ca76f78f79ffe2d057695742099130ff6" dependencies = [ "arrow-array", "arrow-buffer", - "arrow-cast", "arrow-data", "arrow-schema", "flatbuffers", @@ -197,26 +196,23 @@ dependencies = [ [[package]] name = "arrow-ord" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644046c479d80ae8ed02a7f1e1399072ea344ca6a7b0e293ab2d5d9ed924aa3b" +checksum = "6c07223476f8219d1ace8cd8d85fa18c4ebd8d945013f25ef5c72e85085ca4ee" dependencies = [ "arrow-array", "arrow-buffer", "arrow-data", "arrow-schema", "arrow-select", - "half", - "num", ] [[package]] name = "arrow-row" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a29791f8eb13b340ce35525b723f5f0df17ecb955599e11f65c2a94ab34e2efb" +checksum = "91b194b38bfd89feabc23e798238989c6648b2506ad639be42ec8eb1658d82c4" dependencies = [ - "ahash", "arrow-array", "arrow-buffer", "arrow-data", @@ -226,15 +222,15 @@ dependencies = [ [[package]] name = "arrow-schema" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85320a3a2facf2b2822b57aa9d6d9d55edb8aee0b6b5d3b8df158e503d10858" +checksum = "0f40f6be8f78af1ab610db7d9b236e21d587b7168e368a36275d2e5670096735" [[package]] name = "arrow-select" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cc7e6b582e23855fd1625ce46e51647aa440c20ea2e71b1d748e0839dd73cba" +checksum = "ac265273864a820c4a179fc67182ccc41ea9151b97024e1be956f0f2369c2539" dependencies = [ "ahash", "arrow-array", @@ -246,9 +242,9 @@ dependencies = [ [[package]] name = "arrow-string" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0775b6567c66e56ded19b87a954b6b1beffbdd784ef95a3a2b03f59570c1d230" +checksum = "d44c8eed43be4ead49128370f7131f054839d3d6003e52aebf64322470b8fbd0" dependencies = [ "arrow-array", "arrow-buffer", @@ -272,9 +268,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "base64" @@ -290,15 +286,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytecount" @@ -308,9 +304,9 @@ checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] name = "byteorder" @@ -320,15 +316,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "cc" -version = "1.1.18" +version = "1.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" dependencies = [ "jobserver", "libc", @@ -343,9 +339,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -355,9 +351,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.17" +version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" dependencies = [ "clap_builder", "clap_derive", @@ -365,9 +361,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" dependencies = [ "anstream", "anstyle", @@ -377,27 +373,27 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.98", ] [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "const-random" @@ -440,18 +436,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" dependencies = [ "crossbeam-epoch", "crossbeam-utils", @@ -468,24 +464,24 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +checksum = "0f58bbc28f91df819d0aa2a2c00cd19754769c2fad90579b3592b1c9ba7a3115" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] name = "deref-map" @@ -501,9 +497,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "flatbuffers" -version = "24.3.25" +version = "24.12.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8add37afff2d4ffa83bc748a70b4b1370984f6980768554182424ef71447c35f" +checksum = "4f1baf0dbf96932ec9a3038d57900329c015b0bfb7b63d904f3bc27e2b02a096" dependencies = [ "bitflags 1.3.2", "rustc_version", @@ -563,9 +559,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -575,9 +571,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -610,18 +606,18 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jobserver" @@ -634,18 +630,19 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ + "once_cell", "wasm-bindgen", ] [[package]] name = "lexical-core" -version = "0.8.5" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cde5de06e8d4c2faabc400238f9ae1c74d5412d03a7bd067645ccbc47070e46" +checksum = "b765c31809609075565a70b4b71402281283aeda7ecaf4818ac14a7b2ade8958" dependencies = [ "lexical-parse-float", "lexical-parse-integer", @@ -656,9 +653,9 @@ dependencies = [ [[package]] name = "lexical-parse-float" -version = "0.8.5" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683b3a5ebd0130b8fb52ba0bdc718cc56815b6a097e28ae5a6997d0ad17dc05f" +checksum = "de6f9cb01fb0b08060209a057c048fcbab8717b4c1ecd2eac66ebfe39a65b0f2" dependencies = [ "lexical-parse-integer", "lexical-util", @@ -667,9 +664,9 @@ dependencies = [ [[package]] name = "lexical-parse-integer" -version = "0.8.6" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0994485ed0c312f6d965766754ea177d07f9c00c9b82a5ee62ed5b47945ee9" +checksum = "72207aae22fc0a121ba7b6d479e42cbfea549af1479c3f3a4f12c70dd66df12e" dependencies = [ "lexical-util", "static_assertions", @@ -677,18 +674,18 @@ dependencies = [ [[package]] name = "lexical-util" -version = "0.8.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5255b9ff16ff898710eb9eb63cb39248ea8a5bb036bea8085b1a767ff6c4e3fc" +checksum = "5a82e24bf537fd24c177ffbbdc6ebcc8d54732c35b50a3f28cc3f4e4c949a0b3" dependencies = [ "static_assertions", ] [[package]] name = "lexical-write-float" -version = "0.8.5" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accabaa1c4581f05a3923d1b4cfd124c329352288b7b9da09e766b0668116862" +checksum = "c5afc668a27f460fb45a81a757b6bf2f43c2d7e30cb5a2dcd3abf294c78d62bd" dependencies = [ "lexical-util", "lexical-write-integer", @@ -697,9 +694,9 @@ dependencies = [ [[package]] name = "lexical-write-integer" -version = "0.8.5" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1b6f3d1f4422866b68192d62f77bc5c700bee84f3069f2469d7bc8c77852446" +checksum = "629ddff1a914a836fb245616a7888b62903aae58fa771e1d83943035efa0f978" dependencies = [ "lexical-util", "static_assertions", @@ -707,33 +704,33 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.158" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libdeflate-sys" -version = "1.21.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b14a6afa4e2e1d343fd793a1c0a7e5857a73a2697c2ff2c98ac00d6c4ecc820" +checksum = "413b667c8a795fcbe6287a75a8ce92b1dae928172c716fe95044cb2ec7877941" dependencies = [ "cc", ] [[package]] name = "libdeflater" -version = "1.21.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17fe2badabdaf756f620748311e99ef99a5fdd681562dfd343fdb16ed7d4797" +checksum = "d78376c917eec0550b9c56c858de50e1b7ebf303116487562e624e63ce51453a" dependencies = [ "libdeflate-sys", ] [[package]] name = "libm" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" [[package]] name = "libmimalloc-sys" @@ -747,9 +744,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "lz4_flex" @@ -768,9 +765,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" dependencies = [ "libc", ] @@ -785,26 +782,28 @@ dependencies = [ ] [[package]] -name = "minimal-lexical" -version = "0.2.1" +name = "nom" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] [[package]] -name = "nom" -version = "7.1.3" +name = "nom-language" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "2de2bc5b451bfedaef92c90b8939a8fff5770bdcc1fafd6239d086aab8fa6b29" dependencies = [ - "memchr", - "minimal-lexical", + "nom", ] [[package]] name = "nom_locate" -version = "4.2.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e3c83c053b0713da60c5b8de47fe8e494fe3ece5267b2f23090a07a053ba8f3" +checksum = "0b577e2d69827c4740cba2b52efaad1c4cc7c73042860b199710b3575c68438d" dependencies = [ "bytecount", "memchr", @@ -887,9 +886,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "ordered-float" @@ -902,9 +901,9 @@ dependencies = [ [[package]] name = "parquet" -version = "53.0.0" +version = "54.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0fbf928021131daaa57d334ca8e3904fe9ae22f73c56244fc7db9b04eedc3d8" +checksum = "761c44d824fe83106e0600d2510c07bf4159a4985bf0569b513ea4288dc1b4fb" dependencies = [ "ahash", "arrow-array", @@ -939,9 +938,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "proc-macro-error" @@ -977,27 +976,27 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] [[package]] name = "regex" -version = "1.10.6" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -1007,9 +1006,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1018,9 +1017,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc_version" @@ -1031,17 +1030,23 @@ dependencies = [ "semver", ] +[[package]] +name = "rustversion" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" + [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "semver" -version = "1.0.23" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" [[package]] name = "seq-macro" @@ -1051,29 +1056,29 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.98", ] [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr", @@ -1130,9 +1135,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -1152,22 +1157,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.98", ] [[package]] @@ -1224,7 +1229,7 @@ dependencies = [ name = "traceevent" version = "0.1.0" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.8.0", "bumpalo", "bytemuck", "deref-map", @@ -1233,6 +1238,7 @@ dependencies = [ "libdeflater", "memmap2", "nom", + "nom-language", "nom_locate", "once_cell", "smartstring", @@ -1253,9 +1259,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "utf8parse" @@ -1277,35 +1283,35 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.98", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1313,22 +1319,25 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.98", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "windows-core" @@ -1341,9 +1350,9 @@ dependencies = [ [[package]] name = "windows-sys" -version = "0.52.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ "windows-targets", ] @@ -1429,7 +1438,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.98", ] [[package]] diff --git a/tools/trace-parser/trace-tools/Cargo.toml b/tools/trace-parser/trace-tools/Cargo.toml index 343faf46c..729f4fa35 100644 --- a/tools/trace-parser/trace-tools/Cargo.toml +++ b/tools/trace-parser/trace-tools/Cargo.toml @@ -12,17 +12,17 @@ path = "src/lib/lib.rs" [dependencies] traceevent = { path = "../traceevent", optional = true } -thiserror = "1.0" +thiserror = "2.0" smartstring = {version = "1.0", features = ["serde"]} -arrow = { version = "53.0", default-features = false } -arrow-schema = { version = "53.0", default-features = false } -arrow-array = { version = "53.0" } -parquet = { version = "53.0", default-features = false, features = ["arrow", "lz4", "zstd", "snap" ] } +arrow = { version = "54.0", default-features = false } +arrow-schema = { version = "54.0", default-features = false } +arrow-array = { version = "54.0" } +parquet = { version = "54.0", default-features = false, features = ["arrow", "lz4", "zstd", "snap" ] } crossbeam = "0.8" serde_json = "1.0" serde = { version = "1.0", features = ["derive"] } -nom = "7.1" +nom = "8.0" bytemuck = "1.13" clap = { version = "4.4", features = ["derive"] } diff --git a/tools/trace-parser/trace-tools/src/lib/tracedat/parquet/dump.rs b/tools/trace-parser/trace-tools/src/lib/tracedat/parquet/dump.rs index 1a483a80d..2642dca37 100644 --- a/tools/trace-parser/trace-tools/src/lib/tracedat/parquet/dump.rs +++ b/tools/trace-parser/trace-tools/src/lib/tracedat/parquet/dump.rs @@ -162,7 +162,7 @@ pub struct Metadata<'h> { time_range: Option<(Timestamp, Timestamp)>, } -impl<'h> Metadata<'h> { +impl Metadata<'_> { pub fn dump(self, mut writer: W) -> Result<(), MainError> { let header = self.header; let events_info = self.events_info; @@ -1022,7 +1022,7 @@ where RcRefMut(RefMut<'a, T>), } - impl<'a, T> Deref for DerefMutWrapper<'a, T> { + impl Deref for DerefMutWrapper<'_, T> { type Target = T; fn deref(&self) -> &T { match self { @@ -1032,7 +1032,7 @@ where } } - impl<'a, T> DerefMut for DerefMutWrapper<'a, T> { + impl DerefMut for DerefMutWrapper<'_, T> { fn deref_mut(&mut self) -> &mut T { match self { DerefMutWrapper::RefMut(x) => x, diff --git a/tools/trace-parser/traceevent/Cargo.lock b/tools/trace-parser/traceevent/Cargo.lock index 8ae729aae..c95864606 100644 --- a/tools/trace-parser/traceevent/Cargo.lock +++ b/tools/trace-parser/traceevent/Cargo.lock @@ -1,24 +1,24 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "bytecount" @@ -28,15 +28,15 @@ checksum = "5ce89b21cab1437276d2650d57e971f9d548a2d9037cc231abdc0562b97498ce" [[package]] name = "bytemuck" -version = "1.18.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94bbb0ad554ad961ddc5da507a12a29b14e4ae5bda06b19f575a3e6079d2e2ae" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] name = "cc" -version = "1.1.18" +version = "1.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" dependencies = [ "jobserver", "libc", @@ -93,9 +93,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -111,24 +111,24 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.158" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libdeflate-sys" -version = "1.21.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b14a6afa4e2e1d343fd793a1c0a7e5857a73a2697c2ff2c98ac00d6c4ecc820" +checksum = "413b667c8a795fcbe6287a75a8ce92b1dae928172c716fe95044cb2ec7877941" dependencies = [ "cc", ] [[package]] name = "libdeflater" -version = "1.21.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17fe2badabdaf756f620748311e99ef99a5fdd681562dfd343fdb16ed7d4797" +checksum = "d78376c917eec0550b9c56c858de50e1b7ebf303116487562e624e63ce51453a" dependencies = [ "libdeflate-sys", ] @@ -141,34 +141,36 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" dependencies = [ "libc", ] [[package]] -name = "minimal-lexical" -version = "0.2.1" +name = "nom" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +checksum = "df9761775871bdef83bee530e60050f7e54b1105350d6884eb0fb4f46c2f9405" +dependencies = [ + "memchr", +] [[package]] -name = "nom" -version = "7.1.3" +name = "nom-language" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "2de2bc5b451bfedaef92c90b8939a8fff5770bdcc1fafd6239d086aab8fa6b29" dependencies = [ - "memchr", - "minimal-lexical", + "nom", ] [[package]] name = "nom_locate" -version = "4.2.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e3c83c053b0713da60c5b8de47fe8e494fe3ece5267b2f23090a07a053ba8f3" +checksum = "0b577e2d69827c4740cba2b52efaad1c4cc7c73042860b199710b3575c68438d" dependencies = [ "bytecount", "memchr", @@ -177,15 +179,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "proc-macro-error" @@ -221,18 +223,18 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -273,9 +275,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.77" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -295,22 +297,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.77", + "syn 2.0.98", ] [[package]] @@ -336,6 +338,7 @@ dependencies = [ "libdeflater", "memmap2", "nom", + "nom-language", "nom_locate", "once_cell", "smartstring", @@ -346,9 +349,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "version_check" diff --git a/tools/trace-parser/traceevent/Cargo.toml b/tools/trace-parser/traceevent/Cargo.toml index 7b16588db..7d22f6138 100644 --- a/tools/trace-parser/traceevent/Cargo.toml +++ b/tools/trace-parser/traceevent/Cargo.toml @@ -6,19 +6,20 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -nom = "7.1" -nom_locate = "4.0" +nom = "8.0" +nom_locate = "5.0" smartstring = "1.0" -thiserror = "1.0" +thiserror = "2.0" memmap2 = "0.9" deref-map = "0.1.0" genawaiter = "0.99.1" bumpalo = {version="3.12", features=["collections", "boxed"]} # Can be replaced with std::cell::OnceCell the day it's stabilized once_cell = "1.17" -itertools = "0.13" +itertools = "0.14" bitflags = "2.0" libdeflater = {version = "1.19", features=["freestanding"]} bytemuck = "1.13" thread_local = "1.1" zstd = "0.13" +nom-language = "0.1" diff --git a/tools/trace-parser/traceevent/src/array.rs b/tools/trace-parser/traceevent/src/array.rs index 6170e8315..0dfefe159 100644 --- a/tools/trace-parser/traceevent/src/array.rs +++ b/tools/trace-parser/traceevent/src/array.rs @@ -34,7 +34,7 @@ pub enum Array<'a, T> { Arc(Arc<[T]>), } -impl<'a, T> Array<'a, T> { +impl Array<'_, T> { #[inline] pub fn into_static(self) -> Array<'static, T> where @@ -47,7 +47,7 @@ impl<'a, T> Array<'a, T> { } } -impl<'a, T> Deref for Array<'a, T> { +impl Deref for Array<'_, T> { type Target = [T]; #[inline] @@ -59,7 +59,7 @@ impl<'a, T> Deref for Array<'a, T> { } } -impl<'a, T> AsRef<[T]> for Array<'a, T> { +impl AsRef<[T]> for Array<'_, T> { #[inline] fn as_ref(&self) -> &[T] { self.deref() @@ -87,44 +87,44 @@ impl<'a, T: Clone> From<&Array<'a, T>> for Vec { } } -impl<'a, T: PartialEq> PartialEq for Array<'a, T> { +impl PartialEq for Array<'_, T> { #[inline] fn eq(&self, other: &Self) -> bool { self.deref() == other.deref() } } -impl<'a, T: Eq> Eq for Array<'a, T> {} +impl Eq for Array<'_, T> {} -impl<'a, T: PartialOrd> PartialOrd for Array<'a, T> { +impl PartialOrd for Array<'_, T> { #[inline] fn partial_cmp(&self, other: &Self) -> Option { self.deref().partial_cmp(other.deref()) } } -impl<'a, T: Ord> Ord for Array<'a, T> { +impl Ord for Array<'_, T> { #[inline] fn cmp(&self, other: &Self) -> Ordering { self.deref().cmp(other.deref()) } } -impl<'a, T: Hash> Hash for Array<'a, T> { +impl Hash for Array<'_, T> { #[inline] fn hash(&self, state: &mut H) { Hash::hash(self.deref(), state) } } -impl<'a, T> Borrow<[T]> for Array<'a, T> { +impl Borrow<[T]> for Array<'_, T> { #[inline] fn borrow(&self) -> &[T] { self } } -impl<'a, T> fmt::Display for Array<'a, T> +impl fmt::Display for Array<'_, T> where T: fmt::Display, { diff --git a/tools/trace-parser/traceevent/src/buffer.rs b/tools/trace-parser/traceevent/src/buffer.rs index e36de6320..1a844df8a 100644 --- a/tools/trace-parser/traceevent/src/buffer.rs +++ b/tools/trace-parser/traceevent/src/buffer.rs @@ -70,7 +70,7 @@ struct EventDescMap<'h, Ctx, MakeCtx> { make_ctx: Arc>, } -impl<'h, Ctx: Debug, MakeCtx> Debug for EventDescMap<'h, Ctx, MakeCtx> { +impl Debug for EventDescMap<'_, Ctx, MakeCtx> { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), core::fmt::Error> { f.debug_struct("EventDescMap") .field("cold_map", &self.cold_map) @@ -686,7 +686,7 @@ struct BufferItem<'a, Ctx, MakeCtx>( >, ); -impl<'a, Ctx, MakeCtx> PartialEq for BufferItem<'a, Ctx, MakeCtx> { +impl PartialEq for BufferItem<'_, Ctx, MakeCtx> { #[inline] fn eq(&self, other: &Self) -> bool { match (&self.0, &other.0) { @@ -696,16 +696,16 @@ impl<'a, Ctx, MakeCtx> PartialEq for BufferItem<'a, Ctx, MakeCtx> { } } -impl<'a, Ctx, MakeCtx> Eq for BufferItem<'a, Ctx, MakeCtx> {} +impl Eq for BufferItem<'_, Ctx, MakeCtx> {} -impl<'a, Ctx, MakeCtx> PartialOrd for BufferItem<'a, Ctx, MakeCtx> { +impl PartialOrd for BufferItem<'_, Ctx, MakeCtx> { #[inline] fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } } -impl<'a, Ctx, MakeCtx> Ord for BufferItem<'a, Ctx, MakeCtx> { +impl Ord for BufferItem<'_, Ctx, MakeCtx> { #[inline] fn cmp(&self, other: &Self) -> Ordering { match (&self.0, &other.0) { @@ -898,82 +898,77 @@ where { let make_ctx = Arc::new(Mutex::new(make_ctx)); - macro_rules! make_record_iter { - ($buffer:expr) => {{ - let mut buffer = $buffer; + let iterators = buffers.into_iter().map(|mut buffer| { + let header = buffer.header; + let timestamp_fixer = header.timestamp_fixer(); + let make_ctx = Arc::clone(&make_ctx); + + // Each buffer will have its own hot map which is not ideal, but the + // maps contain &EventDesc so the descriptor itself actually lives + // in the header and is shared. This ensures we will not parse event + // format more than once, which is the main cost here. + let mut desc_map = EventDescMap::new(header, make_ctx); + gen!({ let buf_id = buffer.id; - let header = buffer.header; - let timestamp_fixer = header.timestamp_fixer(); - let make_ctx = Arc::clone(&make_ctx); - - // Each buffer will have its own hot map which is not ideal, but the - // maps contain &EventDesc so the descriptor itself actually lives - // in the header and is shared. This ensures we will not parse event - // format more than once, which is the main cost here. - let mut desc_map = EventDescMap::new(header, make_ctx); - gen!({ - loop { - match extract_page(header, &buf_id, &mut buffer.reader, buffer.page_size) { - Ok(Some((data, mut timestamp, recoverable_err))) => { - if let Some(err) = recoverable_err { - yield_!(BufferItem(Err(err))) - } + let page_size = buffer.page_size; + loop { + match extract_page(header, &buf_id, &mut buffer.reader, page_size) { + Ok(Some((data, mut timestamp, recoverable_err))) => { + if let Some(err) = recoverable_err { + yield_!(BufferItem(Err(err))) + } - let mut data = &*data; - while data.len() != 0 { - match parse_record(header, data, timestamp) { - Ok((remaining, timestamp_, record)) => { - timestamp = timestamp_; - data = remaining; - match record { - Ok(BufferRecord::Event(data)) => { - // SAFETY: That yielded &[u8] will - // only stay valid until the next - // time next() is called on the - // iterator. MergedIterator - // specifically guarantees to not - // call next() on inner iterators - // before its own next() is called. - // - // Note that this is not the case - // with e.g. itertools kmerge_by() - // method. - let data = unsafe { transmute_lifetime(data) }; - let buf_id_ref = - unsafe { transmute_lifetime(&buf_id) }; - let desc_map_ref = unsafe { - transmute_lifetime_mut(&mut desc_map) - }; - yield_!(BufferItem(Ok(( - header, - desc_map_ref, - buf_id_ref, - timestamp_fixer(timestamp), - data - )))); - } - _ => (), + let mut data = &*data; + while data.len() != 0 { + match parse_record(header, data, timestamp) { + Ok((remaining, timestamp_, record)) => { + timestamp = timestamp_; + data = remaining; + match record { + Ok(BufferRecord::Event(data)) => { + // SAFETY: That yielded &[u8] will + // only stay valid until the next + // time next() is called on the + // iterator. MergedIterator + // specifically guarantees to not + // call next() on inner iterators + // before its own next() is called. + // + // Note that this is not the case + // with e.g. itertools kmerge_by() + // method. + let data = unsafe { transmute_lifetime(data) }; + let buf_id_ref = unsafe { transmute_lifetime(&buf_id) }; + let desc_map_ref = + unsafe { transmute_lifetime_mut(&mut desc_map) }; + yield_!(BufferItem(Ok(( + header, + desc_map_ref, + buf_id_ref, + timestamp_fixer(timestamp), + data + )))); } - } - Err(err) => { - yield_!(BufferItem(Err(err.into()))); - break; + _ => (), } } + Err(err) => { + yield_!(BufferItem(Err(err.into()))); + break; + } } } - Ok(None) => break, - Err(err) => { - yield_!(BufferItem(Err(err))); - break; - } + } + Ok(None) => break, + Err(err) => { + yield_!(BufferItem(Err(err))); + break; } } - }) - }}; - } + } + }) + }); - let iterators = buffers.into_iter().map(|buffer| make_record_iter!(buffer)); // Buffer used to reorder array data in case the trace does not have native // endianness. let mut visitor_scratch = ScratchAlloc::new(); diff --git a/tools/trace-parser/traceevent/src/cinterp.rs b/tools/trace-parser/traceevent/src/cinterp.rs index 6d8d09f26..abbd96ccb 100644 --- a/tools/trace-parser/traceevent/src/cinterp.rs +++ b/tools/trace-parser/traceevent/src/cinterp.rs @@ -304,7 +304,7 @@ impl<'a> SockAddr<'a> { } } -impl<'a> fmt::Display for SockAddr<'a> { +impl fmt::Display for SockAddr<'_> { #[inline] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { // Format of the structs described at: @@ -345,7 +345,7 @@ impl<'a> Bitmap<'a> { } } -impl<'a> fmt::Display for Bitmap<'a> { +impl fmt::Display for Bitmap<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { let mut range_start = None; let mut prev = None; @@ -491,7 +491,7 @@ impl<'a> BitmapIterator<'a> { } } -impl<'a> Iterator for BitmapIterator<'a> { +impl Iterator for BitmapIterator<'_> { type Item = usize; fn next(&mut self) -> Option { @@ -793,7 +793,7 @@ impl<'a> Value<'a> { } } -impl<'a> fmt::Display for Value<'a> { +impl fmt::Display for Value<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { macro_rules! display { ($x:expr) => {{ @@ -883,7 +883,7 @@ impl<'ee, 'eeref> EvalEnv<'eeref> for &'eeref (dyn CompileEnv<'ee> + 'ee) { } } -impl<'ce, 'ceref> ParseEnv for &'ceref (dyn ParseEnv + 'ce) { +impl ParseEnv for &(dyn ParseEnv + '_) { fn field_typ(&self, id: &str) -> Result { (*self).field_typ(id) } @@ -892,7 +892,7 @@ impl<'ce, 'ceref> ParseEnv for &'ceref (dyn ParseEnv + 'ce) { } } -impl<'ce, 'ceref> ParseEnv for &'ceref (dyn CompileEnv<'ce> + 'ce) { +impl<'ce> ParseEnv for &(dyn CompileEnv<'ce> + 'ce) { fn field_typ(&self, id: &str) -> Result { (*self).field_typ(id) } @@ -942,7 +942,7 @@ where } } -impl<'pe, PE> ParseEnv for BasicEnv<'pe, PE> +impl ParseEnv for BasicEnv<'_, PE> where PE: ParseEnv + ?Sized + Send + Sync, { @@ -1014,7 +1014,7 @@ pub(crate) struct ArithInfo<'a> { unsigned: Type, } -impl<'a> ArithInfo<'a> { +impl ArithInfo<'_> { #[inline] pub fn is_signed(&self) -> bool { self.typ == &self.signed diff --git a/tools/trace-parser/traceevent/src/cparser.rs b/tools/trace-parser/traceevent/src/cparser.rs index df2f85e96..828f21dd7 100644 --- a/tools/trace-parser/traceevent/src/cparser.rs +++ b/tools/trace-parser/traceevent/src/cparser.rs @@ -35,7 +35,7 @@ use nom::{ error::{context, FromExternalError}, multi::{fold_many1, many0, many0_count, many1, many_m_n, separated_list0, separated_list1}, number::complete::u8, - sequence::{delimited, pair, preceded, separated_pair, terminated, tuple}, + sequence::{delimited, pair, preceded, separated_pair, terminated}, AsBytes, Finish as _, Parser, }; use smartstring::alias::String; @@ -516,12 +516,12 @@ convert_err_impl!(InterpError, InterpError, CParseError); convert_err_impl!(EvalError, InterpError, CParseError); convert_err_impl!(CompileError, InterpError, CParseError); -impl FromParseError> for CParseError +impl FromParseError> for CParseError where I: AsRef<[u8]>, I2: AsRef<[u8]>, { - fn from_parse_error(input: I, err: &nom::error::VerboseError) -> Self { + fn from_parse_error(input: I, err: &nom_language::error::VerboseError) -> Self { CParseError::ParseError(VerboseParseError::new(input, err)) } } @@ -553,13 +553,13 @@ fn print_array_hex(separator: &'static str) -> Result| { let cval = val.clone().compile(&cenv)?; @@ -631,7 +631,7 @@ fn print_symbolic() -> Result() -> Result Result Result Result Result| { let cval = val.clone().compile(&cenv)?; @@ -1264,7 +1264,7 @@ fn resolve_extension_macro(name: &str) -> Result Result(i: I) -> bool where I: nom::AsBytes, { - all_consuming(recognize(identifier::<_, ()>()))(i.as_bytes()) + all_consuming(recognize(identifier::<_, ()>())) + .parse(i.as_bytes()) .finish() .is_ok() } @@ -1555,18 +1556,9 @@ where /// C identifier parser. // https://port70.net/~nsz/c/c11/n1570.html#6.4.2.1 #[inline] -pub fn identifier() -> impl nom::Parser +pub fn identifier() -> impl nom::Parser where - I: nom::AsBytes - + Clone - + nom::InputTake - + nom::Offset - + nom::Slice> - + nom::InputLength - + nom::InputIter - + nom::InputTakeAtPosition - + for<'a> nom::Compare<&'a str>, - ::Item: Clone + nom::AsChar, + I: nom::AsBytes + Clone + nom::Input + nom::Offset + for<'a> nom::Compare<&'a str>, E: FromExternalError + nom::error::ParseError, { map_res_cut( @@ -1586,20 +1578,15 @@ where } /// Parser of the given C keyword. -fn keyword<'a, I, E>(name: &'a str) -> impl nom::Parser + 'a +fn keyword<'a, I, E>(name: &'a str) -> impl nom::Parser + 'a where E: nom::error::ParseError + 'a, I: nom::AsBytes + Clone - + nom::InputTake + + nom::Input + nom::Offset - + nom::Slice> - + nom::InputLength - + nom::InputIter - + nom::InputTakeAtPosition + for<'b> nom::Compare<&'b str> + 'a, - ::Item: Clone + nom::AsChar, E: FromExternalError + nom::error::ParseError, { let mut inner = all_consuming(lexeme(tag(name))); @@ -1611,15 +1598,9 @@ where } } -fn escape_sequence() -> impl nom::Parser +fn escape_sequence() -> impl nom::Parser where - I: Clone - + AsBytes - + nom::InputTake - + nom::InputLength - + nom::InputIter - + nom::InputTakeAtPosition - + nom::Slice>, + I: Clone + AsBytes + nom::Input, E: FromExternalError + nom::error::ParseError + nom::error::ContextError, { context( @@ -1684,20 +1665,13 @@ where ) } -pub fn string_literal() -> impl nom::Parser +pub fn string_literal() -> impl nom::Parser where - I: Clone - + AsBytes - + nom::InputTake - + nom::Slice> - + nom::InputLength - + nom::InputIter - + nom::InputTakeAtPosition - + for<'a> nom::Compare<&'a str>, + I: Clone + AsBytes + nom::Input + for<'a> nom::Compare<&'a str>, E: FromExternalError + nom::error::ContextError + nom::error::ParseError, { many1(map_res_cut( - tuple(( + ( context( "string encoding prefix", lexeme(opt(alt((tag("u8"), tag("u"), tag("U"), tag("L"))))), @@ -1744,7 +1718,7 @@ where )), char('"'), )), - )), + ), |(prefix, string)| match prefix { Some(_) => Err(CParseError::UnsupportedConstruct( "string encoding prefix syntax is not supported".into(), @@ -1897,7 +1871,7 @@ grammar! { let array = context( "array", - tuple(( + ( Self::grammar_ctx(), Self::direct_declarator(abstract_declarator), context( @@ -1917,7 +1891,7 @@ grammar! { char(']'), )), ), - )), + ), ).map( |(ctx, declarator, array_size)| { let array_size = match array_size { @@ -2013,7 +1987,7 @@ grammar! { Ok((input, res)) } ),* - _ => fail(input) + _ => fail().parse(input) } } } @@ -2250,7 +2224,7 @@ grammar! { // backtracking back to the ISO C declaration, as we know it will // never yield something sensible. map_res_cut( - tuple(( + ( alt(( keyword("__data_loc"), keyword("__rel_loc"), @@ -2264,7 +2238,7 @@ grammar! { "__data_loc identifier", lexeme(Self::identifier()), )), - )), + ), |(kind, typ, abstract_declarator, identifier)| { // Push the array sizes down the stack. The 2nd nested array takes the size of the 1st etc. fn push_array_size( @@ -2497,14 +2471,14 @@ grammar! { ).map(|expr| Expr::PostDec(Box::new(expr))) ), context("subscript expr", - tuple(( + ( Self::postfix_expr(), delimited( lexeme(char('[')), cut(Self::expr()), lexeme(char(']')), ), - )).map(|(array, index)| Expr::Subscript(Box::new(array), Box::new(index))) + ).map(|(array, index)| Expr::Subscript(Box::new(array), Box::new(index))) ), context("func call expr", move |input| { @@ -2572,7 +2546,7 @@ grammar! { ), context("compound literal", - tuple(( + ( parenthesized( Self::type_name(), ), @@ -2584,7 +2558,7 @@ grammar! { lexeme(char('}')), ) ), - )).map(|(typ, init)| Expr::CompoundLiteral(typ, init)) + ).map(|(typ, init)| Expr::CompoundLiteral(typ, init)) ), Self::primary_expr(), )) @@ -2867,14 +2841,14 @@ grammar! { alt(( Self::statement_expr(), context("assignment", - tuple(( + ( Self::unary_expr(), lexeme(alt(( - tuple(( + ( tag("="), Self::assignment_expr(), - )), - tuple(( + ), + ( alt(( tag("*="), tag("/="), @@ -2888,9 +2862,9 @@ grammar! { tag("|="), )), cut(Self::assignment_expr()), - )) + ) ))) - )).map(|(lexpr, (op, rexpr))| { + ).map(|(lexpr, (op, rexpr))| { use Expr::*; match &op.fragment()[..] { b"=" => Assign(Box::new(lexpr), Box::new(rexpr)), @@ -2944,7 +2918,7 @@ grammar! { ).map(|e| Expr::SizeofExpr(Box::new(e))) ), context("unary op expr", - tuple(( + ( lexeme( // https://port70.net/~nsz/c/c11/n1570.html#6.5.3p1 alt(( @@ -2957,7 +2931,7 @@ grammar! { )) ), Self::cast_expr(), - )).map(|(modify, e)| modify(e)) + ).map(|(modify, e)| modify(e)) ), Self::postfix_expr(), )) @@ -2967,10 +2941,10 @@ grammar! { // https://port70.net/~nsz/c/c11/n1570.html#6.7.7p1 rule type_name() -> Type { lexeme( - tuple(( + ( Self::declaration_specifier(), Self::declarator(true), - )).map(|(typ, abstract_declarator)| + ).map(|(typ, abstract_declarator)| (abstract_declarator.modify_typ)(typ) ) ) @@ -2981,12 +2955,12 @@ grammar! { lexeme( alt(( context("cast expr", - tuple(( + ( parenthesized( Self::type_name(), ), Self::cast_expr(), - )).map(|(typ, e)| Expr::Cast(typ, Box::new(e))) + ).map(|(typ, e)| Expr::Cast(typ, Box::new(e))) ), Self::unary_expr(), )) @@ -3003,7 +2977,7 @@ grammar! { lexeme( context("character constant", map_res_cut( - tuple(( + ( context( "char encoding prefix", opt(alt((keyword("u8"), keyword("u"), keyword("U"), keyword("L")))), @@ -3016,7 +2990,7 @@ grammar! { ))), char('\''), ) - )), + ), |(prefix, c)| match prefix { Some(_) => Err(CParseError::UnsupportedConstruct("string encoding prefix syntax is not supported".into())), None => Ok(Expr::CharConstant(Type::I32, c.into())), @@ -3099,11 +3073,11 @@ grammar! { lexeme( map_res_cut( - tuple(( + ( Self::grammar_ctx(), value(), suffix(), - )), + ), move |(ctx, (kind, x), suffix)| { let abi = &ctx.abi(); let long_size = abi.long_size; diff --git a/tools/trace-parser/traceevent/src/grammar.rs b/tools/trace-parser/traceevent/src/grammar.rs index 6bd696d59..a595532c6 100644 --- a/tools/trace-parser/traceevent/src/grammar.rs +++ b/tools/trace-parser/traceevent/src/grammar.rs @@ -100,8 +100,13 @@ pub trait PackratGrammar { ctx: &'i Self::Ctx<'i>, ) -> Result<(&'i [u8], O), E> where - E: FromParseError<&'i [u8], nom::error::VerboseError<&'i [u8]>>, - P: 'p + Parser, O, NomError>>>, + E: FromParseError<&'i [u8], nom_language::error::VerboseError<&'i [u8]>>, + P: 'p + + Parser< + Span<'i, Self>, + Output = O, + Error = NomError>>, + >, ::State<'i>: Default + Clone, Self: Sized, for<'a> Self::Ctx<'a>: 'a, @@ -111,7 +116,7 @@ pub trait PackratGrammar { Ok((remaining, x)) => Ok((*remaining.fragment(), x)), Err(err) => match err.data { None => { - let inner = nom::error::VerboseError { + let inner = nom_language::error::VerboseError { errors: err .inner .errors @@ -204,7 +209,7 @@ macro_rules! grammar { impl $grammar_name { $( - $vis fn $name<'i, 'ret, $($($generics $(: $bound)?,)*)? E>($($param: $param_ty),*) -> impl ::nom::Parser, $ret, E> + 'ret + $vis fn $name<'i, 'ret, $($($generics $(: $bound)?,)*)? E>($($param: $param_ty),*) -> impl ::nom::Parser, Output=$ret, Error=E> + 'ret where E: 'ret + ::nom::error::ParseError> @@ -290,11 +295,11 @@ macro_rules! grammar { let pos = data.pos; drop(packrat); let (input, _) = ::nom::bytes::complete::take(pos - input.location_offset()).parse(input)?; - context(concat!(stringify!($name), " (pre-parsed)"), success(val))(input) + context(concat!(stringify!($name), " (pre-parsed)"), success(val)).parse(input) } PackratAction::Fail => { drop(packrat); - context(concat!(stringify!($name), " (seed recursion block)"), fail)(input) + context(concat!(stringify!($name), " (seed recursion block)"), ::nom::combinator::fail()).parse(input) } } } @@ -342,7 +347,7 @@ pub(crate) mod tests { branch::alt, bytes::complete::tag, character::complete::alpha1, - combinator::{fail, recognize, success}, + combinator::{recognize, success}, multi::many1, sequence::separated_pair, }; @@ -589,7 +594,7 @@ pub(crate) mod tests { use nom::{ branch::alt, character::complete::char, - combinator::{fail, success}, + combinator::success, sequence::{delimited, separated_pair}, }; diff --git a/tools/trace-parser/traceevent/src/header.rs b/tools/trace-parser/traceevent/src/header.rs index 45861403e..e99010d2b 100644 --- a/tools/trace-parser/traceevent/src/header.rs +++ b/tools/trace-parser/traceevent/src/header.rs @@ -47,7 +47,7 @@ use nom::{ combinator::{all_consuming, flat_map, iterator, map_res, opt, rest}, error::context, multi::{fold_many0, many0, separated_list0}, - sequence::{delimited, pair, preceded, separated_pair, terminated, tuple}, + sequence::{delimited, pair, preceded, separated_pair, terminated}, Finish as _, Parser, }; use once_cell::sync::OnceCell; @@ -564,9 +564,9 @@ impl Header { for opt in self.options() { if let Options::TraceClock(clock) = opt { - return match nom::Parser::<_, _, ()>::parse(&mut parser, clock.deref()).finish() { + return match nom::Parser::<_>::parse(&mut parser, clock.deref()).finish() { Ok((_, clock)) => Some(clock), - _ => None, + Err(()) => None, }; } } @@ -718,7 +718,7 @@ fn fixup_c_type( Ok(fixup(typ, Some(size), signedness)) } -type HeaderNomError<'a> = NomError>; +type HeaderNomError<'a> = NomError>; /// Parse the struct format of an ftrace event as reported in /// `/sys/kernel/tracing/events/*/*/format` @@ -733,7 +733,7 @@ fn parse_struct_fmt<'a, PE: ParseEnv>( char('\n'), map_res_cut( preceded( - lexeme(tag(b"field:")), + lexeme(tag(&b"field:"[..])), separated_pair( is_not(";"), char(';'), @@ -869,12 +869,12 @@ fn parse_header_event(input: &[u8]) -> nom::IResult<&[u8], (), HeaderNomError<'_ _ => Ok(()), }), preceded( - tuple(( + ( lexeme(tag("data")), lexeme(tag("max")), lexeme(tag("type_len")), lexeme(tag("==")), - )), + ), lexeme(txt_u64).map(|bits| match bits { 28 => Ok(()), x => Err(HeaderError::InvalidEventHeader { @@ -1071,7 +1071,7 @@ impl<'h> HeaderEnv<'h> { } } -impl<'ce> ParseEnv for HeaderEnv<'ce> { +impl ParseEnv for HeaderEnv<'_> { #[inline] fn field_typ(&self, id: &str) -> Result { for field in &self.struct_fmt.fields { @@ -1389,7 +1389,7 @@ fn parse_event_desc(input: &[u8]) -> nom::IResult<&[u8], EventDesc, HeaderNomErr context( "event description", map_res_cut( - tuple(( + ( context( "event name", preceded( @@ -1399,7 +1399,7 @@ fn parse_event_desc(input: &[u8]) -> nom::IResult<&[u8], EventDesc, HeaderNomErr ), context("event ID", preceded(lexeme(tag("ID:")), lexeme(txt_u16))), context("remainder", rest), - )), + ), |(name, id, fmt)| { Ok(EventDesc { name: StdString::from_utf8_lossy(name).into(), @@ -1462,6 +1462,7 @@ fn parse_kallsyms( let mut it = iterator(input, line); let parsed = it + .by_ref() .filter_map(|item| match item { (addr, Some(name)) => Some(Ok((addr, name))), _ => None, @@ -1504,7 +1505,7 @@ fn parse_str_table( }, ); let mut it = iterator(input, line); - let parsed = it.collect::>(); + let parsed = it.by_ref().collect::>(); let (input, _) = it.finish()?; Ok((input, parsed)) }) @@ -1524,7 +1525,7 @@ fn parse_pid_comms(input: &[u8]) -> nom::IResult<&[u8], BTreeMap, H }), ); let mut it = iterator(input, line); - let parsed = it.collect::>(); + let parsed = it.by_ref().collect::>(); let (input, _) = it.finish()?; Ok((input, parsed)) }) @@ -1644,10 +1645,10 @@ impl From for HeaderError { } } -impl, I2: AsRef<[u8]>> FromParseError> +impl, I2: AsRef<[u8]>> FromParseError> for HeaderError { - fn from_parse_error(input: I, err: &nom::error::VerboseError) -> Self { + fn from_parse_error(input: I, err: &nom_language::error::VerboseError) -> Self { HeaderError::ParseError(Box::new(VerboseParseError::new(input, err))) } } diff --git a/tools/trace-parser/traceevent/src/io.rs b/tools/trace-parser/traceevent/src/io.rs index 5cc9de71e..e20d1210f 100644 --- a/tools/trace-parser/traceevent/src/io.rs +++ b/tools/trace-parser/traceevent/src/io.rs @@ -114,9 +114,12 @@ pub trait BorrowingRead: BorrowingReadCore { // function and our caller gets to choose the lifetime, not us. P: for<'b> Fn( &'b [u8], - ) - -> IResult<&'b [u8], O, NomError>>, - E: for<'b> FromParseError<&'b [u8], nom::error::VerboseError<&'b [u8]>> + Debug, + ) -> IResult< + &'b [u8], + O, + NomError>, + >, + E: for<'b> FromParseError<&'b [u8], nom_language::error::VerboseError<&'b [u8]>> + Debug, { let buf = self.read(count)?; Ok(parser.parse_finish(buf)) @@ -181,8 +184,8 @@ impl BorrowingRead for T {} // P: for<'b> Fn( // &'b [u8], // ) -// -> IResult<&'b [u8], O, NomError>>, -// E: for<'b> FromParseError<&'b [u8], nom::error::VerboseError<&'b [u8]>> + Debug, +// -> IResult<&'b [u8], O, NomError>>, +// E: for<'b> FromParseError<&'b [u8], nom_language::error::VerboseError<&'b [u8]>> + Debug, // { // (*self).parse(count, parser) // } @@ -933,7 +936,7 @@ where if self.offset > self.last_offset { let rewind = file2mem(self.offset - self.last_offset); - count = if rewind > count { 0 } else { count - rewind }; + count = count.saturating_sub(rewind); self.offset = self.last_offset; } Ok(count) diff --git a/tools/trace-parser/traceevent/src/parser.rs b/tools/trace-parser/traceevent/src/parser.rs index 4a236eb30..2401466b6 100644 --- a/tools/trace-parser/traceevent/src/parser.rs +++ b/tools/trace-parser/traceevent/src/parser.rs @@ -39,12 +39,12 @@ impl FromParseError for () { fn from_parse_error(_input: I, _err: &E) -> Self {} } -/// Parse error including a backtrace of nested [nom::error::VerboseErrorKind] along with their +/// Parse error including a backtrace of nested [nom_language::error::VerboseErrorKind] along with their /// source location. #[derive(Clone, PartialEq)] pub struct VerboseParseError { input: String, - errors: Vec<(Range, nom::error::VerboseErrorKind)>, + errors: Vec<(Range, nom_language::error::VerboseErrorKind)>, } impl VerboseParseError { @@ -58,7 +58,7 @@ impl VerboseParseError { } pub fn new, I2: AsRef<[u8]>>( input: I, - err: &nom::error::VerboseError, + err: &nom_language::error::VerboseError, ) -> Self { match core::str::from_utf8(input.as_ref()) { Err(err) => VerboseParseError { @@ -130,7 +130,7 @@ impl Display for VerboseParseError { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), core::fmt::Error> { let input = self.input.as_str(); let mut seen_context = false; - let inner = nom::error::VerboseError { + let inner = nom_language::error::VerboseError { errors: self .errors .iter() @@ -140,7 +140,7 @@ impl Display for VerboseParseError { // This makes the path much easier to follow if all // relevant levels are annotated correctly. .filter(|(_, kind)| match kind { - nom::error::VerboseErrorKind::Context(..) => { + nom_language::error::VerboseErrorKind::Context(..) => { seen_context = true; true } @@ -153,7 +153,7 @@ impl Display for VerboseParseError { f, "Error while parsing:\n{}\n{}\n", input, - &nom::error::convert_error(input, inner) + &nom_language::error::convert_error(input, inner) )?; Ok(()) } @@ -273,7 +273,7 @@ pub fn hex_u64(input: I) -> nom::IResult where E: ParseError, I: Clone, - I: nom::AsBytes + nom::InputIter + nom::InputTakeAtPosition, + I: nom::AsBytes + nom::Input, { is_a(&b"0123456789abcdefABCDEF"[..]) .map(|x: I| { @@ -296,14 +296,14 @@ where ////////////////////// /// Extend [nom::Parser] with some methods. -pub trait NomParserExt: nom::Parser> { +pub trait NomParserExt: nom::Parser> { /// Parse the input and return a simple [Result] /// /// The parser is expected to consume all input, otherwise an error will be returned. #[inline] fn parse_finish(&mut self, input: I) -> Result where - I: nom::InputLength + Clone + Debug, + I: nom::Input + Clone + Debug, NE: Debug + ParseError, E: Debug + FromParseError, { @@ -318,15 +318,21 @@ pub trait NomParserExt: nom::Parser> { } } -impl NomParserExt for P where P: nom::Parser> {} +impl NomParserExt for P where + P: nom::Parser> +{ +} /// Help debugging the `inner` [nom::Parser] by printing `name`, the input, the output and the /// remaining input every time the parser is called. #[allow(unused)] -pub fn print(name: &'static str, mut inner: P) -> impl nom::Parser +pub fn print( + name: &'static str, + mut inner: P, +) -> impl nom::Parser where E: ParseError, - P: nom::Parser, + P: nom::Parser, I: core::convert::AsRef<[u8]> + Clone, O: Debug, { @@ -342,30 +348,23 @@ where } /// Wraps a [nom::Parser] to parse optional whitespaces before and after. -pub fn lexeme(inner: P) -> impl nom::Parser +pub fn lexeme(inner: P) -> impl nom::Parser where E: ParseError, - P: nom::Parser, - I: Clone + nom::InputLength + nom::InputIter + nom::InputTake + nom::InputTakeAtPosition, - ::Item: Clone + nom::AsChar, - ::Item: Clone + nom::AsChar, + P: nom::Parser, + I: Clone + nom::Input, + ::Item: Clone + nom::AsChar, { delimited(multispace0, inner, multispace0) } /// Wraps a [nom::Parser] to parse parenthesis around it. -pub fn parenthesized(parser: P) -> impl nom::Parser +pub fn parenthesized(parser: P) -> impl nom::Parser where - P: nom::Parser, + P: nom::Parser, E: ParseError, - I: nom::Slice> - + nom::InputIter - + Clone - + nom::InputLength - + nom::InputTake - + nom::InputTakeAtPosition, - ::Item: Clone + nom::AsChar, - ::Item: Clone + nom::AsChar, + I: nom::Input + Clone, + ::Item: Clone + nom::AsChar, { delimited(lexeme(char('(')), parser, lexeme(char(')'))) } @@ -378,10 +377,11 @@ where pub fn map_res_cut, E2, F, G>( mut parser: F, mut f: G, -) -> impl nom::Parser +) -> impl nom::Parser where - F: Parser, + F: Parser, G: FnMut(O1) -> Result, + E: ParseError, { move |input: I| { let i = input.clone(); @@ -472,7 +472,8 @@ where #[cfg(test)] pub(crate) mod tests { - use nom::{error::VerboseError, Finish as _}; + use nom::Finish as _; + use nom_language::error::{convert_error, VerboseError}; use super::*; @@ -502,11 +503,9 @@ pub(crate) mod tests { // Work-around this issue: // https://github.com/rust-bakery/nom/issues/1619 - // This function _must_ preserve the address of buf, as - // nom::error::convert_error() relies on VerboseError input stack to be - // pointer into the overall input. Otherwise, pointer arithmetic will - // make no sense and it will either display non-sensical substrings or - // panic. + // This function _must_ preserve the address of buf, as nom_language::error::convert_error() + // relies on VerboseError input stack to be pointer into the overall input. Otherwise, pointer + // arithmetic will make no sense and it will either display non-sensical substrings or panic. pub fn zero_copy_to_str(buf: &[u8]) -> &str { std::str::from_utf8(buf).unwrap() } @@ -514,9 +513,9 @@ pub(crate) mod tests { pub fn run_parser(input: I, parser: P) -> O where O: Debug + PartialEq, - P: Parser>>, - I: nom::AsBytes + nom::InputLength + Clone, - T: DisplayErr + FromParseError>, + P: Parser>>, + I: nom::AsBytes + nom::Input + Clone, + T: DisplayErr + FromParseError>, { let mut parser = all_consuming(parser); let parsed = parser.parse(input.clone()).finish(); @@ -538,7 +537,7 @@ pub(crate) mod tests { // This makes the path much easier to follow if all // relevant levels are annotated correctly. .filter(|(_, kind)| match kind { - nom::error::VerboseErrorKind::Context(..) => { + nom_language::error::VerboseErrorKind::Context(..) => { seen_context = true; true } @@ -547,7 +546,7 @@ pub(crate) mod tests { .map(|(s, err)| (zero_copy_to_str(s.as_bytes()), err.clone())) .collect(), }; - let loc = nom::error::convert_error(input, inner); + let loc = convert_error(input, inner); let err_data = match err.data { Some(data) => data.display_err(), None => "".into(), @@ -560,9 +559,9 @@ pub(crate) mod tests { pub fn test_parser(expected: O, input: I, parser: P) where O: Debug + PartialEq, - T: DisplayErr + FromParseError>, - P: Parser>>, - I: nom::AsBytes + nom::InputLength + Clone, + T: DisplayErr + FromParseError>, + P: Parser>>, + I: nom::AsBytes + nom::Input + Clone, { let parsed = run_parser(input.clone(), parser); diff --git a/tools/trace-parser/traceevent/src/print.rs b/tools/trace-parser/traceevent/src/print.rs index 2d1eaffad..ae661a7a1 100644 --- a/tools/trace-parser/traceevent/src/print.rs +++ b/tools/trace-parser/traceevent/src/print.rs @@ -33,7 +33,7 @@ use nom::{ combinator::{cut, opt, success}, error::{context, ContextError, FromExternalError, ParseError}, multi::{many0, many1}, - sequence::{preceded, separated_pair, tuple}, + sequence::{preceded, separated_pair}, Parser, }; use once_cell::sync::OnceCell; @@ -222,9 +222,9 @@ impl PrintFmtStr { /// Parse a printk-style format string. #[inline] pub fn try_new(header: &Header, fmt: &[u8]) -> Result { - print_fmt_parser::>>( - header.kernel_abi(), - ) + print_fmt_parser::< + crate::parser::NomError>, + >(header.kernel_abi()) .parse_finish(fmt) } @@ -945,10 +945,10 @@ impl From for PrintFmtError { } } -impl, I2: AsRef<[u8]>> FromParseError> +impl, I2: AsRef<[u8]>> FromParseError> for PrintFmtError { - fn from_parse_error(input: I, err: &nom::error::VerboseError) -> Self { + fn from_parse_error(input: I, err: &nom_language::error::VerboseError) -> Self { PrintFmtError::CParseError(Box::new(CParseError::ParseError(VerboseParseError::new( input, err, )))) @@ -968,7 +968,11 @@ impl> FromParseError for PrintFmtError { // 25s, also leading to an absolute disaster in release profile) fn specifier<'a, 'abi, E>( abi: &'abi Abi, -) -> impl nom::Parser<&'a [u8], Result<(VBinSpecifier, PrintSpecifier), PrintFmtError>, E> + 'abi +) -> impl nom::Parser< + &'a [u8], + Output = Result<(VBinSpecifier, PrintSpecifier), PrintFmtError>, + Error = E, +> + 'abi where E: 'abi + ParseError<&'a [u8]> @@ -1163,11 +1167,11 @@ where )), preceded(char('U'), alt((char('b'), char('B'), char('l'), char('L')))) .map(|_| Ok((VBinSpecifier::Str, PrintSpecifier::Uuid))), - tuple(( + ( alt((char('d'), char('D'))), opt(alt((char('2'), char('3'), char('4')))), - )) - .map(|_| Ok((VBinSpecifier::Str, PrintSpecifier::Dentry))), + ) + .map(|_| Ok((VBinSpecifier::Str, PrintSpecifier::Dentry))), alt(( char('g') .map(|_| Ok((VBinSpecifier::Str, PrintSpecifier::BlockDevice))), @@ -1224,7 +1228,7 @@ where // Plus some specifiers that are undocumented fn print_fmt_parser<'a, 'abi, E>( abi: &'abi Abi, -) -> impl nom::Parser<&'a [u8], PrintFmtStr, E> + 'abi +) -> impl nom::Parser<&'a [u8], Output = PrintFmtStr, Error = E> + 'abi where E: 'abi + ParseError<&'a [u8]> @@ -1263,7 +1267,7 @@ where let (vbin_spec, print_spec) = spec?; Ok((vbin_spec, print_spec, PrintPrecision::Dynamic)) }), - map_res_cut(tuple((opt(txt_u64), specifier(abi))), |(width, spec)| { + map_res_cut((opt(txt_u64), specifier(abi)), |(width, spec)| { let (vbin_spec, print_spec) = spec?; // No value after the dot is same as an explicit 0 let width = width.unwrap_or(0); @@ -1292,7 +1296,7 @@ where }, ), map_res_cut( - tuple((txt_u64, precision())), + (txt_u64, precision()), |(width, (vbin_spec, print_spec, precision))| { Ok(( vbin_spec, @@ -1320,7 +1324,7 @@ where "specifier", alt(( char('%').map(|_| PrintAtom::Fixed("%".into())), - tuple((many1(flags()), width())).map( + (many1(flags()), width()).map( |(flags, (vbin_spec, print_spec, precision, width))| { let flags = PrintFlags::from_iter(flags); PrintAtom::new_variable( diff --git a/tools/trace-parser/traceevent/src/scratch.rs b/tools/trace-parser/traceevent/src/scratch.rs index a72fb8d58..28119def0 100644 --- a/tools/trace-parser/traceevent/src/scratch.rs +++ b/tools/trace-parser/traceevent/src/scratch.rs @@ -324,7 +324,7 @@ impl<'a, T: ?Sized, A> OwnedScratchBox<'a, T, A> { // SAFETY: If the allocator and the value are Send, then the boxed value is also // Send. -unsafe impl<'a, T: Send + ?Sized, A> Send for OwnedScratchBox<'a, T, A> +unsafe impl Send for OwnedScratchBox<'_, T, A> where T: Send, A: Send, @@ -333,14 +333,14 @@ where // SAFETY: If the allocator and the value are Sync, then the boxed value is also // Sync. -unsafe impl<'a, T, A> Sync for OwnedScratchBox<'a, T, A> +unsafe impl Sync for OwnedScratchBox<'_, T, A> where T: Sync + ?Sized, A: Sync, { } -impl<'a, T: ?Sized, A> Drop for OwnedScratchBox<'a, T, A> { +impl Drop for OwnedScratchBox<'_, T, A> { #[inline] fn drop(&mut self) { // SAFETY: We own the pointer, it is not aliased anywhere. Also, it was @@ -352,7 +352,7 @@ impl<'a, T: ?Sized, A> Drop for OwnedScratchBox<'a, T, A> { } } -impl<'a, T: ?Sized, A> Deref for OwnedScratchBox<'a, T, A> { +impl Deref for OwnedScratchBox<'_, T, A> { type Target = T; #[inline] @@ -362,7 +362,7 @@ impl<'a, T: ?Sized, A> Deref for OwnedScratchBox<'a, T, A> { } } -impl<'a, T: ?Sized, A> DerefMut for OwnedScratchBox<'a, T, A> { +impl DerefMut for OwnedScratchBox<'_, T, A> { #[inline] fn deref_mut(&mut self) -> &mut Self::Target { // SAFETY: the pointer is not aliased anywhere @@ -370,14 +370,14 @@ impl<'a, T: ?Sized, A> DerefMut for OwnedScratchBox<'a, T, A> { } } -impl<'a, T: ?Sized, A> AsRef for OwnedScratchBox<'a, T, A> { +impl AsRef for OwnedScratchBox<'_, T, A> { #[inline] fn as_ref(&self) -> &T { self.deref() } } -impl<'a, T: ?Sized, A> AsMut for OwnedScratchBox<'a, T, A> { +impl AsMut for OwnedScratchBox<'_, T, A> { #[inline] fn as_mut(&mut self) -> &mut T { self.deref_mut() @@ -399,20 +399,20 @@ where } } -impl<'a, T: Debug + ?Sized, A> Debug for OwnedScratchBox<'a, T, A> { +impl Debug for OwnedScratchBox<'_, T, A> { #[inline] fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), core::fmt::Error> { self.deref().fmt(f) } } -impl<'a, T: PartialEq + ?Sized, A> PartialEq for OwnedScratchBox<'a, T, A> { +impl PartialEq for OwnedScratchBox<'_, T, A> { #[inline] fn eq(&self, other: &Self) -> bool { self.deref() == other.deref() } } -impl<'a, T: Eq + ?Sized, A> Eq for OwnedScratchBox<'a, T, A> {} +impl Eq for OwnedScratchBox<'_, T, A> {} /// [ScratchVec] is to [Vec] what [ScratchBox] is to [Box] pub struct ScratchVec<'a, T: 'a>(BumpaloVec<'a, T>); @@ -467,7 +467,7 @@ impl<'a, T> ScratchVec<'a, T> { } } -impl<'a, T> ScratchVec<'a, T> +impl ScratchVec<'_, T> where T: Clone, { @@ -477,7 +477,7 @@ where } } -impl<'a, T> ScratchVec<'a, T> +impl ScratchVec<'_, T> where T: Copy, { @@ -496,7 +496,7 @@ where } } -impl<'a, T> Deref for ScratchVec<'a, T> { +impl Deref for ScratchVec<'_, T> { type Target = [T]; #[inline] @@ -505,42 +505,42 @@ impl<'a, T> Deref for ScratchVec<'a, T> { } } -impl<'a, T> DerefMut for ScratchVec<'a, T> { +impl DerefMut for ScratchVec<'_, T> { #[inline] fn deref_mut(&mut self) -> &mut Self::Target { self.0.deref_mut() } } -impl<'a, T> AsRef<[T]> for ScratchVec<'a, T> { +impl AsRef<[T]> for ScratchVec<'_, T> { #[inline] fn as_ref(&self) -> &[T] { self.deref() } } -impl<'a, T> AsMut<[T]> for ScratchVec<'a, T> { +impl AsMut<[T]> for ScratchVec<'_, T> { #[inline] fn as_mut(&mut self) -> &mut [T] { self.deref_mut() } } -impl<'a, T: Clone> Clone for ScratchVec<'a, T> { +impl Clone for ScratchVec<'_, T> { #[inline] fn clone(&self) -> Self { ScratchVec(self.0.clone()) } } -impl<'a, T: Debug> Debug for ScratchVec<'a, T> { +impl Debug for ScratchVec<'_, T> { #[inline] fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), core::fmt::Error> { self.0.fmt(f) } } -impl<'a> io::Write for ScratchVec<'a, u8> { +impl io::Write for ScratchVec<'_, u8> { #[inline] fn write(&mut self, buf: &[u8]) -> io::Result { self.0.extend_from_slice(buf); @@ -565,7 +565,7 @@ impl<'a, T> IntoIterator for ScratchVec<'a, T> { pub struct IntoIterVec<'a, T>( as IntoIterator>::IntoIter); -impl<'a, T> Iterator for IntoIterVec<'a, T> { +impl Iterator for IntoIterVec<'_, T> { type Item = T; #[inline] @@ -584,7 +584,7 @@ impl<'a, T> Iterator for IntoIterVec<'a, T> { } } -impl<'a, A> Extend for ScratchVec<'a, A> { +impl Extend for ScratchVec<'_, A> { #[inline] fn extend(&mut self, iter: T) where diff --git a/tools/trace-parser/traceevent/src/str.rs b/tools/trace-parser/traceevent/src/str.rs index 5d6586d9d..3d3c64699 100644 --- a/tools/trace-parser/traceevent/src/str.rs +++ b/tools/trace-parser/traceevent/src/str.rs @@ -56,7 +56,7 @@ pub(crate) enum InnerStr<'a> { Procedural(StrProcedure<'a>), } -impl<'a> Clone for OwnedScratchBox<'a, dyn StringProducer> { +impl Clone for OwnedScratchBox<'_, dyn StringProducer> { #[inline] fn clone(&self) -> Self { self.clone_box(self.alloc) @@ -162,7 +162,7 @@ impl<'a> Str<'a> { } } -impl<'a> Deref for Str<'a> { +impl Deref for Str<'_> { type Target = str; #[inline] @@ -176,7 +176,7 @@ impl<'a> Deref for Str<'a> { } } -impl<'a> DerefMut for Str<'a> { +impl DerefMut for Str<'_> { #[inline] fn deref_mut<'b>(&'b mut self) -> &'b mut Self::Target { macro_rules! own { @@ -211,14 +211,14 @@ impl<'a> DerefMut for Str<'a> { } } -impl<'a> AsRef for Str<'a> { +impl AsRef for Str<'_> { #[inline] fn as_ref(&self) -> &str { self.deref() } } -impl<'a> AsMut for Str<'a> { +impl AsMut for Str<'_> { #[inline] fn as_mut(&mut self) -> &mut str { self.deref_mut() @@ -253,44 +253,44 @@ impl<'a> From<&Str<'a>> for String { } } -impl<'a> PartialEq for Str<'a> { +impl PartialEq for Str<'_> { #[inline] fn eq(&self, other: &Self) -> bool { self.deref() == other.deref() } } -impl<'a> Eq for Str<'a> {} +impl Eq for Str<'_> {} -impl<'a> PartialOrd for Str<'a> { +impl PartialOrd for Str<'_> { #[inline] fn partial_cmp(&self, other: &Self) -> Option { Some(self.cmp(other)) } } -impl<'a> Ord for Str<'a> { +impl Ord for Str<'_> { #[inline] fn cmp(&self, other: &Self) -> Ordering { self.deref().cmp(other.deref()) } } -impl<'a> Hash for Str<'a> { +impl Hash for Str<'_> { #[inline] fn hash(&self, state: &mut H) { Hash::hash(self.deref(), state) } } -impl<'a> Borrow for Str<'a> { +impl Borrow for Str<'_> { #[inline] fn borrow(&self) -> &str { self } } -impl<'a> fmt::Display for Str<'a> { +impl fmt::Display for Str<'_> { #[inline] fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { fmt::Display::fmt(self.deref(), f) -- GitLab