├── .github └── workflows │ └── rust.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── README.md ├── dummy.rs ├── src ├── flags.rs ├── fuzz.rs ├── fuzz2 │ ├── core.rs │ ├── function.rs │ ├── fuzz2.rs │ ├── lifetime.rs │ ├── misc.rs │ ├── mod.rs │ ├── struct.rs │ └── ty.rs ├── fuzz_tree_splicer.rs ├── ice.rs ├── library.rs ├── main.rs ├── printing.rs ├── run_commands.rs └── smolfuzz.rs └── test.rs /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | pull_request: 7 | branches: [master] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | build: 14 | runs-on: ubuntu-latest 15 | 16 | steps: 17 | - uses: actions/checkout@v2 18 | - uses: actions-rs/toolchain@v1 19 | with: 20 | toolchain: nightly 21 | - run: rustup default nightly 22 | - run: cargo check --all-targets 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aho-corasick" 7 | version = "1.1.3" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 10 | dependencies = [ 11 | "memchr", 12 | ] 13 | 14 | [[package]] 15 | name = "android-tzdata" 16 | version = "0.1.1" 17 | source = "registry+https://github.com/rust-lang/crates.io-index" 18 | checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" 19 | 20 | [[package]] 21 | name = "android_system_properties" 22 | version = "0.1.5" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" 25 | dependencies = [ 26 | "libc", 27 | ] 28 | 29 | [[package]] 30 | name = "anstream" 31 | version = "0.6.13" 32 | source = "registry+https://github.com/rust-lang/crates.io-index" 33 | checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" 34 | dependencies = [ 35 | "anstyle", 36 | "anstyle-parse", 37 | "anstyle-query", 38 | "anstyle-wincon", 39 | "colorchoice", 40 | "utf8parse", 41 | ] 42 | 43 | [[package]] 44 | name = "anstyle" 45 | version = "1.0.6" 46 | source = "registry+https://github.com/rust-lang/crates.io-index" 47 | checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" 48 | 49 | [[package]] 50 | name = "anstyle-parse" 51 | version = "0.2.3" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" 54 | dependencies = [ 55 | "utf8parse", 56 | ] 57 | 58 | [[package]] 59 | name = "anstyle-query" 60 | version = "1.0.2" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" 63 | dependencies = [ 64 | "windows-sys 0.52.0", 65 | ] 66 | 67 | [[package]] 68 | name = "anstyle-wincon" 69 | version = "3.0.2" 70 | source = "registry+https://github.com/rust-lang/crates.io-index" 71 | checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" 72 | dependencies = [ 73 | "anstyle", 74 | "windows-sys 0.52.0", 75 | ] 76 | 77 | [[package]] 78 | name = "autocfg" 79 | version = "1.2.0" 80 | source = "registry+https://github.com/rust-lang/crates.io-index" 81 | checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" 82 | 83 | [[package]] 84 | name = "bitflags" 85 | version = "2.5.0" 86 | source = "registry+https://github.com/rust-lang/crates.io-index" 87 | checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" 88 | 89 | [[package]] 90 | name = "block-buffer" 91 | version = "0.10.4" 92 | source = "registry+https://github.com/rust-lang/crates.io-index" 93 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 94 | dependencies = [ 95 | "generic-array", 96 | ] 97 | 98 | [[package]] 99 | name = "bumpalo" 100 | version = "3.16.0" 101 | source = "registry+https://github.com/rust-lang/crates.io-index" 102 | checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" 103 | 104 | [[package]] 105 | name = "cc" 106 | version = "1.0.92" 107 | source = "registry+https://github.com/rust-lang/crates.io-index" 108 | checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41" 109 | 110 | [[package]] 111 | name = "cfg-if" 112 | version = "1.0.0" 113 | source = "registry+https://github.com/rust-lang/crates.io-index" 114 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 115 | 116 | [[package]] 117 | name = "cfg_aliases" 118 | version = "0.1.1" 119 | source = "registry+https://github.com/rust-lang/crates.io-index" 120 | checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" 121 | 122 | [[package]] 123 | name = "chrono" 124 | version = "0.4.37" 125 | source = "registry+https://github.com/rust-lang/crates.io-index" 126 | checksum = "8a0d04d43504c61aa6c7531f1871dd0d418d91130162063b789da00fd7057a5e" 127 | dependencies = [ 128 | "android-tzdata", 129 | "iana-time-zone", 130 | "num-traits", 131 | "windows-targets 0.52.4", 132 | ] 133 | 134 | [[package]] 135 | name = "clap" 136 | version = "4.5.4" 137 | source = "registry+https://github.com/rust-lang/crates.io-index" 138 | checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" 139 | dependencies = [ 140 | "clap_builder", 141 | "clap_derive", 142 | ] 143 | 144 | [[package]] 145 | name = "clap_builder" 146 | version = "4.5.2" 147 | source = "registry+https://github.com/rust-lang/crates.io-index" 148 | checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" 149 | dependencies = [ 150 | "anstream", 151 | "anstyle", 152 | "clap_lex", 153 | "strsim", 154 | ] 155 | 156 | [[package]] 157 | name = "clap_derive" 158 | version = "4.5.4" 159 | source = "registry+https://github.com/rust-lang/crates.io-index" 160 | checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" 161 | dependencies = [ 162 | "heck", 163 | "proc-macro2", 164 | "quote", 165 | "syn", 166 | ] 167 | 168 | [[package]] 169 | name = "clap_lex" 170 | version = "0.7.0" 171 | source = "registry+https://github.com/rust-lang/crates.io-index" 172 | checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" 173 | 174 | [[package]] 175 | name = "colorchoice" 176 | version = "1.0.0" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" 179 | 180 | [[package]] 181 | name = "colored" 182 | version = "2.1.0" 183 | source = "registry+https://github.com/rust-lang/crates.io-index" 184 | checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" 185 | dependencies = [ 186 | "lazy_static", 187 | "windows-sys 0.48.0", 188 | ] 189 | 190 | [[package]] 191 | name = "core-foundation-sys" 192 | version = "0.8.6" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" 195 | 196 | [[package]] 197 | name = "cpufeatures" 198 | version = "0.2.12" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" 201 | dependencies = [ 202 | "libc", 203 | ] 204 | 205 | [[package]] 206 | name = "crossbeam-deque" 207 | version = "0.8.5" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" 210 | dependencies = [ 211 | "crossbeam-epoch", 212 | "crossbeam-utils", 213 | ] 214 | 215 | [[package]] 216 | name = "crossbeam-epoch" 217 | version = "0.9.18" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 220 | dependencies = [ 221 | "crossbeam-utils", 222 | ] 223 | 224 | [[package]] 225 | name = "crossbeam-utils" 226 | version = "0.8.19" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" 229 | 230 | [[package]] 231 | name = "crypto-common" 232 | version = "0.1.6" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 235 | dependencies = [ 236 | "generic-array", 237 | "typenum", 238 | ] 239 | 240 | [[package]] 241 | name = "ctrlc" 242 | version = "3.4.4" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "672465ae37dc1bc6380a6547a8883d5dd397b0f1faaad4f265726cc7042a5345" 245 | dependencies = [ 246 | "nix", 247 | "windows-sys 0.52.0", 248 | ] 249 | 250 | [[package]] 251 | name = "diff" 252 | version = "0.1.13" 253 | source = "registry+https://github.com/rust-lang/crates.io-index" 254 | checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" 255 | 256 | [[package]] 257 | name = "digest" 258 | version = "0.10.7" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 261 | dependencies = [ 262 | "block-buffer", 263 | "crypto-common", 264 | ] 265 | 266 | [[package]] 267 | name = "either" 268 | version = "1.10.0" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" 271 | 272 | [[package]] 273 | name = "fixedbitset" 274 | version = "0.2.0" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" 277 | 278 | [[package]] 279 | name = "fuchsia-cprng" 280 | version = "0.1.1" 281 | source = "registry+https://github.com/rust-lang/crates.io-index" 282 | checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" 283 | 284 | [[package]] 285 | name = "generic-array" 286 | version = "0.14.7" 287 | source = "registry+https://github.com/rust-lang/crates.io-index" 288 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 289 | dependencies = [ 290 | "typenum", 291 | "version_check", 292 | ] 293 | 294 | [[package]] 295 | name = "getopts" 296 | version = "0.2.21" 297 | source = "registry+https://github.com/rust-lang/crates.io-index" 298 | checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" 299 | dependencies = [ 300 | "unicode-width", 301 | ] 302 | 303 | [[package]] 304 | name = "getrandom" 305 | version = "0.1.16" 306 | source = "registry+https://github.com/rust-lang/crates.io-index" 307 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 308 | dependencies = [ 309 | "cfg-if", 310 | "libc", 311 | "wasi 0.9.0+wasi-snapshot-preview1", 312 | ] 313 | 314 | [[package]] 315 | name = "getrandom" 316 | version = "0.2.14" 317 | source = "registry+https://github.com/rust-lang/crates.io-index" 318 | checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" 319 | dependencies = [ 320 | "cfg-if", 321 | "libc", 322 | "wasi 0.11.0+wasi-snapshot-preview1", 323 | ] 324 | 325 | [[package]] 326 | name = "hashbrown" 327 | version = "0.12.3" 328 | source = "registry+https://github.com/rust-lang/crates.io-index" 329 | checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" 330 | 331 | [[package]] 332 | name = "heck" 333 | version = "0.5.0" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" 336 | 337 | [[package]] 338 | name = "home" 339 | version = "0.5.9" 340 | source = "registry+https://github.com/rust-lang/crates.io-index" 341 | checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" 342 | dependencies = [ 343 | "windows-sys 0.52.0", 344 | ] 345 | 346 | [[package]] 347 | name = "iana-time-zone" 348 | version = "0.1.60" 349 | source = "registry+https://github.com/rust-lang/crates.io-index" 350 | checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" 351 | dependencies = [ 352 | "android_system_properties", 353 | "core-foundation-sys", 354 | "iana-time-zone-haiku", 355 | "js-sys", 356 | "wasm-bindgen", 357 | "windows-core", 358 | ] 359 | 360 | [[package]] 361 | name = "iana-time-zone-haiku" 362 | version = "0.1.2" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" 365 | dependencies = [ 366 | "cc", 367 | ] 368 | 369 | [[package]] 370 | name = "icemaker" 371 | version = "0.1.0" 372 | dependencies = [ 373 | "chrono", 374 | "clap", 375 | "colored", 376 | "ctrlc", 377 | "diff", 378 | "home", 379 | "itertools 0.11.0", 380 | "lazy_static", 381 | "markov", 382 | "once_cell", 383 | "rand 0.8.5", 384 | "rayon", 385 | "regex", 386 | "serde", 387 | "serde_json", 388 | "sha2", 389 | "tempdir", 390 | "tree-sitter", 391 | "tree-sitter-rust", 392 | "tree-splicer", 393 | "walkdir", 394 | ] 395 | 396 | [[package]] 397 | name = "indexmap" 398 | version = "1.9.3" 399 | source = "registry+https://github.com/rust-lang/crates.io-index" 400 | checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" 401 | dependencies = [ 402 | "autocfg", 403 | "hashbrown", 404 | ] 405 | 406 | [[package]] 407 | name = "itertools" 408 | version = "0.9.0" 409 | source = "registry+https://github.com/rust-lang/crates.io-index" 410 | checksum = "284f18f85651fe11e8a991b2adb42cb078325c996ed026d994719efcfca1d54b" 411 | dependencies = [ 412 | "either", 413 | ] 414 | 415 | [[package]] 416 | name = "itertools" 417 | version = "0.11.0" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" 420 | dependencies = [ 421 | "either", 422 | ] 423 | 424 | [[package]] 425 | name = "itoa" 426 | version = "1.0.11" 427 | source = "registry+https://github.com/rust-lang/crates.io-index" 428 | checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" 429 | 430 | [[package]] 431 | name = "js-sys" 432 | version = "0.3.69" 433 | source = "registry+https://github.com/rust-lang/crates.io-index" 434 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" 435 | dependencies = [ 436 | "wasm-bindgen", 437 | ] 438 | 439 | [[package]] 440 | name = "lazy_static" 441 | version = "1.4.0" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 444 | 445 | [[package]] 446 | name = "libc" 447 | version = "0.2.153" 448 | source = "registry+https://github.com/rust-lang/crates.io-index" 449 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" 450 | 451 | [[package]] 452 | name = "linked-hash-map" 453 | version = "0.5.6" 454 | source = "registry+https://github.com/rust-lang/crates.io-index" 455 | checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" 456 | 457 | [[package]] 458 | name = "log" 459 | version = "0.4.21" 460 | source = "registry+https://github.com/rust-lang/crates.io-index" 461 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 462 | 463 | [[package]] 464 | name = "markov" 465 | version = "1.1.0" 466 | source = "registry+https://github.com/rust-lang/crates.io-index" 467 | checksum = "fc6ad68e26d51a9558f65e93b9795c9422630d0932717a3235668bb9ab71e3fd" 468 | dependencies = [ 469 | "getopts", 470 | "itertools 0.9.0", 471 | "petgraph", 472 | "rand 0.7.3", 473 | "serde", 474 | "serde_derive", 475 | "serde_yaml", 476 | ] 477 | 478 | [[package]] 479 | name = "memchr" 480 | version = "2.7.2" 481 | source = "registry+https://github.com/rust-lang/crates.io-index" 482 | checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" 483 | 484 | [[package]] 485 | name = "nix" 486 | version = "0.28.0" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" 489 | dependencies = [ 490 | "bitflags", 491 | "cfg-if", 492 | "cfg_aliases", 493 | "libc", 494 | ] 495 | 496 | [[package]] 497 | name = "num-traits" 498 | version = "0.2.18" 499 | source = "registry+https://github.com/rust-lang/crates.io-index" 500 | checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" 501 | dependencies = [ 502 | "autocfg", 503 | ] 504 | 505 | [[package]] 506 | name = "once_cell" 507 | version = "1.19.0" 508 | source = "registry+https://github.com/rust-lang/crates.io-index" 509 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 510 | 511 | [[package]] 512 | name = "petgraph" 513 | version = "0.5.1" 514 | source = "registry+https://github.com/rust-lang/crates.io-index" 515 | checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" 516 | dependencies = [ 517 | "fixedbitset", 518 | "indexmap", 519 | ] 520 | 521 | [[package]] 522 | name = "pin-project-lite" 523 | version = "0.2.14" 524 | source = "registry+https://github.com/rust-lang/crates.io-index" 525 | checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" 526 | 527 | [[package]] 528 | name = "ppv-lite86" 529 | version = "0.2.17" 530 | source = "registry+https://github.com/rust-lang/crates.io-index" 531 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 532 | 533 | [[package]] 534 | name = "proc-macro2" 535 | version = "1.0.79" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" 538 | dependencies = [ 539 | "unicode-ident", 540 | ] 541 | 542 | [[package]] 543 | name = "quote" 544 | version = "1.0.36" 545 | source = "registry+https://github.com/rust-lang/crates.io-index" 546 | checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" 547 | dependencies = [ 548 | "proc-macro2", 549 | ] 550 | 551 | [[package]] 552 | name = "rand" 553 | version = "0.4.6" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" 556 | dependencies = [ 557 | "fuchsia-cprng", 558 | "libc", 559 | "rand_core 0.3.1", 560 | "rdrand", 561 | "winapi", 562 | ] 563 | 564 | [[package]] 565 | name = "rand" 566 | version = "0.7.3" 567 | source = "registry+https://github.com/rust-lang/crates.io-index" 568 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 569 | dependencies = [ 570 | "getrandom 0.1.16", 571 | "libc", 572 | "rand_chacha 0.2.2", 573 | "rand_core 0.5.1", 574 | "rand_hc", 575 | ] 576 | 577 | [[package]] 578 | name = "rand" 579 | version = "0.8.5" 580 | source = "registry+https://github.com/rust-lang/crates.io-index" 581 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 582 | dependencies = [ 583 | "libc", 584 | "rand_chacha 0.3.1", 585 | "rand_core 0.6.4", 586 | ] 587 | 588 | [[package]] 589 | name = "rand_chacha" 590 | version = "0.2.2" 591 | source = "registry+https://github.com/rust-lang/crates.io-index" 592 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 593 | dependencies = [ 594 | "ppv-lite86", 595 | "rand_core 0.5.1", 596 | ] 597 | 598 | [[package]] 599 | name = "rand_chacha" 600 | version = "0.3.1" 601 | source = "registry+https://github.com/rust-lang/crates.io-index" 602 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 603 | dependencies = [ 604 | "ppv-lite86", 605 | "rand_core 0.6.4", 606 | ] 607 | 608 | [[package]] 609 | name = "rand_core" 610 | version = "0.3.1" 611 | source = "registry+https://github.com/rust-lang/crates.io-index" 612 | checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" 613 | dependencies = [ 614 | "rand_core 0.4.2", 615 | ] 616 | 617 | [[package]] 618 | name = "rand_core" 619 | version = "0.4.2" 620 | source = "registry+https://github.com/rust-lang/crates.io-index" 621 | checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" 622 | 623 | [[package]] 624 | name = "rand_core" 625 | version = "0.5.1" 626 | source = "registry+https://github.com/rust-lang/crates.io-index" 627 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 628 | dependencies = [ 629 | "getrandom 0.1.16", 630 | ] 631 | 632 | [[package]] 633 | name = "rand_core" 634 | version = "0.6.4" 635 | source = "registry+https://github.com/rust-lang/crates.io-index" 636 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 637 | dependencies = [ 638 | "getrandom 0.2.14", 639 | ] 640 | 641 | [[package]] 642 | name = "rand_hc" 643 | version = "0.2.0" 644 | source = "registry+https://github.com/rust-lang/crates.io-index" 645 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 646 | dependencies = [ 647 | "rand_core 0.5.1", 648 | ] 649 | 650 | [[package]] 651 | name = "rayon" 652 | version = "1.10.0" 653 | source = "registry+https://github.com/rust-lang/crates.io-index" 654 | checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" 655 | dependencies = [ 656 | "either", 657 | "rayon-core", 658 | ] 659 | 660 | [[package]] 661 | name = "rayon-core" 662 | version = "1.12.1" 663 | source = "registry+https://github.com/rust-lang/crates.io-index" 664 | checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" 665 | dependencies = [ 666 | "crossbeam-deque", 667 | "crossbeam-utils", 668 | ] 669 | 670 | [[package]] 671 | name = "rdrand" 672 | version = "0.4.0" 673 | source = "registry+https://github.com/rust-lang/crates.io-index" 674 | checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" 675 | dependencies = [ 676 | "rand_core 0.3.1", 677 | ] 678 | 679 | [[package]] 680 | name = "regex" 681 | version = "1.10.4" 682 | source = "registry+https://github.com/rust-lang/crates.io-index" 683 | checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" 684 | dependencies = [ 685 | "aho-corasick", 686 | "memchr", 687 | "regex-automata", 688 | "regex-syntax", 689 | ] 690 | 691 | [[package]] 692 | name = "regex-automata" 693 | version = "0.4.6" 694 | source = "registry+https://github.com/rust-lang/crates.io-index" 695 | checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" 696 | dependencies = [ 697 | "aho-corasick", 698 | "memchr", 699 | "regex-syntax", 700 | ] 701 | 702 | [[package]] 703 | name = "regex-syntax" 704 | version = "0.8.3" 705 | source = "registry+https://github.com/rust-lang/crates.io-index" 706 | checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" 707 | 708 | [[package]] 709 | name = "remove_dir_all" 710 | version = "0.5.3" 711 | source = "registry+https://github.com/rust-lang/crates.io-index" 712 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 713 | dependencies = [ 714 | "winapi", 715 | ] 716 | 717 | [[package]] 718 | name = "ryu" 719 | version = "1.0.17" 720 | source = "registry+https://github.com/rust-lang/crates.io-index" 721 | checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" 722 | 723 | [[package]] 724 | name = "same-file" 725 | version = "1.0.6" 726 | source = "registry+https://github.com/rust-lang/crates.io-index" 727 | checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" 728 | dependencies = [ 729 | "winapi-util", 730 | ] 731 | 732 | [[package]] 733 | name = "serde" 734 | version = "1.0.197" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" 737 | dependencies = [ 738 | "serde_derive", 739 | ] 740 | 741 | [[package]] 742 | name = "serde_derive" 743 | version = "1.0.197" 744 | source = "registry+https://github.com/rust-lang/crates.io-index" 745 | checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" 746 | dependencies = [ 747 | "proc-macro2", 748 | "quote", 749 | "syn", 750 | ] 751 | 752 | [[package]] 753 | name = "serde_json" 754 | version = "1.0.115" 755 | source = "registry+https://github.com/rust-lang/crates.io-index" 756 | checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" 757 | dependencies = [ 758 | "itoa", 759 | "ryu", 760 | "serde", 761 | ] 762 | 763 | [[package]] 764 | name = "serde_yaml" 765 | version = "0.8.26" 766 | source = "registry+https://github.com/rust-lang/crates.io-index" 767 | checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" 768 | dependencies = [ 769 | "indexmap", 770 | "ryu", 771 | "serde", 772 | "yaml-rust", 773 | ] 774 | 775 | [[package]] 776 | name = "sha2" 777 | version = "0.10.8" 778 | source = "registry+https://github.com/rust-lang/crates.io-index" 779 | checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" 780 | dependencies = [ 781 | "cfg-if", 782 | "cpufeatures", 783 | "digest", 784 | ] 785 | 786 | [[package]] 787 | name = "strsim" 788 | version = "0.11.1" 789 | source = "registry+https://github.com/rust-lang/crates.io-index" 790 | checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" 791 | 792 | [[package]] 793 | name = "syn" 794 | version = "2.0.58" 795 | source = "registry+https://github.com/rust-lang/crates.io-index" 796 | checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" 797 | dependencies = [ 798 | "proc-macro2", 799 | "quote", 800 | "unicode-ident", 801 | ] 802 | 803 | [[package]] 804 | name = "tempdir" 805 | version = "0.3.7" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" 808 | dependencies = [ 809 | "rand 0.4.6", 810 | "remove_dir_all", 811 | ] 812 | 813 | [[package]] 814 | name = "tracing" 815 | version = "0.1.40" 816 | source = "registry+https://github.com/rust-lang/crates.io-index" 817 | checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" 818 | dependencies = [ 819 | "pin-project-lite", 820 | "tracing-attributes", 821 | "tracing-core", 822 | ] 823 | 824 | [[package]] 825 | name = "tracing-attributes" 826 | version = "0.1.27" 827 | source = "registry+https://github.com/rust-lang/crates.io-index" 828 | checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" 829 | dependencies = [ 830 | "proc-macro2", 831 | "quote", 832 | "syn", 833 | ] 834 | 835 | [[package]] 836 | name = "tracing-core" 837 | version = "0.1.32" 838 | source = "registry+https://github.com/rust-lang/crates.io-index" 839 | checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" 840 | dependencies = [ 841 | "once_cell", 842 | ] 843 | 844 | [[package]] 845 | name = "tree-sitter" 846 | version = "0.22.2" 847 | source = "git+https://github.com/tree-sitter/tree-sitter#cbcb51b8575ca58f8bfde4f5e78cd08d562faa81" 848 | dependencies = [ 849 | "cc", 850 | "regex", 851 | ] 852 | 853 | [[package]] 854 | name = "tree-sitter-edit" 855 | version = "0.3.0" 856 | dependencies = [ 857 | "tree-sitter", 858 | "tree-sitter-traversal", 859 | ] 860 | 861 | [[package]] 862 | name = "tree-sitter-rust" 863 | version = "0.21.0" 864 | dependencies = [ 865 | "cc", 866 | "tree-sitter", 867 | ] 868 | 869 | [[package]] 870 | name = "tree-sitter-traversal" 871 | version = "0.1.2" 872 | dependencies = [ 873 | "tree-sitter", 874 | ] 875 | 876 | [[package]] 877 | name = "tree-splicer" 878 | version = "0.5.0" 879 | dependencies = [ 880 | "log", 881 | "rand 0.8.5", 882 | "serde", 883 | "serde_json", 884 | "tracing", 885 | "tree-sitter", 886 | "tree-sitter-edit", 887 | ] 888 | 889 | [[package]] 890 | name = "typenum" 891 | version = "1.17.0" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 894 | 895 | [[package]] 896 | name = "unicode-ident" 897 | version = "1.0.12" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 900 | 901 | [[package]] 902 | name = "unicode-width" 903 | version = "0.1.11" 904 | source = "registry+https://github.com/rust-lang/crates.io-index" 905 | checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" 906 | 907 | [[package]] 908 | name = "utf8parse" 909 | version = "0.2.1" 910 | source = "registry+https://github.com/rust-lang/crates.io-index" 911 | checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" 912 | 913 | [[package]] 914 | name = "version_check" 915 | version = "0.9.4" 916 | source = "registry+https://github.com/rust-lang/crates.io-index" 917 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 918 | 919 | [[package]] 920 | name = "walkdir" 921 | version = "2.5.0" 922 | source = "registry+https://github.com/rust-lang/crates.io-index" 923 | checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" 924 | dependencies = [ 925 | "same-file", 926 | "winapi-util", 927 | ] 928 | 929 | [[package]] 930 | name = "wasi" 931 | version = "0.9.0+wasi-snapshot-preview1" 932 | source = "registry+https://github.com/rust-lang/crates.io-index" 933 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 934 | 935 | [[package]] 936 | name = "wasi" 937 | version = "0.11.0+wasi-snapshot-preview1" 938 | source = "registry+https://github.com/rust-lang/crates.io-index" 939 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 940 | 941 | [[package]] 942 | name = "wasm-bindgen" 943 | version = "0.2.92" 944 | source = "registry+https://github.com/rust-lang/crates.io-index" 945 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 946 | dependencies = [ 947 | "cfg-if", 948 | "wasm-bindgen-macro", 949 | ] 950 | 951 | [[package]] 952 | name = "wasm-bindgen-backend" 953 | version = "0.2.92" 954 | source = "registry+https://github.com/rust-lang/crates.io-index" 955 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 956 | dependencies = [ 957 | "bumpalo", 958 | "log", 959 | "once_cell", 960 | "proc-macro2", 961 | "quote", 962 | "syn", 963 | "wasm-bindgen-shared", 964 | ] 965 | 966 | [[package]] 967 | name = "wasm-bindgen-macro" 968 | version = "0.2.92" 969 | source = "registry+https://github.com/rust-lang/crates.io-index" 970 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 971 | dependencies = [ 972 | "quote", 973 | "wasm-bindgen-macro-support", 974 | ] 975 | 976 | [[package]] 977 | name = "wasm-bindgen-macro-support" 978 | version = "0.2.92" 979 | source = "registry+https://github.com/rust-lang/crates.io-index" 980 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 981 | dependencies = [ 982 | "proc-macro2", 983 | "quote", 984 | "syn", 985 | "wasm-bindgen-backend", 986 | "wasm-bindgen-shared", 987 | ] 988 | 989 | [[package]] 990 | name = "wasm-bindgen-shared" 991 | version = "0.2.92" 992 | source = "registry+https://github.com/rust-lang/crates.io-index" 993 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 994 | 995 | [[package]] 996 | name = "winapi" 997 | version = "0.3.9" 998 | source = "registry+https://github.com/rust-lang/crates.io-index" 999 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1000 | dependencies = [ 1001 | "winapi-i686-pc-windows-gnu", 1002 | "winapi-x86_64-pc-windows-gnu", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "winapi-i686-pc-windows-gnu" 1007 | version = "0.4.0" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1010 | 1011 | [[package]] 1012 | name = "winapi-util" 1013 | version = "0.1.6" 1014 | source = "registry+https://github.com/rust-lang/crates.io-index" 1015 | checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" 1016 | dependencies = [ 1017 | "winapi", 1018 | ] 1019 | 1020 | [[package]] 1021 | name = "winapi-x86_64-pc-windows-gnu" 1022 | version = "0.4.0" 1023 | source = "registry+https://github.com/rust-lang/crates.io-index" 1024 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1025 | 1026 | [[package]] 1027 | name = "windows-core" 1028 | version = "0.52.0" 1029 | source = "registry+https://github.com/rust-lang/crates.io-index" 1030 | checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" 1031 | dependencies = [ 1032 | "windows-targets 0.52.4", 1033 | ] 1034 | 1035 | [[package]] 1036 | name = "windows-sys" 1037 | version = "0.48.0" 1038 | source = "registry+https://github.com/rust-lang/crates.io-index" 1039 | checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" 1040 | dependencies = [ 1041 | "windows-targets 0.48.5", 1042 | ] 1043 | 1044 | [[package]] 1045 | name = "windows-sys" 1046 | version = "0.52.0" 1047 | source = "registry+https://github.com/rust-lang/crates.io-index" 1048 | checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" 1049 | dependencies = [ 1050 | "windows-targets 0.52.4", 1051 | ] 1052 | 1053 | [[package]] 1054 | name = "windows-targets" 1055 | version = "0.48.5" 1056 | source = "registry+https://github.com/rust-lang/crates.io-index" 1057 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1058 | dependencies = [ 1059 | "windows_aarch64_gnullvm 0.48.5", 1060 | "windows_aarch64_msvc 0.48.5", 1061 | "windows_i686_gnu 0.48.5", 1062 | "windows_i686_msvc 0.48.5", 1063 | "windows_x86_64_gnu 0.48.5", 1064 | "windows_x86_64_gnullvm 0.48.5", 1065 | "windows_x86_64_msvc 0.48.5", 1066 | ] 1067 | 1068 | [[package]] 1069 | name = "windows-targets" 1070 | version = "0.52.4" 1071 | source = "registry+https://github.com/rust-lang/crates.io-index" 1072 | checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" 1073 | dependencies = [ 1074 | "windows_aarch64_gnullvm 0.52.4", 1075 | "windows_aarch64_msvc 0.52.4", 1076 | "windows_i686_gnu 0.52.4", 1077 | "windows_i686_msvc 0.52.4", 1078 | "windows_x86_64_gnu 0.52.4", 1079 | "windows_x86_64_gnullvm 0.52.4", 1080 | "windows_x86_64_msvc 0.52.4", 1081 | ] 1082 | 1083 | [[package]] 1084 | name = "windows_aarch64_gnullvm" 1085 | version = "0.48.5" 1086 | source = "registry+https://github.com/rust-lang/crates.io-index" 1087 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1088 | 1089 | [[package]] 1090 | name = "windows_aarch64_gnullvm" 1091 | version = "0.52.4" 1092 | source = "registry+https://github.com/rust-lang/crates.io-index" 1093 | checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" 1094 | 1095 | [[package]] 1096 | name = "windows_aarch64_msvc" 1097 | version = "0.48.5" 1098 | source = "registry+https://github.com/rust-lang/crates.io-index" 1099 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1100 | 1101 | [[package]] 1102 | name = "windows_aarch64_msvc" 1103 | version = "0.52.4" 1104 | source = "registry+https://github.com/rust-lang/crates.io-index" 1105 | checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" 1106 | 1107 | [[package]] 1108 | name = "windows_i686_gnu" 1109 | version = "0.48.5" 1110 | source = "registry+https://github.com/rust-lang/crates.io-index" 1111 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1112 | 1113 | [[package]] 1114 | name = "windows_i686_gnu" 1115 | version = "0.52.4" 1116 | source = "registry+https://github.com/rust-lang/crates.io-index" 1117 | checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" 1118 | 1119 | [[package]] 1120 | name = "windows_i686_msvc" 1121 | version = "0.48.5" 1122 | source = "registry+https://github.com/rust-lang/crates.io-index" 1123 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1124 | 1125 | [[package]] 1126 | name = "windows_i686_msvc" 1127 | version = "0.52.4" 1128 | source = "registry+https://github.com/rust-lang/crates.io-index" 1129 | checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" 1130 | 1131 | [[package]] 1132 | name = "windows_x86_64_gnu" 1133 | version = "0.48.5" 1134 | source = "registry+https://github.com/rust-lang/crates.io-index" 1135 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1136 | 1137 | [[package]] 1138 | name = "windows_x86_64_gnu" 1139 | version = "0.52.4" 1140 | source = "registry+https://github.com/rust-lang/crates.io-index" 1141 | checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" 1142 | 1143 | [[package]] 1144 | name = "windows_x86_64_gnullvm" 1145 | version = "0.48.5" 1146 | source = "registry+https://github.com/rust-lang/crates.io-index" 1147 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1148 | 1149 | [[package]] 1150 | name = "windows_x86_64_gnullvm" 1151 | version = "0.52.4" 1152 | source = "registry+https://github.com/rust-lang/crates.io-index" 1153 | checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" 1154 | 1155 | [[package]] 1156 | name = "windows_x86_64_msvc" 1157 | version = "0.48.5" 1158 | source = "registry+https://github.com/rust-lang/crates.io-index" 1159 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1160 | 1161 | [[package]] 1162 | name = "windows_x86_64_msvc" 1163 | version = "0.52.4" 1164 | source = "registry+https://github.com/rust-lang/crates.io-index" 1165 | checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" 1166 | 1167 | [[package]] 1168 | name = "yaml-rust" 1169 | version = "0.4.5" 1170 | source = "registry+https://github.com/rust-lang/crates.io-index" 1171 | checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" 1172 | dependencies = [ 1173 | "linked-hash-map", 1174 | ] 1175 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | authors = ["Matthias Krüger "] 3 | edition = "2021" 4 | license = "MIT/Apache-2.0" 5 | name = "icemaker" 6 | version = "0.1.0" 7 | 8 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 9 | 10 | [dependencies] 11 | chrono = {version = "0.4.31", default-features = false, features = ["alloc", "std", "clock"]} 12 | clap = {version = "4.0.4", features = ["derive"]} 13 | colored = "2.0.0" 14 | ctrlc = "3.2.1" 15 | diff = "0.1" 16 | home = "0.5.3" 17 | itertools = "0.11" 18 | lazy_static = "1.4" 19 | markov = "1.1" 20 | once_cell = "1.13" 21 | rand = "0.8" 22 | rayon = "1.5.0" 23 | regex = "1.5" 24 | serde = {version = "1.0", features = ["derive"]} 25 | serde_json = "1.0" 26 | sha2 = "0.10" 27 | tempdir = "0.3" 28 | tree-sitter = {git = "https://github.com/tree-sitter/tree-sitter"} 29 | tree-sitter-rust = {path = "../tree-sitter-rust"} 30 | tree-splicer = {path = "../tree-splicer/crates/tree-splicer"} 31 | walkdir = "2.3.1" 32 | 33 | [profile.release] 34 | #inherits="release" 35 | codegen-units = 1 36 | debug = false 37 | incremental = false 38 | lto = "thin" 39 | 40 | [features] 41 | # run without prlimit 42 | ci = [] 43 | 44 | #faster compile with not as good performance (more cgus) for manual testing 45 | [profile.fast] 46 | codegen-units = 4 47 | debug = false 48 | incremental = false 49 | inherits = "release" 50 | lto = "thin" 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Maker of ICE (Internal Compiler Error). 2 | 3 | A small program to automatically find crashes in the rust compiler, clippy, rustdoc, rustfmt and miri. 4 | Runs executable on a vast number of rust files (such as rustcs testsuit or glacier) and filters all the crashes. 5 | 6 | Features: 7 | * run rustc, clippy, rustdoc, rustfmt, miri, cg_clif or kani on a file and check if there is a crash 8 | * parallel execution 9 | * check different combinations of RUSTFLAGS 10 | * try to find minimal set of RUSTFLAGS that reproduces the internal compiler error 11 | * check if a file compiles stably with incremental compilation 12 | * build and run a file or tests under miri 13 | * run clippy or rustc on a file and find out if (and which) lint does not apply successfully (causes compiler errors) 14 | * find rustc diagnostics that change the file but do not managed to actually fix the broken code 15 | * use "prlimit" to protect against etenally hanging processes or OOMs during infinite loops 16 | * fuzz incremental compilation by using tree-splicer-rust to cause modifications for incremental compilation testing 17 | * automatic testcase reduction for rustc with treereduce-rust 18 | * somewhat automatic report generation for the bugtracker (for rustc atleast) 19 | 20 | Requirements: 21 | * by default, we build with the "ci" feature disabled and require "prlimit" to limit memory and runtime of a process 22 | 23 | History: 24 | This project started years ago as a simple bash oneliner like 25 | ```` 26 | for file in `find . | grep \.rs$` ;do ; echo $file; clippy-driver $file |& grep panicked ; done 27 | ```` 28 | but later I decided to RIIR and add support for rustc, rustdoc, nicer output, finding UB via miri and broken lint suggestions etc... 29 | 30 | Shout-outs and related projects 31 | http://github.com/jruderman/fuzz-rustc for getting me 80mb of fuzzing code 32 | http://github.com/dwrensha/fuzz-rustc which I could use to generate more output 33 | http://github.com/Nilstrieb/cargo-minimize testcase reduction 34 | http://github.com/langston-barrett/treereduce testcase reducion 35 | http://github.com/langston-barrett/tree-splicer code mutator which icemaker can use to generate more code 36 | 37 | 38 | Trophy case (1120+): 39 | 40 | https://github.com/rust-lang/rust/issues/123901 41 | https://github.com/rust-lang/rust/issues/123899 42 | https://github.com/rust-lang/rust/issues/123893 43 | https://github.com/rust-lang/rust/issues/123887 44 | https://github.com/rust-lang/rust/issues/123863 45 | https://github.com/rust-lang/rust/issues/123862 46 | https://github.com/rust-lang/rust/issues/123861 47 | https://github.com/rust-lang/rust/issues/123821 48 | https://github.com/rust-lang/rust/issues/123818 49 | https://github.com/rust-lang/rust/issues/123810 50 | https://github.com/rust-lang/rust/issues/123809 51 | https://github.com/rust-lang/rust/issues/123693 52 | https://github.com/rust-lang/rust/issues/123690 53 | https://github.com/rust-lang/rust/issues/123685 54 | https://github.com/rust-lang/rust/issues/123684 55 | https://github.com/rust-lang/rust-clippy/issues/12654 56 | https://github.com/rust-lang/rust/issues/123643 57 | https://github.com/rust-lang/rust/issues/123641 58 | https://github.com/rust-lang/rust/issues/123640 59 | https://github.com/rust-lang/rust/issues/123639 60 | https://github.com/rust-lang/rust/issues/123461 61 | https://github.com/rust-lang/rust/issues/123457 62 | https://github.com/rust-lang/rust/issues/123456 63 | https://github.com/rust-lang/rust/issues/123428 64 | https://github.com/rust-lang/rust/issues/123420 65 | https://github.com/rust-lang/rust/issues/123383 66 | https://github.com/rust-lang/rust/issues/123370 67 | https://github.com/rust-lang/rust/issues/123243 68 | https://github.com/rust-lang/rustc_codegen_cranelift/issues/1473 69 | https://github.com/rust-lang/rust/issues/123141 70 | https://github.com/rust-lang/rust/issues/123140 71 | https://github.com/rust-lang/rust/issues/123079 72 | https://github.com/rust-lang/rust/issues/123078 73 | https://github.com/rust-lang/rust/issues/123077 74 | https://github.com/rust-lang/rust/issues/123053 75 | https://github.com/rust-lang/rust/issues/123009 76 | https://github.com/rust-lang/rust/issues/122998 77 | https://github.com/rust-lang/rust/issues/122989 78 | https://github.com/rust-lang/miri/issues/3400 79 | https://github.com/rust-lang/rust/issues/122914 80 | https://github.com/rust-lang/rust/issues/122909 81 | https://github.com/rust-lang/rust/issues/122908 82 | https://github.com/rust-lang/rust/issues/122904 83 | https://github.com/rust-lang/rust/issues/122903 84 | https://github.com/rust-lang/rust-clippy/issues/12531 85 | https://github.com/rust-lang/rust/issues/122861 86 | https://github.com/rust-lang/rust/issues/122823 87 | https://github.com/rust-lang/rust/issues/122809 88 | https://github.com/rust-lang/rust/issues/122782 89 | https://github.com/rust-lang/rust/issues/122738 90 | https://github.com/rust-lang/rust/issues/122736 91 | https://github.com/rust-lang/rust/issues/122705 92 | https://github.com/rust-lang/rust-clippy/issues/12505 93 | https://github.com/rust-lang/rust/issues/122694 94 | https://github.com/rust-lang/rust/issues/122655 95 | https://github.com/rust-lang/rust/issues/122638 96 | https://github.com/rust-lang/rust/issues/122630 97 | https://github.com/rust-lang/rust/issues/122587 98 | https://github.com/rust-lang/rust/issues/122581 99 | https://github.com/rust-lang/rust/issues/122552 100 | https://github.com/rust-lang/rust/issues/122550 101 | https://github.com/rust-lang/rust/issues/122549 102 | https://github.com/rust-lang/rust/issues/122548 103 | https://github.com/rust-lang/rust/issues/122547 104 | https://github.com/rust-lang/rust/issues/122529 105 | https://github.com/rust-lang/rust/issues/122518 106 | https://github.com/rust-lang/rust/issues/122508 107 | https://github.com/rust-lang/rust/issues/122488 108 | https://github.com/rust-lang/rust/issues/122445 109 | https://github.com/rust-lang/rust/issues/122399 110 | https://github.com/rust-lang/rust/issues/122364 111 | https://github.com/rust-lang/rust/issues/122345 112 | https://github.com/rust-lang/rust/issues/122259 113 | https://github.com/rust-lang/rust/issues/122216 114 | https://github.com/rust-lang/rust/issues/122214 115 | https://github.com/rust-lang/rust/issues/122199 116 | https://github.com/rust-lang/rust/issues/122177 117 | https://github.com/rust-lang/rust/issues/122130 118 | https://github.com/rust-lang/rust/issues/122112 119 | https://github.com/rust-lang/rust/issues/122098 120 | https://github.com/rust-lang/rust/issues/122044 121 | https://github.com/rust-lang/rust/issues/121999 122 | https://github.com/rust-lang/rust/issues/121983 123 | https://github.com/rust-lang/rust/issues/121974 124 | https://github.com/rust-lang/rust/issues/121957 125 | https://github.com/rust-lang/rustfmt/issues/6102 126 | https://github.com/rust-lang/rust/issues/121858 127 | https://github.com/rust-lang/rust-clippy/issues/12389 128 | https://github.com/rust-lang/rust/issues/121807 129 | https://github.com/rust-lang/rust/issues/121769 130 | https://github.com/rust-lang/rust/issues/121760 131 | https://github.com/rust-lang/rust/issues/121757 132 | https://github.com/rust-lang/rust/issues/121755 133 | https://github.com/rust-lang/rust/issues/121722 134 | https://github.com/rust-lang/rust-clippy/issues/12366 135 | https://github.com/rust-lang/rust/issues/121688 136 | https://github.com/rust-lang/rust/issues/121688 137 | https://github.com/rust-lang/rust/issues/121649 138 | https://github.com/rust-lang/rust/issues/121647 139 | https://github.com/rust-lang/rust/issues/121638 140 | https://github.com/rust-lang/rust/issues/121623 141 | https://github.com/rust-lang/rust-clippy/issues/12352 142 | https://github.com/rust-lang/rust-clippy/issues/12351 143 | https://github.com/rust-lang/rust/issues/121612 144 | https://github.com/rust-lang/rust/issues/121597 145 | https://github.com/rust-lang/rust/issues/121585 146 | https://github.com/rust-lang/rust/issues/121574 147 | https://github.com/rust-lang/rust/issues/121538 148 | https://github.com/rust-lang/rust/issues/121537 149 | https://github.com/rust-lang/rust/issues/121536 150 | https://github.com/rust-lang/rust/issues/121534 151 | https://github.com/rust-lang/rust/issues/121532 152 | https://github.com/rust-lang/rust/issues/121517 153 | https://github.com/rust-lang/rust/issues/121512 154 | https://github.com/rust-lang/rust/issues/121508 155 | https://github.com/rust-lang/rust/issues/121504 156 | https://github.com/rust-lang/rust/issues/121503 157 | https://github.com/rust-lang/rust/issues/121477 158 | https://github.com/rust-lang/rust/issues/121473 159 | https://github.com/rust-lang/rust/issues/121472 160 | https://github.com/rust-lang/rust/issues/121468 161 | https://github.com/rust-lang/rust/issues/121463 162 | https://github.com/rust-lang/rust/issues/121457 163 | https://github.com/rust-lang/rust/issues/121455 164 | https://github.com/rust-lang/rust/issues/121451 165 | https://github.com/rust-lang/rust/issues/121450 166 | https://github.com/rust-lang/rust/issues/121447 167 | https://github.com/rust-lang/rust/issues/121446 168 | https://github.com/rust-lang/rust/issues/121445 169 | https://github.com/rust-lang/rust/issues/121444 170 | https://github.com/rust-lang/rust/issues/121443 171 | https://github.com/rust-lang/rust/issues/121431 172 | https://github.com/rust-lang/rust/issues/121429 173 | https://github.com/rust-lang/rust/issues/121424 174 | https://github.com/rust-lang/rust/issues/121422 175 | https://github.com/rust-lang/rust/issues/121418 176 | https://github.com/rust-lang/rust/issues/121414 177 | https://github.com/rust-lang/rust/issues/121413 178 | https://github.com/rust-lang/rust/issues/121411 179 | https://github.com/rust-lang/rust/issues/121410 180 | https://github.com/rust-lang/rust/issues/121363 181 | https://github.com/rust-lang/rust-clippy/issues/12320 182 | https://github.com/rust-lang/rust-clippy/issues/12319 183 | https://github.com/rust-lang/rust/issues/121331 184 | https://github.com/rust-lang/rust/issues/121330 185 | https://github.com/rust-lang/rust/issues/121314 186 | https://github.com/rust-lang/rust/issues/121299 187 | https://github.com/rust-lang/rust/issues/121292 188 | https://github.com/rust-lang/rust/issues/121263 189 | https://github.com/rust-lang/rust/issues/121176 190 | https://github.com/rust-lang/rust/issues/121170 191 | https://github.com/rust-lang/rust/issues/121161 192 | https://github.com/rust-lang/rust/issues/121151 193 | https://github.com/rust-lang/rust/issues/121134 194 | https://github.com/rust-lang/rust/issues/121128 195 | https://github.com/rust-lang/rust/issues/121127 196 | https://github.com/rust-lang/rust/issues/121126 197 | https://github.com/rust-lang/rust/issues/121108 198 | https://github.com/rust-lang/rust/issues/121103 199 | https://github.com/rust-lang/rust/issues/121099 200 | https://github.com/rust-lang/rust/issues/121097 201 | https://github.com/rust-lang/rust/issues/121096 202 | https://github.com/rust-lang/rust/issues/121063 203 | https://github.com/rust-lang/rust/issues/121052 204 | https://github.com/rust-lang/rust/issues/121006 205 | https://github.com/rust-lang/rust/issues/121004 206 | https://github.com/rust-lang/rust/issues/120992 207 | https://github.com/rust-lang/rust-clippy/issues/12284 208 | https://github.com/rust-lang/rust/issues/120954 209 | https://github.com/model-checking/kani/issues/3023 210 | https://github.com/model-checking/kani/issues/3022 211 | https://github.com/model-checking/kani/issues/3021 212 | https://github.com/model-checking/kani/issues/3020 213 | https://github.com/model-checking/kani/issues/3019 214 | https://github.com/model-checking/kani/issues/3018 215 | https://github.com/model-checking/kani/issues/3017 216 | https://github.com/rust-lang/rust/issues/120946 217 | https://github.com/rust-lang/rust/issues/120945 218 | https://github.com/rust-lang/rust/issues/120941 219 | https://github.com/rust-lang/rust/issues/120940 220 | https://github.com/rust-lang/rust/issues/120925 221 | https://github.com/rust-lang/rust/issues/120891 222 | https://github.com/rust-lang/rust/issues/120884 223 | https://github.com/rust-lang/rust/issues/120873 224 | https://github.com/rust-lang/rust/issues/120864 225 | https://github.com/rust-lang/rust-clippy/issues/12255 226 | https://github.com/rust-lang/rust/issues/120860 227 | https://github.com/rust-lang/rust-clippy/issues/12253 228 | https://github.com/rust-lang/rust/issues/120856 229 | https://github.com/rust-lang/rust/issues/120816 230 | https://github.com/rust-lang/rust/issues/120793 231 | https://github.com/rust-lang/rust/issues/120792 232 | https://github.com/rust-lang/rust/issues/120791 233 | https://github.com/rust-lang/rust/issues/120789 234 | https://github.com/rust-lang/rust/issues/120788 235 | https://github.com/rust-lang/rust/issues/120787 236 | https://github.com/rust-lang/rust/issues/120786 237 | https://github.com/rust-lang/rust/issues/120779 238 | https://github.com/rust-lang/rust/issues/120760 239 | https://github.com/rust-lang/rust/issues/120759 240 | https://github.com/rust-lang/rust/issues/120757 241 | https://github.com/rust-lang/rustfmt/issues/6061 242 | https://github.com/rust-lang/rust/issues/120732 243 | https://github.com/rust-lang/miri/issues/3288 244 | https://github.com/rust-lang/rust/issues/120615 245 | https://github.com/rust-lang/rust/issues/120612 246 | https://github.com/rust-lang/rust/issues/120601 247 | https://github.com/rust-lang/rust/issues/120600 248 | https://github.com/rust-lang/rustc_codegen_cranelift/issues/1454 249 | https://github.com/rust-lang/rust/issues/120503 250 | https://github.com/rust-lang/rust/issues/120482 251 | https://github.com/rust-lang/rustc_codegen_cranelift/issues/1452 252 | https://github.com/rust-lang/rust/issues/120421 253 | https://github.com/rust-lang/rust/issues/120397 254 | https://github.com/rust-lang/rustfmt/issues/6043 255 | https://github.com/rust-lang/rust/issues/120343 256 | https://github.com/rust-lang/rust/issues/120337 257 | https://github.com/rust-lang/rust/issues/120253 258 | https://github.com/rust-lang/rust/issues/120241 259 | https://github.com/rust-lang/rust/issues/120208 260 | https://github.com/rust-lang/rust/issues/120175 261 | https://github.com/rust-lang/rust-clippy/issues/12174 262 | https://github.com/rust-lang/rust-clippy/issues/12171 263 | https://github.com/rust-lang/rust/issues/120035 264 | https://github.com/rust-lang/rust/issues/120033 265 | https://github.com/rust-lang/rust/issues/120026 266 | https://github.com/rust-lang/rust/issues/120016 267 | https://github.com/rust-lang/rust/issues/119953 268 | https://github.com/rust-lang/rust/issues/119951 269 | https://github.com/rust-lang/rust/issues/119942 270 | https://github.com/rust-lang/rust/issues/119921 271 | https://github.com/rust-lang/rust/issues/119920 272 | https://github.com/rust-lang/rust/issues/119919 273 | https://github.com/rust-lang/rust/issues/119905 274 | https://github.com/rust-lang/rust/issues/119890 275 | https://github.com/rust-lang/rust/issues/119867 276 | https://github.com/rust-lang/rust/issues/119857 277 | https://github.com/rust-lang/rust/issues/119847 278 | https://github.com/rust-lang/rust/issues/119830 279 | https://github.com/rust-lang/rust/issues/119827 280 | https://github.com/rust-lang/rust/issues/119824 281 | https://github.com/rust-lang/rust/issues/119789 282 | https://github.com/rust-lang/rust/issues/119786 283 | https://github.com/rust-lang/rust/issues/119785 284 | https://github.com/rust-lang/rust/issues/119784 285 | https://github.com/rust-lang/rust/issues/119778 286 | https://github.com/rust-lang/rust/issues/119717 287 | https://github.com/rust-lang/rust/issues/119701 288 | https://github.com/rust-lang/rust/issues/119700 289 | https://github.com/rust-lang/rust/issues/119697 290 | https://github.com/rust-lang/rust/issues/119696 291 | https://github.com/rust-lang/rust-analyzer/issues/16293 292 | https://github.com/rust-lang/rust-analyzer/issues/16292 293 | https://github.com/rust-lang/rust-analyzer/issues/16291 294 | https://github.com/rust-lang/rust-analyzer/issues/16288 295 | https://github.com/rust-lang/rust-analyzer/issues/16287 296 | https://github.com/rust-lang/rust-analyzer/issues/16286 297 | https://github.com/rust-lang/rust-analyzer/issues/16284 298 | https://github.com/rust-lang/rust-analyzer/issues/16283 299 | https://github.com/rust-lang/rust-analyzer/issues/16282 300 | https://github.com/rust-lang/rust-analyzer/issues/16281 301 | https://github.com/rust-lang/rust-analyzer/issues/16280 302 | https://github.com/rust-lang/rust-analyzer/issues/16278 303 | https://github.com/rust-lang/rust/issues/119652 304 | https://github.com/rust-lang/rust/issues/119633 305 | https://github.com/rust-lang/rust-clippy/issues/12101 306 | https://github.com/rust-lang/rust/issues/119524 307 | https://github.com/rust-lang/rust/issues/119493 308 | https://github.com/rust-lang/rust/issues/119489 309 | https://github.com/rust-lang/rust/issues/119382 310 | https://github.com/rust-lang/rust/issues/119381 311 | https://github.com/rust-lang/rust/issues/119352 312 | https://github.com/rust-lang/rust/issues/119316 313 | https://github.com/rust-lang/rust/issues/119295 314 | https://github.com/rust-lang/rust/issues/119275 315 | https://github.com/rust-lang/rust/issues/119272 316 | https://github.com/rust-lang/rust/issues/119271 317 | https://github.com/rust-lang/rust/issues/119270 318 | https://github.com/rust-lang/rust/issues/119267 319 | https://github.com/rust-lang/rust/issues/119209 320 | https://github.com/rust-lang/rust/issues/119085 321 | https://github.com/rust-lang/rust/issues/119073 322 | https://github.com/rust-marker/marker/issues/338 323 | https://github.com/rust-marker/marker/issues/337 324 | https://github.com/rust-marker/marker/issues/336 325 | https://github.com/rust-marker/marker/issues/335 326 | https://github.com/rust-marker/marker/issues/334 327 | https://github.com/rust-marker/marker/issues/333 328 | https://github.com/rust-marker/marker/issues/332 329 | https://github.com/rust-marker/marker/issues/331 330 | https://github.com/rust-marker/marker/issues/330 331 | https://github.com/rust-lang/rust/issues/119025 332 | https://github.com/rust-lang/rust/issues/118987 333 | https://github.com/rust-lang/rust/issues/118954 334 | https://github.com/rust-lang/rust/issues/118951 335 | https://github.com/rust-lang/rust/issues/118950 336 | https://github.com/rust-lang/rustc_codegen_cranelift/issues/1436 337 | https://github.com/rust-lang/rust/issues/118786 338 | https://github.com/rust-lang/rust/issues/118784 339 | https://github.com/rust-lang/rust/issues/118783 340 | https://github.com/rust-lang/rust/issues/118778 341 | https://github.com/rust-lang/rust/issues/118697 342 | https://github.com/rust-lang/rust/issues/118696 343 | https://github.com/rust-lang/rustc_codegen_cranelift/issues/1435 344 | https://github.com/rust-lang/rust/issues/118575 345 | https://github.com/rust-lang/rustc_codegen_cranelift/issues/1434 346 | https://github.com/rust-lang/rust/issues/118564 347 | https://github.com/rust-lang/rust/issues/118531 348 | https://github.com/rust-lang/rust/issues/118530 349 | https://github.com/rust-lang/rust/issues/118520 350 | https://github.com/rust-lang/rust/issues/118510 351 | https://github.com/rust-lang/rust/issues/118499 352 | https://github.com/rust-lang/rustc_codegen_cranelift/issues/1433 353 | https://github.com/rust-lang/rust/issues/118320 354 | https://github.com/rust-lang/rustc_codegen_cranelift/issues/1430 355 | https://github.com/rust-lang/rustc_codegen_cranelift/issues/1429 356 | https://github.com/rust-lang/rust/issues/118164 357 | https://github.com/rust-lang/rustc_codegen_cranelift/issues/1428 358 | https://github.com/rust-lang/rust/issues/118144 359 | https://github.com/rust-lang/rust/issues/118048 360 | https://github.com/rust-lang/rust/issues/118038 361 | https://github.com/rust-lang/rust/issues/118021 362 | https://github.com/rust-lang/rust/issues/117942 363 | https://github.com/rust-lang/rust-clippy/issues/11803 364 | https://github.com/rust-lang/rust/issues/117886 365 | https://github.com/model-checking/kani/issues/2876 366 | https://github.com/model-checking/kani/issues/2874 367 | https://github.com/rust-lang/miri/issues/3160 368 | https://github.com/rust-lang/rust/issues/117831 369 | https://github.com/rust-lang/rust/issues/117829 370 | https://github.com/rust-lang/rust/issues/117821 371 | https://github.com/rust-lang/rust/issues/117812 372 | https://github.com/rust-lang/rust/issues/117808 373 | https://github.com/rust-lang/rust/issues/117806 374 | https://github.com/rust-lang/rust/issues/117795 375 | https://github.com/rust-lang/rust/issues/117794 376 | https://github.com/rust-lang/rust/issues/117789 377 | https://github.com/rust-lang/rust/issues/117728 378 | https://github.com/rust-lang/rust/issues/117670 379 | https://github.com/rust-lang/rust/issues/117629 380 | https://github.com/rust-lang/rust/issues/117628 381 | https://github.com/rust-lang/rust-clippy/issues/11755 382 | https://github.com/rust-lang/rust-clippy/issues/11754 383 | https://github.com/rust-lang/rust/issues/117547 384 | https://github.com/rust-lang/rust/issues/117491 385 | https://github.com/rust-lang/rust/issues/117379 386 | https://github.com/rust-lang/rust/issues/117378 387 | https://github.com/rust-lang/rust/issues/117368 388 | https://github.com/rust-lang/rust/issues/117362 389 | https://github.com/rust-lang/rust/issues/117244 390 | https://github.com/rust-lang/rust/issues/117195 391 | https://github.com/rust-lang/rust/issues/117153 392 | https://github.com/rust-lang/rust/issues/117146 393 | https://github.com/rust-lang/rust/issues/117144 394 | https://github.com/rust-lang/rust/issues/117100 395 | https://github.com/rust-lang/rust/issues/117033 396 | https://github.com/rust-lang/rust/issues/117014 397 | https://github.com/rust-lang/rust/issues/116979 398 | https://github.com/rust-lang/rust/issues/116947 399 | https://github.com/rust-lang/rust/issues/116893 400 | https://github.com/rust-lang/rust/issues/116796 401 | https://github.com/rust-lang/rust/issues/116781 402 | https://github.com/rust-lang/rust/issues/116721 403 | https://github.com/rust-lang/rust/issues/116710 404 | https://github.com/rust-lang/rust/issues/116659 405 | https://github.com/rust-lang/rust/issues/116658 406 | https://github.com/rust-lang/rust/issues/116657 407 | https://github.com/rust-lang/rust/issues/116513 408 | https://github.com/rust-lang/rust/issues/116473 409 | https://github.com/rust-lang/rust/issues/116459 410 | https://github.com/rust-lang/rust-clippy/issues/11614 411 | https://github.com/rust-lang/rust/issues/116383 412 | https://github.com/rust-lang/rust/issues/116321 413 | https://github.com/rust-lang/rust/issues/116308 414 | https://github.com/rust-lang/rust/issues/116303 415 | https://github.com/rust-lang/rust/issues/116265 416 | https://github.com/rust-lang/rust/issues/116212 417 | https://github.com/rust-lang/rust/issues/116186 418 | https://github.com/rust-lang/rust/issues/116055 419 | https://github.com/rust-lang/rust/issues/116031 420 | https://github.com/rust-lang/rust/issues/115845 421 | https://github.com/rust-lang/rust/issues/115809 422 | https://github.com/rust-lang/rust/issues/115808 423 | https://github.com/rust-lang/rust/issues/115806 424 | https://github.com/rust-lang/rust/issues/115792 425 | https://github.com/rust-lang/rust/issues/115791 426 | https://github.com/rust-lang/rust/issues/115789 427 | https://github.com/rust-lang/rust/issues/115680 428 | https://github.com/rust-lang/rust/issues/115647 429 | https://github.com/rust-lang/rust/issues/115628 430 | https://github.com/model-checking/kani/issues/2732 431 | https://github.com/model-checking/kani/issues/2731 432 | https://github.com/model-checking/kani/issues/2730 433 | https://github.com/rust-lang/rust/issues/115517 434 | https://github.com/rust-lang/rust/issues/115500 435 | https://github.com/rust-lang/rust/issues/115498 436 | https://github.com/rust-lang/rust/issues/115497 437 | https://github.com/rust-lang/rust/issues/115474 438 | https://github.com/model-checking/kani/issues/2725 439 | https://github.com/rust-lang/rust/issues/115402 440 | https://github.com/rust-lang/rust-clippy/issues/11426 441 | https://github.com/rust-lang/rust-clippy/issues/11425 442 | https://github.com/rust-lang/rust/issues/115360 443 | https://github.com/rust-lang/rust-clippy/issues/11422 444 | https://github.com/rust-lang/rust/issues/115351 445 | https://github.com/rust-lang/rust/issues/115265 446 | https://github.com/rust-lang/rust/issues/115264 447 | https://github.com/rust-lang/rust/issues/115223 448 | https://github.com/rust-lang/rust/issues/115019 449 | https://github.com/rust-lang/rust/issues/114872 450 | https://github.com/rust-lang/rustfmt/issues/5885 451 | https://github.com/model-checking/kani/issues/2684 452 | https://github.com/model-checking/kani/issues/2683 453 | https://github.com/model-checking/kani/issues/2682 454 | https://github.com/rust-lang/rust-clippy/issues/11337 455 | https://github.com/rust-lang/rust/issues/114744 456 | https://github.com/rust-lang/rustfmt/issues/5882 457 | https://github.com/rust-lang/rust-clippy/issues/11317 458 | https://github.com/rust-lang/rust/issues/114701 459 | https://github.com/rust-lang/rust/issues/114665 460 | https://github.com/rust-lang/rust/issues/114664 461 | https://github.com/rust-lang/rust/issues/114663 462 | https://github.com/rust-lang/rust/issues/114636 463 | https://github.com/rust-lang/rust/issues/114529 464 | https://github.com/rust-lang/rust/issues/114478 465 | https://github.com/rust-lang/rust/issues/114471 466 | https://github.com/rust-lang/rust/issues/114468 467 | https://github.com/rust-lang/rust/issues/114456 468 | https://github.com/rust-lang/rust/issues/114455 469 | https://github.com/rust-lang/rust/issues/114435 470 | https://github.com/rust-lang/rust/issues/114433 471 | https://github.com/rust-lang/rust/issues/114423 472 | https://github.com/rust-lang/rust/issues/114375 473 | https://github.com/rust-lang/rust-clippy/issues/11277 474 | https://github.com/rust-lang/rust/issues/114319 475 | https://github.com/rust-lang/rustfmt/issues/5868 476 | https://github.com/rust-lang/rust/issues/114275 477 | https://github.com/rust-lang/rust/issues/114274 478 | https://github.com/rust-lang/rust/issues/114221 479 | https://github.com/rust-lang/rust/issues/114220 480 | https://github.com/rust-lang/rust/issues/114219 481 | https://github.com/rust-lang/rust/issues/114218 482 | https://github.com/rust-lang/rust/issues/114217 483 | https://github.com/rust-lang/rust/issues/114216 484 | https://github.com/rust-lang/rust/issues/114214 485 | https://github.com/rust-lang/rust/issues/114213 486 | https://github.com/rust-lang/rust/issues/114198 487 | https://github.com/rust-lang/rust/issues/114188 488 | https://github.com/rust-lang/rust/issues/114187 489 | https://github.com/rust-lang/rust/issues/114185 490 | https://github.com/rust-lang/rust/issues/114179 491 | https://github.com/rust-lang/rust/issues/114160 492 | https://github.com/rust-lang/rust/issues/114158 493 | https://github.com/rust-lang/rust/issues/114151 494 | https://github.com/rust-lang/rust/issues/114121 495 | https://github.com/rust-lang/rust/issues/113953 496 | https://github.com/rust-lang/rust/issues/113952 497 | https://github.com/rust-lang/rust/issues/113951 498 | https://github.com/rust-lang/rust/issues/113903 499 | https://github.com/rust-lang/rust-clippy/issues/11197 500 | https://github.com/rust-lang/rust/issues/113894 501 | https://github.com/rust-lang/rust/issues/113881 502 | https://github.com/rust-lang/rust/issues/113870 503 | https://github.com/rust-lang/rust/issues/113866 504 | https://github.com/rust-lang/rust/issues/113860 505 | https://github.com/rust-lang/rust/issues/113808 506 | https://github.com/rust-lang/rust/issues/113794 507 | https://github.com/rust-lang/rust/issues/113793 508 | https://github.com/rust-lang/rust/issues/113760 509 | https://github.com/rust-lang/rust-clippy/issues/11167 510 | https://github.com/rust-lang/rust/issues/113736 511 | https://github.com/rust-lang/rust/issues/113610 512 | https://github.com/rust-lang/rust-clippy/issues/11134 513 | https://github.com/rust-lang/rust/issues/113516 514 | https://github.com/rust-lang/rust/issues/113462 515 | https://github.com/rust-lang/rust/issues/113439 516 | https://github.com/rust-lang/rust/issues/113438 517 | https://github.com/rust-lang/rust/issues/113434 518 | https://github.com/rust-lang/rust/issues/113423 519 | https://github.com/rust-lang/rust/issues/113415 520 | https://github.com/rust-lang/rust/issues/113405 521 | https://github.com/rust-lang/rust/issues/113403 522 | https://github.com/rust-lang/rust/issues/113381 523 | https://github.com/rust-lang/rust/issues/113379 524 | https://github.com/rust-lang/rust/issues/113378 525 | https://github.com/rust-lang/rust/issues/113375 526 | https://github.com/rust-lang/rust/issues/113280 527 | https://github.com/rust-lang/rust/issues/113279 528 | https://github.com/rust-lang/rust/issues/113272 529 | https://github.com/rust-lang/rust-clippy/issues/11068 530 | https://github.com/rust-lang/rust-clippy/issues/11067 531 | https://github.com/rust-lang/rust-clippy/issues/11066 532 | https://github.com/rust-lang/rust-clippy/issues/11065 533 | https://github.com/rust-lang/rust-clippy/issues/11064 534 | https://github.com/rust-lang/rust-clippy/issues/10972 535 | https://github.com/rust-lang/rustc_codegen_gcc/issues/298 536 | https://github.com/rust-lang/rustc_codegen_gcc/issues/297 537 | https://github.com/rust-lang/rustc_codegen_gcc/issues/296 538 | https://github.com/rust-lang/rustc_codegen_gcc/issues/295 539 | https://github.com/rust-lang/rustc_codegen_gcc/issues/294 540 | https://github.com/rust-lang/rustc_codegen_gcc/issues/293 541 | https://github.com/rust-lang/rustc_codegen_gcc/issues/292 542 | https://github.com/rust-lang/rustc_codegen_gcc/issues/291 543 | https://github.com/rust-lang/rustc_codegen_gcc/issues/290 544 | https://github.com/rust-lang/rustc_codegen_gcc/issues/289 545 | https://github.com/rust-lang/rustc_codegen_gcc/issues/288 546 | https://github.com/rust-lang/rustc_codegen_gcc/issues/287 547 | https://github.com/rust-lang/rust/issues/113203 548 | https://github.com/rust-lang/rust/issues/113021 549 | https://github.com/rust-lang/rust/issues/113017 550 | https://github.com/rust-lang/rust/issues/113016 551 | https://github.com/rust-lang/rust/issues/112873 552 | https://github.com/rust-lang/rust/issues/112848 553 | https://github.com/rust-lang/rust/issues/112824 554 | https://github.com/rust-lang/rust/issues/112823 555 | https://github.com/rust-lang/rust/issues/112822 556 | https://github.com/rust-lang/rust/issues/112770 557 | https://github.com/rust-lang/rust-clippy/issues/10983 558 | https://github.com/rust-lang/miri/issues/2934 559 | https://github.com/rust-lang/rust/issues/112752 560 | https://github.com/rust-lang/rust/issues/112736 561 | https://github.com/rust-lang/rust/issues/112735 562 | https://github.com/rust-lang/rust/issues/112731 563 | https://github.com/rust-lang/rust/issues/112631 564 | https://github.com/rust-lang/rust/issues/112623 565 | https://github.com/rust-lang/rust/issues/112622 566 | https://github.com/rust-lang/rust/issues/112608 567 | https://github.com/rust-lang/rust/issues/112607 568 | https://github.com/rust-lang/rust/issues/112574 569 | https://github.com/rust-lang/rust/issues/112522 570 | https://github.com/rust-lang/rust/issues/112510 571 | https://github.com/rust-lang/rust/issues/112507 572 | https://github.com/rust-lang/rust/issues/112505 573 | https://github.com/rust-lang/rust/issues/112503 574 | https://github.com/rust-lang/rust/issues/112491 575 | https://github.com/rust-lang/rust/issues/112437 576 | https://github.com/rust-lang/rust/issues/112437 577 | https://github.com/rust-lang/rust/issues/112434 578 | https://github.com/rust-lang/rust/issues/112433 579 | https://github.com/rust-lang/rust-clippy/issues/10912 580 | https://github.com/rust-lang/rust/issues/112397 581 | https://github.com/rust-lang/rust/issues/112376 582 | https://github.com/rust-lang/rust/issues/112363 583 | https://github.com/rust-lang/rust/issues/112360 584 | https://github.com/rust-lang/rust/issues/112242 585 | https://github.com/model-checking/kani/issues/2502 586 | https://github.com/model-checking/kani/issues/2501 587 | https://github.com/model-checking/kani/issues/2499 588 | https://github.com/model-checking/kani/issues/2498 589 | https://github.com/model-checking/kani/issues/2497 590 | https://github.com/rust-lang/rust-clippy/issues/10874 591 | https://github.com/rust-lang/rust/issues/112208 592 | https://github.com/rust-lang/rust/issues/112201 593 | https://github.com/rust-lang/rust/issues/111883 594 | https://github.com/rust-lang/rust/issues/111879 595 | https://github.com/rust-lang/rust/issues/111877 596 | https://github.com/rust-lang/rust/issues/111828 597 | https://github.com/rust-lang/rust/issues/111749 598 | https://github.com/rust-lang/rust/issues/111729 599 | https://github.com/rust-lang/rust/issues/111727 600 | https://github.com/rust-lang/rust/issues/111529 601 | https://github.com/rust-lang/rust/issues/111528 602 | https://github.com/rust-lang/rust/issues/111522 603 | https://github.com/rust-lang/rust/issues/111521 604 | https://github.com/rust-lang/rust/issues/111520 605 | https://github.com/rust-lang/rust/issues/111515 606 | https://github.com/rust-lang/rust/issues/111510 607 | https://github.com/rust-lang/rust/issues/111500 608 | https://github.com/rust-lang/rustfix/issues/219 609 | https://github.com/rust-lang/rust/issues/111468 610 | https://github.com/rust-lang/rust/issues/111433 611 | https://github.com/rust-lang/rust/issues/111418 612 | https://github.com/rust-lang/rust/issues/111417 613 | https://github.com/rust-lang/rust/issues/111416 614 | https://github.com/rust-lang/rust/issues/111411 615 | https://github.com/rust-lang/rust/issues/111404 616 | https://github.com/rust-lang/rust/issues/111400 617 | https://github.com/rust-lang/rust/issues/111399 618 | https://github.com/rust-lang/rust/issues/111397 619 | https://github.com/rust-lang/rust/issues/111390 620 | https://github.com/rust-lang/rust/issues/111341 621 | https://github.com/rust-lang/rust-clippy/issues/10756 622 | https://github.com/rust-lang/rust-clippy/issues/10755 623 | https://github.com/rust-lang/rust/issues/111280 624 | https://github.com/rust-lang/rust/issues/111232 625 | https://github.com/rust-lang/rust/issues/111216 626 | https://github.com/rust-lang/rust/issues/111214 627 | https://github.com/rust-lang/rust/issues/111206 628 | https://github.com/rust-lang/rust/issues/111205 629 | https://github.com/rust-lang/rust/issues/111185 630 | https://github.com/rust-lang/rust/issues/111184 631 | https://github.com/rust-lang/rust/issues/111176 632 | https://github.com/rust-lang/rust/issues/111051 633 | https://github.com/rust-lang/rust/issues/110969 634 | https://github.com/rust-lang/miri/issues/2861 635 | https://github.com/rust-lang/rust/issues/110941 636 | https://github.com/rust-lang/rust/issues/110929 637 | https://github.com/rust-lang/rust/issues/110900 638 | https://github.com/rust-lang/rust/issues/110899 639 | https://github.com/rust-lang/rust/issues/110892 640 | https://github.com/rust-lang/rust/issues/110887 641 | https://github.com/rust-lang/rust/issues/110858 642 | https://github.com/rust-lang/rust/issues/110781 643 | https://github.com/rust-lang/rust/issues/110771 644 | https://github.com/rust-lang/rust/issues/110745 645 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1370 646 | https://github.com/rust-lang/rust/issues/110741 647 | https://github.com/rust-lang/rust/issues/110740 648 | https://github.com/rust-lang/rust/issues/110723 649 | https://github.com/rust-lang/rust/issues/110696 650 | https://github.com/rust-lang/rust/issues/110687 651 | https://github.com/rust-lang/rust/issues/110683 652 | https://github.com/rust-lang/rust/issues/110630 653 | https://github.com/rust-lang/rust/issues/110629 654 | https://github.com/rust-lang/miri/issues/2847 655 | https://github.com/rust-lang/rust/issues/110561 656 | https://github.com/rust-lang/rust/issues/110557 657 | https://github.com/rust-lang/rust/issues/110549 658 | https://github.com/rust-lang/rust/issues/110547 659 | https://github.com/rust-lang/rust/issues/110467 660 | https://github.com/rust-lang/rust/issues/110464 661 | https://github.com/rust-lang/rust-clippy/issues/10645 662 | https://github.com/rust-lang/rust/issues/110206 663 | https://github.com/rust-lang/rust-clippy/issues/10633 664 | https://github.com/rust-lang/rust/issues/110164 665 | https://github.com/rust-lang/rust/issues/110161 666 | https://github.com/rust-lang/rust/issues/110157 667 | https://github.com/rust-lang/rust/issues/110138 668 | https://github.com/rust-lang/rust/issues/110052 669 | https://github.com/rust-lang/rust/issues/110005 670 | https://github.com/rust-lang/rust/issues/109992 671 | https://github.com/rust-lang/rustfmt/issues/5735 672 | https://github.com/rust-lang/rust/issues/109898 673 | https://github.com/rust-lang/rustfmt/issues/5734 674 | https://github.com/rust-lang/rust/issues/109854 675 | https://github.com/rust-lang/rust/issues/109853 676 | https://github.com/rust-lang/rust/issues/109832 677 | https://github.com/rust-lang/rust/issues/109831 678 | https://github.com/rust-lang/rust/issues/109812 679 | https://github.com/rust-lang/rustfmt/issues/5730 680 | https://github.com/rust-lang/rustfmt/issues/5729 681 | https://github.com/rust-lang/rustfmt/issues/5728 682 | https://github.com/rust-lang/rust/issues/109768 683 | https://github.com/rust-lang/rust-clippy/issues/10569 684 | https://github.com/rust-lang/rust/issues/109681 685 | https://github.com/rust-lang/rust-clippy/issues/10549 686 | https://github.com/rust-lang/rust-clippy/issues/10548 687 | https://github.com/rust-lang/rust-clippy/issues/10547 688 | https://github.com/langston-barrett/tree-splicer/issues/11 689 | https://github.com/rust-lang/rust/issues/109514 690 | https://github.com/rust-lang/rust/issues/109396 691 | https://github.com/rust-lang/rust/issues/109343 692 | https://github.com/rust-lang/rust/issues/109305 693 | https://github.com/rust-lang/rust/issues/109304 694 | https://github.com/rust-lang/rust/issues/109300 695 | https://github.com/rust-lang/rust/issues/109299 696 | https://github.com/rust-lang/rust/issues/109298 697 | https://github.com/rust-lang/rust/issues/109297 698 | https://github.com/rust-lang/rust/issues/109296 699 | https://github.com/rust-lang/rust-clippy/issues/10517 700 | https://github.com/rust-lang/rustfmt/issues/5716 701 | https://github.com/rust-lang/rust/issues/109239 702 | https://github.com/rust-lang/rust/issues/109232 703 | https://github.com/rust-lang/rust/issues/109204 704 | https://github.com/rust-lang/rust/issues/109191 705 | https://github.com/rust-lang/rust/issues/109188 706 | https://github.com/rust-lang/rust/issues/109178 707 | https://github.com/rust-lang/rust-clippy/issues/10508 708 | https://github.com/rust-lang/rust/issues/109152 709 | https://github.com/rust-lang/rust/issues/109148 710 | https://github.com/rust-lang/rust/issues/109147 711 | https://github.com/rust-lang/rust/issues/109146 712 | https://github.com/rust-lang/rust/issues/109144 713 | https://github.com/rust-lang/rust/issues/109141 714 | https://github.com/langston-barrett/tree-splicer/issues/7 715 | https://github.com/rust-lang/rust/issues/109098 716 | https://github.com/rust-lang/rust/issues/109096 717 | https://github.com/rust-lang/rust/issues/109090 718 | https://github.com/rust-lang/rust/issues/109072 719 | https://github.com/rust-lang/rust/issues/109071 720 | https://github.com/rust-lang/rust-clippy/issues/10495 721 | https://github.com/rust-lang/rust/issues/109023 722 | https://github.com/rust-lang/rust/issues/108957 723 | https://github.com/rust-lang/rust/issues/108781 724 | https://github.com/rust-lang/rust-clippy/issues/10452 725 | https://github.com/rust-lang/rust-clippy/issues/10451 726 | https://github.com/rust-lang/rust-clippy/issues/10450 727 | https://github.com/rust-lang/rust-clippy/issues/10449 728 | https://github.com/rust-lang/rust-clippy/issues/10447 729 | https://github.com/rust-lang/rust-clippy/issues/10446 730 | https://github.com/rust-lang/rust/issues/108748 731 | https://github.com/rust-lang/rust/issues/108742 732 | https://github.com/rust-lang/rust/issues/108738 733 | https://github.com/model-checking/kani/issues/2266 734 | https://github.com/model-checking/kani/issues/2265 735 | https://github.com/model-checking/kani/issues/2264 736 | https://github.com/rust-lang/rust/issues/108697 737 | https://github.com/model-checking/kani/issues/2262 738 | https://github.com/model-checking/kani/issues/2261 739 | https://github.com/model-checking/kani/issues/2260 740 | https://github.com/model-checking/kani/issues/2259 741 | https://github.com/model-checking/kani/issues/2258 742 | https://github.com/model-checking/kani/issues/2256 743 | https://github.com/model-checking/kani/issues/2255 744 | https://github.com/model-checking/kani/issues/2254 745 | https://github.com/model-checking/kani/issues/2253 746 | https://github.com/model-checking/kani/issues/2252 747 | https://github.com/rust-lang/rust/issues/108529 748 | https://github.com/rust-lang/rust-clippy/issues/10412 749 | https://github.com/rust-lang/rust-clippy/issues/10409 750 | https://github.com/model-checking/kani/issues/2242 751 | https://github.com/model-checking/kani/issues/2241 752 | https://github.com/model-checking/kani/issues/2240 753 | https://github.com/model-checking/kani/issues/2239 754 | https://github.com/model-checking/kani/issues/2238 755 | https://github.com/model-checking/kani/issues/2237 756 | https://github.com/model-checking/kani/issues/2236 757 | https://github.com/rust-lang/rust/issues/108399 758 | https://github.com/rust-lang/rust/issues/108266 759 | https://github.com/rust-lang/rust/issues/108249 760 | https://github.com/rust-lang/rust/issues/108248 761 | https://github.com/rust-lang/rust-clippy/issues/10379 762 | https://github.com/rust-lang/rust-clippy/issues/10374 763 | https://github.com/rust-lang/rust/issues/108225 764 | https://github.com/rust-lang/rust/issues/108194 765 | https://github.com/rust-lang/rust/issues/108192 766 | https://github.com/rust-lang/rust/issues/108191 767 | https://github.com/rust-lang/rust/issues/108190 768 | https://github.com/rust-lang/rust/issues/108184 769 | https://github.com/rust-lang/rust/issues/108182 770 | https://github.com/rust-lang/rust/issues/108181 771 | https://github.com/rust-lang/rust/issues/108180 772 | https://github.com/rust-lang/rust/issues/108179 773 | https://github.com/rust-lang/rust/issues/108165 774 | https://github.com/rust-lang/rust/issues/108158 775 | https://github.com/rust-lang/rust/issues/107998 776 | https://github.com/rust-lang/rust/issues/107988 777 | https://github.com/rust-lang/rust/pull/107973 778 | https://github.com/rust-lang/rust/pull/107972 779 | https://github.com/rust-lang/rust/issues/107872 780 | https://github.com/rust-lang/rust/issues/107860 781 | https://github.com/rust-lang/rust/issues/107818 782 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1354 783 | https://github.com/rust-lang/rust/issues/107705 784 | https://github.com/rust-lang/rust/issues/107428 785 | https://github.com/rust-lang/rust/issues/107423 786 | https://github.com/rust-lang/rust/issues/107414 787 | https://github.com/rust-lang/rust/issues/107346 788 | https://github.com/rust-lang/rust/issues/107147 789 | https://github.com/rust-lang/rust/issues/107093 790 | https://github.com/rust-lang/rust/issues/107090 791 | https://github.com/rust-lang/rust/issues/107089 792 | https://github.com/rust-lang/rust/issues/107088 793 | https://github.com/rust-lang/rust/issues/107087 794 | https://github.com/rust-lang/rust/issues/106926 795 | https://github.com/rust-lang/rust/issues/106882 796 | https://github.com/rust-lang/rust/issues/106881 797 | https://github.com/rust-lang/rust/issues/106876 798 | https://github.com/rust-lang/rust/issues/106862 799 | https://github.com/rust-lang/rust/issues/106861 800 | https://github.com/rust-lang/rust/issues/106858 801 | https://github.com/rust-lang/rust/issues/106857 802 | https://github.com/rust-lang/rust/issues/106843 803 | https://github.com/rust-lang/rust/issues/106841 804 | https://github.com/rust-lang/rust/issues/106755 805 | https://github.com/rust-lang/rust/issues/106695 806 | https://github.com/rust-lang/rust/issues/106666 807 | https://github.com/rust-lang/rust/issues/106226 808 | https://github.com/rust-lang/rust/issues/106213 809 | https://github.com/rust-lang/rust/issues/106079 810 | https://github.com/rust-lang/rust/issues/106030 811 | https://github.com/rust-lang/rust/issues/105981 812 | https://github.com/rust-lang/miri/issues/2735 813 | https://github.com/rust-lang/miri/issues/2734 814 | https://github.com/rust-lang/rust/issues/105969 815 | https://github.com/rust-lang/rust/issues/105968 816 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1330 817 | https://github.com/rust-lang/rust/issues/105946 818 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1329 819 | https://github.com/rust-lang/rust/issues/105937 820 | https://github.com/rust-lang/rust/issues/105896 821 | https://github.com/rust-lang/rust/issues/105819 822 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1327 823 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1326 824 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1325 825 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1324 826 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1323 827 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1322 828 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1321 829 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1320 830 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1319 831 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1317 832 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1316 833 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1315 834 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1313 835 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1312 836 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1311 837 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1310 838 | https://github.com/rust-lang/rust/issues/105742 839 | https://github.com/rust-lang/rust/issues/105737 840 | https://github.com/rust-lang/rust/issues/105709 841 | https://github.com/rust-lang/rust/issues/105689 842 | https://github.com/rust-lang/rust/issues/105631 843 | https://github.com/rust-lang/rust/issues/105591 844 | https://github.com/rust-lang/rust/issues/105449 845 | https://github.com/rust-lang/rust/issues/105404 846 | https://github.com/rust-lang/rust-clippy/issues/10044 847 | https://github.com/rust-lang/rustfmt/issues/5626 848 | https://github.com/rust-lang/rust/issues/105334 849 | https://github.com/rust-lang/rust/issues/105330 850 | https://github.com/rust-lang/rust/issues/105304 851 | https://github.com/rust-lang/rust/issues/105288 852 | https://github.com/rust-lang/rustfmt/issues/5625 853 | https://github.com/rust-lang/rust/issues/105275 854 | https://github.com/rust-lang/rust/issues/105273 855 | https://github.com/rust-lang/rust/issues/105269 856 | https://github.com/rust-lang/rust/issues/105263 857 | https://github.com/rust-lang/rust/issues/105260 858 | https://github.com/rust-lang/rust/issues/105257 859 | https://github.com/rust-lang/rust/issues/105249 860 | https://github.com/rust-lang/rust/issues/105232 861 | https://github.com/rust-lang/rust/issues/105210 862 | https://github.com/rust-lang/rust/issues/105209 863 | https://github.com/rust-lang/rust/issues/105202 864 | https://github.com/rust-lang/rust/issues/105199 865 | https://github.com/rust-lang/rust/issues/105169 866 | https://github.com/rust-lang/rust/issues/105150 867 | https://github.com/rust-lang/rust/issues/105149 868 | https://github.com/rust-lang/rust/issues/105148 869 | https://github.com/rust-lang/rust-clippy/issues/10019 870 | https://github.com/rust-lang/rust-clippy/issues/10018 871 | https://github.com/rust-lang/rust-clippy/issues/10017 872 | https://github.com/rust-lang/rust-clippy/issues/10016 873 | https://github.com/rust-lang/rust-clippy/issues/10015 874 | https://github.com/rust-lang/rust-clippy/issues/10014 875 | https://github.com/rust-lang/rust/issues/105099 876 | https://github.com/rust-lang/rust-clippy/issues/10002 877 | https://github.com/rust-lang/rust-clippy/issues/10000 878 | https://github.com/rust-lang/rust/issues/105031 879 | https://github.com/rust-lang/rust-clippy/issues/9976 880 | https://github.com/rust-lang/rust/issues/105028 881 | https://github.com/rust-lang/rust-clippy/issues/9973 882 | https://github.com/rust-lang/rust-clippy/issues/9961 883 | https://github.com/rust-lang/rust-clippy/issues/9960 884 | https://github.com/rust-lang/rust/issues/104918 885 | https://github.com/rust-lang/rust-clippy/issues/9957 886 | https://github.com/rust-lang/rust-clippy/issues/9956 887 | https://github.com/rust-lang/rust-clippy/issues/9955 888 | https://github.com/rust-lang/rust-clippy/issues/9954 889 | https://github.com/rust-lang/rust-clippy/issues/9953 890 | https://github.com/rust-lang/rust-clippy/issues/9952 891 | https://github.com/rust-lang/rust-clippy/issues/9951 892 | https://github.com/rust-lang/rust-clippy/issues/9949 893 | https://github.com/rust-lang/rust/issues/104913 894 | https://github.com/rust-lang/rust-clippy/issues/9947 895 | https://github.com/rust-lang/rust/issues/104910 896 | https://github.com/rust-lang/rust-clippy/issues/9946 897 | https://github.com/rust-lang/rust/issues/104904 898 | https://github.com/rust-lang/rust/issues/104897 899 | https://github.com/rust-lang/rust-clippy/issues/9942 900 | https://github.com/rust-lang/rust/issues/104870 901 | https://github.com/rust-lang/rust-clippy/issues/9935 902 | https://github.com/rust-lang/rust/issues/104817 903 | https://github.com/rust-lang/rust/issues/104794 904 | https://github.com/rust-lang/rust/issues/104695 905 | https://github.com/rust-lang/rust-clippy/issues/9917 906 | https://github.com/rust-lang/rust-clippy/issues/9916 907 | https://github.com/rust-lang/rust-clippy/issues/9915 908 | https://github.com/rust-lang/rust-clippy/issues/9914 909 | https://github.com/rust-lang/rust-clippy/issues/9913 910 | https://github.com/rust-lang/rust-clippy/issues/9912 911 | https://github.com/rust-lang/rust-clippy/issues/9911 912 | https://github.com/rust-lang/rust-clippy/issues/9910 913 | https://github.com/rust-lang/rust-clippy/issues/9909 914 | https://github.com/rust-lang/rust-clippy/issues/9908 915 | https://github.com/rust-lang/rust-clippy/issues/9907 916 | https://github.com/rust-lang/rust-clippy/issues/9906 917 | https://github.com/rust-lang/rust-clippy/issues/9905 918 | https://github.com/rust-lang/rust-clippy/issues/9904 919 | https://github.com/rust-lang/rust-clippy/issues/9903 920 | https://github.com/rust-lang/rust-clippy/issues/9902 921 | https://github.com/rust-lang/rust-clippy/issues/9901 922 | https://github.com/rust-lang/rust-clippy/issues/9900 923 | https://github.com/rust-lang/rust-clippy/issues/9899 924 | https://github.com/rust-lang/rust-clippy/issues/9898 925 | https://github.com/rust-lang/rust-clippy/issues/9897 926 | https://github.com/rust-lang/rust-clippy/issues/9896 927 | https://github.com/rust-lang/rust-clippy/issues/9895 928 | https://github.com/rust-lang/rust-clippy/issues/9894 929 | https://github.com/rust-lang/rust-clippy/issues/9893 930 | https://github.com/rust-lang/rust-clippy/issues/9892 931 | https://github.com/rust-lang/rust-clippy/issues/9891 932 | https://github.com/rust-lang/rust-clippy/issues/9890 933 | https://github.com/rust-lang/rust-clippy/issues/9889 934 | https://github.com/rust-lang/rust/issues/104631 935 | https://github.com/rust-lang/rust-clippy/issues/9888 936 | https://github.com/rust-lang/rust-clippy/issues/9887 937 | https://github.com/rust-lang/rust-clippy/issues/9886 938 | https://github.com/rust-lang/rust-clippy/issues/9885 939 | https://github.com/rust-lang/rust-clippy/issues/9884 940 | https://github.com/rust-lang/rust-clippy/issues/9883 941 | https://github.com/rust-lang/rust-clippy/issues/9882 942 | https://github.com/rust-lang/rust-clippy/issues/9866 943 | https://github.com/rust-lang/rust/issues/104518 944 | https://github.com/rust-lang/rust/issues/104440 945 | https://github.com/rust-lang/rust/issues/104432 946 | https://github.com/rust-lang/rust/issues/104392 947 | https://github.com/rust-lang/rust/issues/104237 948 | https://github.com/rust-lang/rust/issues/104173 949 | https://github.com/rust-lang/rust/issues/104085 950 | https://github.com/rust-lang/rust/issues/104040 951 | https://github.com/rust-lang/rust/issues/104037 952 | https://github.com/rust-lang/rust/issues/103679 953 | https://github.com/rust-lang/rust/issues/102989 954 | https://github.com/rust-lang/rust/issues/102986 955 | https://github.com/rust-lang/rust/issues/102985 956 | https://github.com/rust-lang/rust/issues/102946 957 | https://github.com/rust-lang/rust/issues/102933 958 | https://github.com/rust-lang/rust/issues/102827 959 | https://github.com/rust-lang/rust/issues/102828 960 | https://github.com/rust-lang/rust/issues/102796 961 | https://github.com/rust-lang/rust/issues/102768 962 | https://github.com/rust-lang/rust/issues/102645 963 | https://github.com/rust-lang/rust/issues/102571 964 | https://github.com/rust-lang/rust/issues/102467 965 | https://github.com/rust-lang/rust/issues/102465 966 | https://github.com/rust-lang/rust/issues/102363 967 | https://github.com/rust-lang/rust/issues/102156 968 | https://github.com/rust-lang/rust/issues/102154 969 | https://github.com/rust-lang/rust/issues/102124 970 | https://github.com/rust-lang/rust/issues/102105 971 | https://github.com/rust-lang/rust/issues/101964 972 | https://github.com/rust-lang/rust/issues/101962 973 | https://github.com/rust-lang/rust/issues/101739 974 | https://github.com/rust-lang/rust-clippy/issues/9463 975 | https://github.com/rust-lang/rust-clippy/issues/9459 976 | https://github.com/rust-lang/rust-clippy/issues/9433 977 | https://github.com/rust-lang/rust/issues/101517 978 | https://github.com/rust-lang/rust/issues/101505 979 | https://github.com/rust-lang/rust/issues/101243 980 | https://github.com/rust-lang/rust/issues/101113 981 | https://github.com/rust-lang/rust/issues/101076 982 | https://github.com/rust-lang/rust/issues/100948 983 | https://github.com/rust-lang/miri/issues/2499 984 | https://github.com/rust-lang/rust/issues/100783 985 | https://github.com/rust-lang/rust/issues/100778 986 | https://github.com/rust-lang/rust/issues/100772 987 | https://github.com/rust-lang/rust/issues/100770 988 | https://github.com/rust-lang/miri/issues/2496 989 | https://github.com/rust-lang/rust/issues/100612 990 | https://github.com/rust-lang/rust/issues/100485 991 | https://github.com/rust-lang/rust/issues/100484 992 | https://github.com/rust-lang/rust/issues/100191 993 | https://github.com/rust-lang/rust/issues/100187 994 | https://github.com/rust-lang/rust/issues/100154 995 | https://github.com/rust-lang/rust/issues/100047 996 | https://github.com/rust-lang/rust/issues/99876 997 | https://github.com/rust-lang/rust/issues/99820 998 | https://github.com/rust-lang/miri/issues/2433 999 | https://github.com/rust-lang/miri/issues/2432 1000 | https://github.com/rust-lang/rust/issues/99662 1001 | https://github.com/rust-lang/rust/issues/99647 1002 | https://github.com/rust-lang/rust/issues/99387 1003 | https://github.com/rust-lang/rust/issues/99363 1004 | https://github.com/rust-lang/rust/issues/99331 1005 | https://github.com/rust-lang/rust/issues/99325 1006 | https://github.com/rust-lang/rust/issues/99319 1007 | https://github.com/rust-lang/rust/issues/99318 1008 | https://github.com/rust-lang/rust/issues/99228 1009 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1244 1010 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1243 1011 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1242 1012 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1241 1013 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1240 1014 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1239 1015 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1238 1016 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1237 1017 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1236 1018 | https://github.com/bjorn3/rustc_codegen_cranelift/issues/1235 1019 | https://github.com/rust-lang/miri/issues/2340 1020 | https://github.com/rust-lang/rust/issues/98821 1021 | https://github.com/rust-lang/rust/issues/98372 1022 | https://github.com/rust-lang/rust/issues/98250 1023 | https://github.com/rust-lang/rust/issues/98171 1024 | https://github.com/rust-lang/miri/issues/2234 1025 | https://github.com/rust-lang/rust/issues/98016 1026 | https://github.com/rust-lang/rust/issues/98009 1027 | https://github.com/rust-lang/rust/issues/98007 1028 | https://github.com/rust-lang/rust/issues/98006 1029 | https://github.com/rust-lang/rust/issues/98003 1030 | https://github.com/rust-lang/rust/issues/98002 1031 | https://github.com/rust-lang/rust/issues/97728 1032 | https://github.com/rust-lang/rust/issues/97726 1033 | https://github.com/rust-lang/rust/issues/97725 1034 | https://github.com/rust-lang/rust/issues/97698 1035 | https://github.com/rust-lang/rust/issues/97695 1036 | https://github.com/rust-lang/rust/issues/97270 1037 | https://github.com/rust-lang/rust/issues/97194 1038 | https://github.com/rust-lang/rust/issues/97193 1039 | https://github.com/rust-lang/rust/issues/97049 1040 | https://github.com/rust-lang/rust/issues/97006 1041 | https://github.com/rust-lang/miri/issues/2106 1042 | https://github.com/rust-lang/miri/issues/2088 1043 | https://github.com/rust-lang/rust/issues/96765 1044 | https://github.com/rust-lang/rust/issues/96767 1045 | https://github.com/rust-lang/rust/issues/96721 1046 | https://github.com/rust-lang/rust/issues/96485 1047 | https://github.com/rust-lang/rust/issues/96395 1048 | https://github.com/rust-lang/rust-clippy/issues/8748 1049 | https://github.com/rust-lang/rust/issues/96381 1050 | https://github.com/rust-lang/rust/issues/96288 1051 | https://github.com/rust-lang/rust/issues/96287 1052 | https://github.com/rust-lang/rust/issues/96200 1053 | https://github.com/rust-lang/rust/issues/96191 1054 | https://github.com/rust-lang/rust/issues/96185 1055 | https://github.com/rust-lang/rust/issues/96175 1056 | https://github.com/rust-lang/rust/issues/96172 1057 | https://github.com/rust-lang/rust/issues/96170 1058 | https://github.com/rust-lang/rust/issues/96169 1059 | https://github.com/rust-lang/rust/issues/96114 1060 | https://github.com/rust-lang/rust/issues/95978 1061 | https://github.com/rust-lang/rust/issues/95879 1062 | https://github.com/rust-lang/rust/issues/95878 1063 | https://github.com/rust-lang/rust/issues/95640 1064 | https://github.com/rust-lang/rust/issues/95327 1065 | https://github.com/rust-lang/rust/issues/95307 1066 | https://github.com/rust-lang/rust/issues/95163 1067 | https://github.com/rust-lang/rust/issues/95128 1068 | https://github.com/rust-lang/rust/issues/95023 1069 | https://github.com/rust-lang/rust/issues/94961 1070 | https://github.com/rust-lang/rust/issues/94953 1071 | https://github.com/rust-lang/rust/issues/94903 1072 | https://github.com/rust-lang/rust/issues/94822 1073 | https://github.com/rust-lang/rust/issues/94725 1074 | https://github.com/rust-lang/rust/issues/94654 1075 | https://github.com/rust-lang/rust/issues/94629 1076 | https://github.com/rust-lang/rust/issues/94627 1077 | https://github.com/rust-lang/rust/issues/94516 1078 | https://github.com/rust-lang/rust/issues/94382 1079 | https://github.com/rust-lang/rust/issues/94380 1080 | https://github.com/rust-lang/rust/issues/94379 1081 | https://github.com/rust-lang/rust/issues/94378 1082 | https://github.com/rust-lang/rust/issues/94171 1083 | https://github.com/rust-lang/rust/issues/94149 1084 | https://github.com/rust-lang/rust/issues/94073 1085 | https://github.com/rust-lang/rust/issues/93871 1086 | https://github.com/rust-lang/rust/issues/93788 1087 | https://github.com/rust-lang/rust/issues/93688 1088 | https://github.com/rust-lang/rust/issues/93578 1089 | https://github.com/rust-lang/rust/issues/93117 1090 | https://github.com/rust-lang/rust-clippy/issues/8245 1091 | https://github.com/rust-lang/rust-clippy/issues/8244 1092 | https://github.com/rust-lang/rust/issues/92495 1093 | https://github.com/rust-lang/rust/issues/92240 1094 | https://github.com/rust-lang/rust/issues/91745 1095 | https://github.com/rust-lang/rust/issues/90192 1096 | https://github.com/rust-lang/rust/issues/90191 1097 | https://github.com/rust-lang/rust/issues/90189 1098 | https://github.com/rust-lang/rust/issues/89312 1099 | https://github.com/rust-lang/rust/issues/89271 1100 | https://github.com/rust-lang/rust/issues/89066 1101 | https://github.com/rust-lang/rust/issues/88536 1102 | https://github.com/rust-lang/rustfmt/issues/4968 1103 | https://github.com/rust-lang/rust/issues/88434 1104 | https://github.com/rust-lang/rust/issues/88433 1105 | https://github.com/rust-lang/rust/issues/88171 1106 | https://github.com/rust-lang/rust/issues/87563 1107 | https://github.com/rust-lang/rust/issues/87308 1108 | https://github.com/rust-lang/rust/issues/87219 1109 | https://github.com/rust-lang/rust/issues/87218 1110 | https://github.com/rust-lang/rust/issues/85871 1111 | https://github.com/rust-lang/rust/issues/85552 1112 | https://github.com/rust-lang/rust/issues/85480 1113 | https://github.com/rust-lang/rust/issues/83921 1114 | https://github.com/rust-lang/rust/issues/83190 1115 | https://github.com/rust-lang/rust/issues/83048 1116 | https://github.com/rust-lang/rust/issues/82678 1117 | https://github.com/rust-lang/rust/issues/82329 1118 | https://github.com/rust-lang/rust/issues/82328 1119 | https://github.com/rust-lang/rust/issues/82327 1120 | https://github.com/rust-lang/rust/issues/82326 1121 | https://github.com/rust-lang/rust/issues/82325 1122 | https://github.com/rust-lang/rust/issues/81627 1123 | https://github.com/rust-lang/rust/issues/81403 1124 | https://github.com/rust-lang/rust/issues/80589 1125 | https://github.com/rust-lang/rust/issues/80251 1126 | https://github.com/rust-lang/rust/issues/80231 1127 | https://github.com/rust-lang/rust/issues/80230 1128 | https://github.com/rust-lang/rust/issues/80229 1129 | https://github.com/rust-lang/rust/issues/80228 1130 | https://github.com/rust-lang/rust/issues/80060 1131 | https://github.com/rust-lang/rustfmt/issues/4587 1132 | https://github.com/rust-lang/rustfmt/issues/4586 1133 | https://github.com/rust-lang/rust/issues/79699 1134 | https://github.com/rust-lang/rust/issues/79669 1135 | https://github.com/rust-lang/rust/issues/79569 1136 | https://github.com/rust-lang/rust/issues/79566 1137 | https://github.com/rust-lang/rust/issues/79565 1138 | https://github.com/rust-lang/rust/issues/79497 1139 | https://github.com/rust-lang/rust/issues/79496 1140 | https://github.com/rust-lang/rust/issues/79495 1141 | https://github.com/rust-lang/rust/issues/79494 1142 | https://github.com/rust-lang/rust/issues/79468 1143 | https://github.com/rust-lang/rust/issues/79467 1144 | https://github.com/rust-lang/rust/issues/79466 1145 | https://github.com/rust-lang/rust/issues/79465 1146 | https://github.com/rust-lang/rust/issues/79461 1147 | https://github.com/rust-lang/rust/issues/79099 1148 | https://github.com/rust-lang/rust/issues/79066 1149 | https://github.com/rust-lang/rust/issues/78628 1150 | https://github.com/rust-lang/rust/issues/78560 1151 | https://github.com/rust-lang/rust/issues/78520 1152 | https://github.com/rust-lang/rust/issues/78510 1153 | https://github.com/rust-lang/rust/issues/78442 1154 | https://github.com/rust-lang/rust/issues/78441 1155 | https://github.com/rust-lang/rust/issues/78233 1156 | https://github.com/rust-lang/rust/issues/78180 1157 | https://github.com/rust-lang/rust/issues/77669 1158 | https://github.com/rust-lang/rust/issues/77668 1159 | https://github.com/rust-lang/rust/issues/75962 1160 | https://github.com/rust-lang/rust/issues/75507 1161 | https://github.com/rust-lang/rust/issues/75506 1162 | https://github.com/rust-lang/rust/issues/75053 1163 | https://github.com/rust-lang/rust/issues/75051 1164 | https://github.com/rust-lang/rust/issues/73860 1165 | https://github.com/rust-lang/rust/issues/74358 1166 | https://github.com/rust-lang/rust/issues/73260 1167 | https://github.com/rust-lang/rust/issues/73022 1168 | https://github.com/rust-lang/rust/issues/73021 1169 | https://github.com/rust-lang/rust/issues/73020 1170 | https://github.com/rust-lang/rust/issues/72960 1171 | https://github.com/rust-lang/rust/issues/72911 1172 | https://github.com/rust-lang/rust/issues/72679 1173 | https://github.com/rust-lang/rust/issues/72285 1174 | https://github.com/rust-lang/rust/issues/72181 1175 | https://github.com/rust-lang/rust/issues/72105 1176 | https://github.com/rust-lang/rust/issues/69875 1177 | https://github.com/rust-lang/rust/issues/69416 1178 | https://github.com/rust-lang/rust/issues/69415 1179 | https://github.com/rust-lang/rust/issues/69409 1180 | https://github.com/rust-lang/rust/issues/69414 1181 | https://github.com/rust-lang/rust/issues/69398 1182 | https://github.com/rust-lang/rust/issues/68750 1183 | https://github.com/rust-lang/rust/issues/68749 1184 | https://github.com/rust-lang/rust/issues/68296 1185 | https://github.com/rust-lang/rust/issues/67696 1186 | https://github.com/rust-lang/rust/issues/67641 1187 | https://github.com/rust-lang/rust/issues/67640 1188 | https://github.com/rust-lang/rust/issues/67639 1189 | https://github.com/rust-lang/rust/issues/67550 1190 | 1191 | #### License: 1192 | 1193 | Copyright 2020-2023 Matthias Krüger 1194 | 1195 | ```` 1196 | Licensed under the Apache License, Version 2.0 or the MIT license 1198 | , at your 1199 | option. All files in the project carrying such notice may not be 1200 | copied, modified, or distributed except according to those terms. 1201 | ```` 1202 | -------------------------------------------------------------------------------- /dummy.rs: -------------------------------------------------------------------------------- 1 | pub fn main() {} 2 | -------------------------------------------------------------------------------- /src/fuzz.rs: -------------------------------------------------------------------------------- 1 | use rand::prelude::IteratorRandom; 2 | 3 | static RANDOM_ITEMS: &[&str] = &[ 4 | " main ", 5 | "{ }", 6 | "}", 7 | " fn ", 8 | " impl ", 9 | " use ", 10 | "::", 11 | "#", 12 | "#r", 13 | "=", 14 | "\"", 15 | "<", 16 | ">", 17 | ",", 18 | "{", 19 | "}", 20 | " ", 21 | "\n", 22 | "(", 23 | ")", 24 | "[", 25 | "]", 26 | "?", 27 | " pub ", 28 | " let ", 29 | ";", 30 | " const ", 31 | " static ", 32 | "&", 33 | "#[test]", 34 | " unsafe ", 35 | // "fn add() -> () {} ", 36 | " -> ", 37 | "-> ()", //"fn bar()", 38 | " type ", 39 | " struct ", 40 | " return ", 41 | " macro_rules! ", 42 | " match ", 43 | " if let ", 44 | " while let ", 45 | " for ", 46 | " None ", 47 | " Some(_) ", 48 | " _ ", 49 | " && ", 50 | " || ", 51 | " == ", 52 | ".", 53 | "#[cfg]", 54 | " extern ", 55 | " async ", 56 | " .. ", 57 | "..= ", 58 | "=>", 59 | "();", 60 | "{};", 61 | "x = 3", 62 | " String::new() ", 63 | "1", 64 | "3", 65 | "0", 66 | ]; 67 | 68 | /* 69 | pub(crate) fn get_random_string() -> String { 70 | use rand::Rng; 71 | 72 | const MAX_ITEMS_PER_FILE: usize = 10; 73 | let mut rng = rand::thread_rng(); 74 | 75 | let identifier_limit = rng.gen_range(0..MAX_ITEMS_PER_FILE); 76 | 77 | let mut output = String::new(); 78 | 79 | // push $identifier_limit random thingys into the string; 80 | (1..identifier_limit) 81 | .for_each(|_| output.push_str(RANDOM_ITEMS.iter().choose(&mut rng).unwrap())); 82 | 83 | //println!("{}", output); 84 | output 85 | } 86 | 87 | */ 88 | 89 | pub(crate) fn get_random_string() -> String { 90 | dbg!(gen_random_main()) 91 | } 92 | 93 | /// get one random identifier 94 | fn r() -> &'static str { 95 | let mut rng = rand::thread_rng(); 96 | RANDOM_ITEMS.iter().choose(&mut rng).unwrap() 97 | } 98 | 99 | fn _gen_random_fn() -> String { 100 | format!( 101 | "pub fn fooo<{} , {}>(s: &String) -> () {{ todo!() }}\n", 102 | r(), 103 | r(), 104 | ) 105 | } 106 | 107 | /// generate a main with a binding to r() 108 | fn gen_random_main() -> String { 109 | format!( 110 | "pub fn main() {{ 111 | // let x = {}; \n 112 | let z = {}; 113 | 114 | }}", 115 | r(), 116 | tc() 117 | ) 118 | } 119 | 120 | static TYPES_SIMPLE: &[&str] = &[ 121 | "String::new()", 122 | "Vec::::new()", 123 | "std::path::PathBuf::from(\".\")", 124 | "u32", 125 | "i8", 126 | "f32", 127 | "&str", 128 | "usize", 129 | "None", 130 | "Option", 131 | ]; 132 | 133 | static TYPES_COMPLEXE: &[&str] = &[ 134 | "Vec::::new()", 135 | //"Option", 136 | //"Result", 137 | "Some(TY)", 138 | "Ok(TY)", 139 | "Err(TY)", 140 | "[TY]", 141 | ]; 142 | 143 | // get a simple type 144 | fn ts() -> &'static str { 145 | let mut rng = rand::thread_rng(); 146 | TYPES_SIMPLE.iter().choose(&mut rng).unwrap() 147 | } 148 | 149 | fn tc() -> String { 150 | let mut rng = rand::thread_rng(); 151 | let type_raw = TYPES_COMPLEXE.iter().choose(&mut rng).unwrap().to_string(); 152 | type_raw.replace("TY", ts()) 153 | } 154 | -------------------------------------------------------------------------------- /src/fuzz2/core.rs: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /src/fuzz2/function.rs: -------------------------------------------------------------------------------- 1 | use std::fmt; 2 | 3 | use rand::prelude::IteratorRandom; 4 | 5 | use crate::fuzz2::lifetime::*; 6 | use crate::fuzz2::misc::*; 7 | use crate::fuzz2::ty::*; 8 | 9 | // https://doc.rust-lang.org/reference/items/functions.html 10 | 11 | pub(crate) struct FunctionGenerator { 12 | id: usize, 13 | // keep a list of generated functions so we can reference them in other functions..? 14 | functions: Vec, 15 | } 16 | 17 | impl FunctionGenerator { 18 | pub(crate) fn new() -> Self { 19 | Self { 20 | id: 0, 21 | functions: Vec::new(), 22 | } 23 | } 24 | 25 | pub(crate) fn gen_fn(&mut self) -> Function { 26 | let possible_fn_keywords: &[FnQualifier] = &[ 27 | FnQualifier::FnConst, 28 | FnQualifier::FnAsync, 29 | FnQualifier::FnExtern, 30 | FnQualifier::FnUnsafe, 31 | FnQualifier::Other(String::from("foo")), 32 | ]; 33 | 34 | let tygen = TyGen::new(); 35 | //let mut rng = rand::thread_rng(); 36 | let ty = tygen.random_ty(); 37 | let function_id = format!("{:X?}", self.id); 38 | self.id += 1; 39 | 40 | const MAX_FN_ARGS: u32 = 100; 41 | 42 | let args_number = (0..MAX_FN_ARGS).choose(&mut rand::thread_rng()).unwrap(); 43 | let args = (0..args_number).map(|_argnr| format!("{}", tygen.random_ty())); 44 | 45 | let num_keywords = (0..=std::mem::variant_count::()) 46 | .choose(&mut rand::thread_rng()) 47 | .unwrap_or_default(); 48 | 49 | let keywords = (0..num_keywords) 50 | .filter_map(|_| possible_fn_keywords.iter().choose(&mut rand::thread_rng())) 51 | .cloned() 52 | .collect::>(); 53 | 54 | let fun = Function { 55 | keywords, 56 | lifetimes: vec![Lifetime::get_random(); /*number of lifetimes: */ 3], 57 | 58 | name: format!("fn_{function_id}"), 59 | return_ty: ty, 60 | args: args.collect::>(), 61 | // @FIXME 62 | body: "todo!()".into(), 63 | }; 64 | self.functions.push(fun.clone()); 65 | fun 66 | } 67 | } 68 | 69 | #[derive(Debug, Clone)] 70 | pub(crate) struct Function { 71 | /// such as const, async etc 72 | keywords: Vec, 73 | lifetimes: Vec, 74 | name: String, 75 | return_ty: Ty, 76 | args: Vec, 77 | body: String, 78 | } 79 | 80 | #[allow(unused)] 81 | #[derive(Debug, Clone)] 82 | pub(crate) struct FunctionArg { 83 | name: String, 84 | ty: Ty, 85 | lifetime: Lifetime, 86 | } 87 | 88 | impl Function { 89 | pub(crate) fn gen_call(&self) -> String { 90 | let name = &self.name; 91 | let args = self 92 | .args 93 | .iter() 94 | .map(|_x| "unimplemented!(), ") 95 | .collect::(); 96 | format!("{name}({args});") 97 | } 98 | } 99 | 100 | #[derive(Debug, Clone)] 101 | enum FnQualifier { 102 | FnConst, // const 103 | FnAsync, // async 104 | FnExtern, // extern 105 | FnUnsafe, // unsafe 106 | Other(String), // we can do custom stuff here 107 | } 108 | 109 | impl std::fmt::Display for FnQualifier { 110 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 111 | write!( 112 | f, 113 | "{}", 114 | match self { 115 | FnQualifier::FnConst => "const", 116 | FnQualifier::FnAsync => "async", 117 | FnQualifier::FnExtern => "extern", 118 | FnQualifier::FnUnsafe => "unsafe", 119 | FnQualifier::Other(kw) => kw, 120 | } 121 | ) 122 | } 123 | } 124 | 125 | impl std::fmt::Display for Function { 126 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 127 | let args_fmtd = self 128 | .args 129 | .iter() 130 | .enumerate() 131 | .map(|(i, arg_ty)| format!("arg_{i}: {arg_ty}, ")) 132 | .collect::(); 133 | let body = &self.body; 134 | let keywords = self 135 | .keywords 136 | .iter() 137 | .map(|kw| format!(" {kw} ")) 138 | .collect::(); 139 | 140 | if self.lifetimes.is_empty() { 141 | write!( 142 | f, 143 | "{keywords} fn {}({}) -> {} {{ {body} }}", 144 | &self.name, args_fmtd, self.return_ty 145 | ) 146 | } else { 147 | let lifetimes = self 148 | .lifetimes 149 | .iter() 150 | .map(|l| l.to_code()) 151 | .collect::>() 152 | .join(", "); 153 | write!( 154 | f, 155 | "{keywords} fn {}<{lifetimes}>({}) -> {} {{ {body} }}", 156 | &self.name, args_fmtd, self.return_ty 157 | ) 158 | } 159 | } 160 | } 161 | 162 | impl Code for Function { 163 | fn to_code(&self) -> String { 164 | self.to_string() 165 | } 166 | } 167 | -------------------------------------------------------------------------------- /src/fuzz2/fuzz2.rs: -------------------------------------------------------------------------------- 1 | use std::fs::File; 2 | use std::io::prelude::*; 3 | 4 | use crate::fuzz2::function::*; 5 | use crate::fuzz2::r#struct::StructGenerator; 6 | 7 | pub(crate) fn fuzz2main() { 8 | let mut fngen = FunctionGenerator::new(); 9 | 10 | let mut output = String::from("pub fn main() {"); 11 | 12 | const MAX_FNS: u32 = 10; 13 | // generate an arbitrary number of functions 14 | for _ in 0..MAX_FNS { 15 | let fun = fngen.gen_fn(); 16 | let fun_call = fun.gen_call(); 17 | eprintln!("{fun}\n{fun_call}"); 18 | 19 | output.push_str(&fun.to_string()); 20 | output.push('\n'); 21 | output.push_str(&fun_call.to_string()); 22 | output.push('\n'); 23 | } 24 | 25 | let mut structgen = StructGenerator::new(); 26 | const MAX_STRUCTS: u32 = 10; 27 | for _ in 0..MAX_STRUCTS { 28 | let strct = structgen.gen_struct(); 29 | output.push_str(&strct.to_string()); 30 | output.push('\n'); 31 | } 32 | 33 | output.push('}'); // fn main 34 | 35 | let mut file = File::create("out.rs").unwrap_or(File::open("out.rs").unwrap()); 36 | file.write_all(output.as_bytes()) 37 | .expect("failed to write to file"); 38 | } 39 | -------------------------------------------------------------------------------- /src/fuzz2/lifetime.rs: -------------------------------------------------------------------------------- 1 | use crate::fuzz2::misc::*; 2 | use rand::prelude::IteratorRandom; 3 | 4 | #[derive(Debug, Clone)] 5 | pub(crate) struct Lifetime(String); 6 | 7 | impl Code for Lifetime { 8 | fn to_code(&self) -> String { 9 | format!("'{}", self.0) 10 | } 11 | } 12 | 13 | // TODO make this more generic 14 | impl From for Lifetime { 15 | fn from(lifetime: String) -> Self { 16 | Self(lifetime) 17 | } 18 | } 19 | 20 | impl Lifetime { 21 | /// returns a random lifetime 22 | pub(crate) fn get_random() -> Self { 23 | static RANDOM_VALID: &[&str] = &["a", "b", "c", "d", "_", "&", 24 | "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "12a"]; 25 | 26 | RANDOM_VALID 27 | .iter() 28 | .map(|x| Lifetime::from(x.to_string())) 29 | .choose(&mut rand::thread_rng()) 30 | .unwrap() 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/fuzz2/misc.rs: -------------------------------------------------------------------------------- 1 | /// the item can be represented as code 2 | pub(crate) trait Code { 3 | fn to_code(&self) -> String; 4 | } 5 | 6 | #[allow(unused)] 7 | 8 | pub(crate) enum Vis { 9 | Pub, 10 | PubCrate, 11 | Private, 12 | } 13 | 14 | impl Vis { 15 | pub(crate) fn to_string(&self) -> String { 16 | match &self { 17 | Vis::Pub => "pub ", 18 | Vis::PubCrate => "pub(crate) ", 19 | Vis::Private => "", 20 | } 21 | .to_string() 22 | } 23 | } 24 | 25 | // FIXME 26 | impl std::fmt::Display for dyn Code { 27 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 28 | write!(f, "{}", self.to_code()) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/fuzz2/mod.rs: -------------------------------------------------------------------------------- 1 | pub(crate) mod core; 2 | pub(crate) mod function; 3 | pub(crate) mod fuzz2; 4 | pub(crate) mod lifetime; 5 | pub(crate) mod misc; 6 | pub(crate) mod r#struct; 7 | pub(crate) mod ty; 8 | -------------------------------------------------------------------------------- /src/fuzz2/struct.rs: -------------------------------------------------------------------------------- 1 | use crate::fuzz2::lifetime::*; 2 | use crate::fuzz2::misc::*; 3 | use crate::fuzz2::ty::*; 4 | 5 | #[allow(unused)] 6 | 7 | pub(crate) struct StructGenerator { 8 | // keep a list of generated functions so we can reference them in other functions..? 9 | structs: Vec, 10 | id: u32, 11 | } 12 | 13 | impl StructGenerator { 14 | pub(crate) fn new() -> Self { 15 | Self { 16 | id: 0, 17 | structs: Vec::new(), 18 | } 19 | } 20 | 21 | pub(crate) fn gen_struct(&mut self) -> Struct { 22 | let new = Struct::new(&format!("struct_{}", self.id)); 23 | self.id += 1; 24 | new 25 | } 26 | } 27 | 28 | #[allow(unused)] 29 | pub(crate) struct Struct { 30 | name: String, 31 | lifetimes: Vec, 32 | fields: Vec, 33 | vis: Vis, 34 | tuplestruct: bool, 35 | } 36 | 37 | impl Struct { 38 | /// adds a lifetime to the struct, but not a specific Field 39 | fn _push_lifetime(&mut self, lifetime: Lifetime) { 40 | self.lifetimes.push(lifetime); 41 | } 42 | 43 | fn new(name: &str) -> Self { 44 | let name = name.to_string(); 45 | let lifetime_1 = Lifetime::get_random(); 46 | let lifetime_2 = Lifetime::get_random(); 47 | 48 | let tygen = TyGen::new(); 49 | 50 | let field_1 = StructField::new( 51 | String::from("field1"), 52 | lifetime_1.clone(), 53 | tygen.random_ty(), 54 | Vis::Pub, 55 | ); 56 | 57 | let field_2 = StructField::new( 58 | String::from("field2"), 59 | lifetime_2.clone(), 60 | tygen.random_ty(), 61 | Vis::Pub, 62 | ); 63 | 64 | let structvis = Vis::Pub; 65 | 66 | Self { 67 | name, 68 | lifetimes: vec![lifetime_1, lifetime_2], 69 | fields: vec![field_1, field_2], 70 | vis: structvis, 71 | tuplestruct: false, 72 | } 73 | } 74 | } 75 | 76 | #[allow(unused)] 77 | 78 | pub(crate) struct StructField { 79 | name: String, 80 | lifetime: Lifetime, 81 | ty: Ty, 82 | vis: Vis, 83 | } 84 | 85 | impl StructField { 86 | fn new(name: String, lifetime: Lifetime, ty: Ty, vis: Vis) -> Self { 87 | StructField { 88 | name, 89 | lifetime, 90 | ty, 91 | vis, 92 | } 93 | } 94 | } 95 | 96 | impl std::fmt::Display for StructField { 97 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 98 | write!( 99 | f, 100 | " {} {}: {},", 101 | self.vis.to_string(), 102 | self.name, 103 | self.ty 104 | ) 105 | } 106 | } 107 | 108 | impl std::fmt::Display for Struct { 109 | fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { 110 | // @TODO handle tuplestruct ! 111 | 112 | write!( 113 | f, 114 | "{} struct {} {{ 115 | {} 116 | }} 117 | ", 118 | self.vis.to_string(), 119 | self.name, 120 | self.fields 121 | .iter() 122 | .map(|f| f.to_string()) 123 | .collect::>() 124 | .join("\n") 125 | ) 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /src/fuzz2/ty.rs: -------------------------------------------------------------------------------- 1 | use rand::prelude::IteratorRandom; 2 | use std::fmt; 3 | 4 | pub(crate) const TYPES: &[Ty] = &[ 5 | Ty::u8, 6 | Ty::u16, 7 | Ty::u32, 8 | Ty::u64, 9 | Ty::i8, 10 | Ty::i16, 11 | Ty::i32, 12 | Ty::i64, 13 | Ty::usize, 14 | Ty::isize, 15 | Ty::String, 16 | ]; 17 | 18 | #[allow(non_camel_case_types)] 19 | #[derive(Debug, Clone)] 20 | pub(crate) enum Ty { 21 | u8, 22 | u16, 23 | u32, 24 | u64, 25 | i8, 26 | i16, 27 | i32, 28 | i64, 29 | usize, 30 | isize, 31 | String, 32 | } 33 | 34 | impl std::fmt::Display for Ty { 35 | fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 36 | let x = match self { 37 | Self::u8 => "u8", 38 | Self::u16 => "u16", 39 | Self::u32 => "u32", 40 | Self::u64 => "u64", 41 | Self::i8 => "i8", 42 | Self::i16 => "i16", 43 | Self::i32 => "i32", 44 | Self::i64 => "i64", 45 | Self::usize => "usize", 46 | Self::isize => "isize", 47 | Self::String => "String", 48 | }; 49 | write!(f, "{x}") 50 | } 51 | } 52 | 53 | // get a random type 54 | pub(crate) struct TyGen {} 55 | impl TyGen { 56 | pub(crate) fn new() -> Self { 57 | TyGen {} 58 | } 59 | 60 | pub(crate) fn random_ty(&self) -> Ty { 61 | TYPES 62 | .iter() 63 | .choose(&mut rand::thread_rng()) 64 | .unwrap() 65 | .clone() 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/fuzz_tree_splicer.rs: -------------------------------------------------------------------------------- 1 | use std::collections::HashMap; 2 | use std::path::{Path, PathBuf}; 3 | use std::time::Instant; 4 | 5 | use rand::Rng; 6 | use tree_sitter::{Parser, Tree}; 7 | use tree_splicer::splice::{Config, Splicer}; 8 | 9 | pub(crate) const IN_CODE_FP_KEYWORDS: &[&str] = &[ 10 | "panicked at", 11 | "RUST_BACKTRACE=", 12 | "(core dumped)", 13 | "mir!", 14 | "#![no_core]", 15 | "#[rustc_symbol_name]", 16 | "break rust", 17 | "#[rustc_variance]", 18 | "qemu: uncaught target signal", 19 | "core_intrinsics", // feature(..) 20 | "platform_intrinsics", // feature(..) 21 | "::SIGSEGV", 22 | "SIGSEGV::", 23 | "span_delayed_bug_from_inside_query", 24 | "#[rustc_variance]", 25 | "rustc_layout_scalar_valid_range_end", // rustc attr 26 | "rustc_attrs", // [ ] 27 | "staged_api", // feature(..) 28 | "lang_items", // feature(..) 29 | "#[rustc_intrinsic]", 30 | ]; 31 | 32 | // read a file from a path and splice-fuzz it returning a set of String that we built from it 33 | // pub(crate) fn splice_file(hm: &HashMap, Tree)>) -> Vec { 34 | pub(crate) fn splice_file(path: &PathBuf) -> Vec { 35 | //dbg!(&path); 36 | let now = Instant::now(); 37 | 38 | let mut rng: rand::prelude::ThreadRng = rand::thread_rng(); 39 | 40 | const INTER_SPLICES_RANGE: std::ops::Range = 2..30; 41 | let random_inter_splices = rng.gen_range(INTER_SPLICES_RANGE); 42 | let random_seed = rng.gen::(); 43 | let pd = path.display(); 44 | 45 | eprintln!( 46 | "slice_file: random_inter_splices: '{random_inter_splices}', random_seed: '{random_seed}', path: {pd} " 47 | ); 48 | 49 | let tests = 500; 50 | let splicer_cfg: Config = Config { 51 | inter_splices: random_inter_splices, 52 | seed: random_seed, 53 | // tests: 500, // 10 54 | // 55 | chaos: 10, 56 | deletions: 5, 57 | node_types: tree_splicer::node_types::NodeTypes::new(tree_sitter_rust::NODE_TYPES).unwrap(), 58 | language: tree_sitter_rust::language(), 59 | max_size: 200_000, 60 | // do not reparse for now? 61 | reparse: 2000000, 62 | }; 63 | 64 | let file_content = std::fs::read_to_string(path) 65 | .unwrap_or_else(|_| panic!("splicer failed to read file {}", path.display())); 66 | // skip if its too long to avoid stack overflows somewhere 67 | // TODO use ignore_files_for_splicing() here 68 | if file_content.lines().count() > 1000 { 69 | return Vec::new(); 70 | } 71 | 72 | let mut parser = Parser::new(); 73 | parser.set_timeout_micros(10_000_000); 74 | // rust! 75 | parser.set_language(&tree_sitter_rust::language()).unwrap(); 76 | 77 | let tree = parser.parse(&file_content, None); 78 | 79 | let mut hm = HashMap::new(); 80 | hm.insert( 81 | path.display().to_string(), 82 | (file_content.into_bytes(), tree.unwrap()), 83 | ); 84 | if now.elapsed().as_secs() > 60 { 85 | eprintln!("'{}' needed more than 60 seconds", path.to_str().unwrap()); 86 | } 87 | // TODO just return Iterator here 88 | let max_tries = tests; 89 | Splicer::new(splicer_cfg, &hm) 90 | .enumerate() 91 | .map(|(i, f)| (i, String::from_utf8(f).unwrap_or_default())) 92 | .take_while(|(i, _)| i < &max_tries) 93 | // ignore files that are likely to trigger FPs 94 | .filter(|(_i, content)| { 95 | !IN_CODE_FP_KEYWORDS 96 | .iter() 97 | .any(|fp_keyword| content.contains(fp_keyword)) 98 | }) 99 | .map(|(_, x)| x) 100 | .take(tests) 101 | .collect::>() 102 | } 103 | 104 | // omni 105 | pub(crate) fn splice_file_from_set( 106 | path: &Path, 107 | hmap: &HashMap, Tree)>, 108 | ) -> Vec { 109 | let now = Instant::now(); 110 | 111 | let mut rng: rand::prelude::ThreadRng = rand::thread_rng(); 112 | 113 | const INTER_SPLICES_RANGE: std::ops::Range = 2..10; 114 | let random_inter_splices = rng.gen_range(INTER_SPLICES_RANGE); 115 | let random_seed = rng.gen::() as u64; 116 | 117 | eprintln!( 118 | "slice_file: random_inter_splices: '{random_inter_splices}', random_seed: '{random_seed}'" 119 | ); 120 | 121 | let tests = 30; 122 | let splicer_cfg: Config = Config { 123 | inter_splices: random_inter_splices, 124 | seed: random_seed, 125 | //tests: 30, // 10 126 | // 127 | chaos: 30, // % chance that a chaos mutation will occur 128 | deletions: 10, // 129 | node_types: tree_splicer::node_types::NodeTypes::new(tree_sitter_rust::NODE_TYPES).unwrap(), 130 | language: tree_sitter_rust::language(), 131 | max_size: 1048576, 132 | // do not reparse for now? 133 | reparse: 1048576, 134 | }; 135 | 136 | // it seems that with this approach, we no longer have the notion of "files", we just have one big set of input and are able to generate random ouputs from it 137 | 138 | /* 139 | let mut parser = Parser::new(); 140 | // rust! 141 | parser.set_language(tree_sitter_rust::language()).unwrap(); 142 | 143 | let file_content = std::fs::read_to_string(path) 144 | .expect(&format!("splicer failed to read file {}", path.display())); 145 | */ 146 | // let tree = parser.parse(&file_content, None); 147 | 148 | // TODO just return Iterator here 149 | 150 | if now.elapsed().as_secs() > 60 { 151 | eprintln!("'{}' needed more than 60 seconds", path.to_str().unwrap()); 152 | } 153 | 154 | let max_tries = tests; 155 | // TODO tree splicer sometimes just hangs. 156 | Splicer::new(splicer_cfg, hmap) 157 | .enumerate() 158 | .map(|(i, f)| (i, String::from_utf8(f).unwrap_or_default())) 159 | // ignore files that are likely to trigger FPs 160 | .take_while(|(i, _)| i < &max_tries) 161 | .filter(|(_i, content)| { 162 | //tries = dbg!(tries) + 1; 163 | !IN_CODE_FP_KEYWORDS 164 | .iter() 165 | .any(|fp_keyword| content.contains(fp_keyword)) 166 | }) 167 | .map(|(_, x)| x) 168 | .take(tests) 169 | .collect::>() 170 | } 171 | 172 | // such files will most likely just causes known crashes or hang the splicing 173 | pub(crate) fn ignore_file_for_splicing(file: &PathBuf) -> bool { 174 | const LINE_LIMIT: usize = 400; // was 1000 175 | 176 | let content = std::fs::read_to_string(file).unwrap_or_default(); 177 | let lines_count = content.lines().count(); 178 | 179 | lines_count > LINE_LIMIT 180 | || content.contains("no_core") 181 | || content.contains("lang_items") 182 | || content.contains("mir!(") 183 | || content.contains("break rust") 184 | || (content.contains("failure-status: 101") && content.contains("known-bug")) 185 | // if the file is in an "icemaker" dir, do not use it for fuzzing... 186 | || file.display().to_string().contains("icemaker") || content.lines().any(|line| line.chars().nth(1000).is_some()) 187 | } 188 | -------------------------------------------------------------------------------- /src/ice.rs: -------------------------------------------------------------------------------- 1 | use std::{io::Write, path::PathBuf}; 2 | 3 | use clap::Parser; 4 | use colored::Colorize; 5 | use lazy_static::lazy_static; 6 | use once_cell::sync::Lazy; 7 | use serde::{Deserialize, Serialize}; 8 | use tempdir::TempDir; 9 | 10 | use crate::{library::Args, reduce_ice_code_to_string, run_commands::prlimit_run_command}; 11 | 12 | // represents a crash that we found by running an `Executable` with a set of flags on a .rs file 13 | #[allow(clippy::upper_case_acronyms)] 14 | #[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] 15 | pub struct ICE { 16 | // what release channel did we crash on? 17 | pub regresses_on: Regression, 18 | // do we need any special features for that ICE? 19 | pub needs_feature: bool, 20 | // file that reproduces the ice 21 | pub file: PathBuf, 22 | // path to the rustc binary 23 | // executable: String, 24 | // args that are needed to crash rustc 25 | pub args: Vec, 26 | // part of the error message 27 | pub error_reason: String, 28 | // ice message 29 | pub ice_msg: String, 30 | // the full command that we used to reproduce the crash 31 | //cmd: String, 32 | pub executable: Executable, 33 | // query stack of the ice, if any 34 | pub query_stack: Vec, 35 | // what kind of ice is this? 36 | pub kind: ICEKind, 37 | } 38 | 39 | #[allow(clippy::upper_case_acronyms)] 40 | #[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] 41 | pub enum ICEKind { 42 | // something crashed 43 | Ice(Interestingness), 44 | // miri found undefined behaviour 45 | Ub(UbKind), 46 | // program didn't terminate in time 47 | Hang(u64), // time in seconds 48 | OOM, 49 | // clippy / rustc lint siggestions failed to apply 50 | RustFix, 51 | // [type error] in output 52 | TypeError, 53 | // double, ice while ice via -Ztreat-err-as-bug 54 | DoubleIce, 55 | // rustfmt failed to format the code 56 | RustfmtFailure, 57 | } 58 | 59 | impl Default for ICEKind { 60 | fn default() -> Self { 61 | Self::Ice(Interestingness::Interesting) 62 | } 63 | } 64 | 65 | #[derive(Debug, Default, Serialize, Deserialize, Clone, Copy, Eq, PartialEq)] 66 | pub enum Interestingness { 67 | VeryInteresting, 68 | #[default] 69 | Interesting, 70 | Boring, 71 | } 72 | 73 | #[derive(Debug, Default, Serialize, Deserialize, Clone, Eq, PartialEq)] 74 | pub enum UbKind { 75 | #[default] 76 | Interesting, 77 | Uninteresting, 78 | } 79 | 80 | // is this actually used? 81 | impl std::fmt::Display for ICE { 82 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> { 83 | write!( 84 | f, 85 | "'{:?} {} {}' ICEs on {}, {} with: {} / '{}'", 86 | self.executable, 87 | self.file.display(), 88 | self.args.join(" "), 89 | self.regresses_on, 90 | if self.needs_feature { 91 | "and uses features" 92 | } else { 93 | "without features!" 94 | }, 95 | self.error_reason, 96 | self.ice_msg, 97 | ) 98 | } 99 | } 100 | 101 | pub(crate) type ICEDisplay = String; 102 | 103 | impl ICE { 104 | // print a ICE to stdout or something 105 | pub(crate) fn to_printable(&self) -> ICEDisplay { 106 | let kind = match self.kind { 107 | ICEKind::Ice(Interestingness::VeryInteresting) => "ICE!".red(), 108 | ICEKind::Ice(Interestingness::Interesting) => "ICE".red(), 109 | ICEKind::Ice(Interestingness::Boring) => "ice".normal(), 110 | ICEKind::Ub(UbKind::Interesting) => "UB".green(), 111 | ICEKind::Ub(UbKind::Uninteresting) => "ub".normal(), 112 | ICEKind::Hang(_) => "HANG".blue(), 113 | ICEKind::OOM => "OOM".red(), 114 | ICEKind::RustFix => "RustFix".yellow(), 115 | ICEKind::TypeError => "TypeError".yellow(), 116 | ICEKind::DoubleIce => "DoubleICE".red(), 117 | ICEKind::RustfmtFailure => "Fmt".yellow(), 118 | }; 119 | 120 | let flags = self.args.join(" "); 121 | 122 | // HACK 123 | // also log the ICE to disk here since its probably most convenient at this place in time/code 124 | 125 | // @FIXME this is disabled because its not tempdir'd properly leading to disk trashing 126 | // let report: Report = self.clone().into_report(global_tempdir); 127 | // report.to_disk(); 128 | 129 | format!( 130 | "{kind}: {:?} {} '{flags}' '{}', '{}'", 131 | self.executable, 132 | self.file.display(), 133 | self.ice_msg.normal(), 134 | self.error_reason.normal() 135 | ) 136 | } 137 | } 138 | 139 | /* 140 | fn _run_treereduce(ice: &ICE) { 141 | let file = ice.file; 142 | let original_code = std::fs::read_to_strinaggregateg(&original_path).unwrap_or("".into()); 143 | let flags = self.args.clone().join(" "); 144 | let executable_bin = &self.executable.path(); 145 | let prl_output = prlimit_run_command(&mut cmd).expect("prlimit process failed"); 146 | } */ 147 | 148 | #[allow(unused)] 149 | #[derive(Debug, Clone)] 150 | pub(crate) struct Report { 151 | ice: ICE, 152 | data: String, 153 | } 154 | 155 | impl ICE { 156 | #[allow(unused)] 157 | pub(crate) fn into_report(self, global_tempdir_path: &PathBuf) -> Report { 158 | let ice = &self; 159 | 160 | let ice_oneliner = self.to_printable(); 161 | let mvce_string: String = reduce_ice_code_to_string(ice.clone(), global_tempdir_path); 162 | //dbg!(&mvce_string); 163 | 164 | let tempdir = 165 | TempDir::new_in(global_tempdir_path, "rustc_testrunner_tmpdir_reporting").unwrap(); 166 | let tempdir_path = tempdir.path().display(); 167 | 168 | let original_path = ice.file.clone(); 169 | let original_path = original_path.canonicalize().unwrap(); 170 | let original_path_display = original_path.display(); 171 | let original_code = std::fs::read_to_string(&original_path).unwrap_or("".into()); 172 | 173 | // when fetching the Executable output, run Executable against the mvce inseatead of the original file 174 | // need to save the mvce to disk for this; put it into the tempdir 175 | let mvce_file_path = tempdir.path().join("mvce.rs"); 176 | let mvce_display = mvce_file_path.display(); 177 | let mut mvce_file = std::fs::File::create(&mvce_file_path) 178 | .expect(&format!("failed to create mvce file '{mvce_display}'")); 179 | write!(mvce_file, "{}", mvce_string) 180 | .expect(&format!("failed to write mvce '{mvce_display}'")); 181 | 182 | // add feature flags into the mvce 183 | // filter and convert ""-Zcrate-attr=feature(x)" to "#![feature(x)]" 184 | let feature_flags = &ice 185 | .args 186 | .clone() 187 | .iter() 188 | .filter(|flag| flag.starts_with("-Zcrate-attr=feature(")) 189 | .map(|flag| flag.replace("-Zcrate-attr=", "")) 190 | .map(|feature| format!("#![{feature}]\n")) 191 | .collect::(); 192 | 193 | let flags = ice 194 | .args 195 | .clone() 196 | .into_iter() 197 | .filter(|flag| { 198 | !["-ooutputfile".to_string(), "-Zdump-mir-dir=dir".to_string()].contains(flag) 199 | }) 200 | .collect::>(); 201 | let flags = flags.join(" "); 202 | 203 | //let executable = &self.executable.clone(); 204 | let executable_bin = &ice.executable.path(); 205 | let mut cmd = std::process::Command::new(executable_bin); 206 | cmd.args(&ice.args); 207 | cmd.arg(&mvce_file_path); 208 | cmd.current_dir(tempdir_path.to_string()); 209 | 210 | let prl_output = prlimit_run_command(&mut cmd).expect("prlimit process failed"); 211 | // let output_stderr = String::from_utf8(prl_output.stdout).unwrap(); 212 | let output_stdout = String::from_utf8(prl_output.stderr).unwrap(); 213 | 214 | let query_stack = output_stdout 215 | .lines() 216 | .filter(|line| line.starts_with('#') && line.contains(" [") || line.contains("] ")) 217 | .map(|l| format!("{l}\n")) 218 | .collect::(); 219 | 220 | /* 221 | // TODO: bail in case of exceutable != rustc || exectuable == local debug assertions 222 | let mut bisection = std::process::Command::new("cargo-bisect-rustc"); 223 | bisection 224 | .arg("--preserve") 225 | .arg(format!("--test-dir={tempdir_path}")) 226 | .args(["--regress", "ice"]) 227 | .args([ 228 | "--script=prlimit", 229 | "--", 230 | "--noheadings", 231 | &format!("--as={}", 3076_u32 * 1000_u32 * 1000_u32), 232 | &format!("--cpu={}", 30), 233 | ]) 234 | // rustc run by prlimit: 235 | .arg("rustc") 236 | .arg(&mvce_file_path) 237 | // does this cause problems? 238 | .current_dir(tempdir_path.to_string()); 239 | dbg!(&bisection); 240 | 241 | let bisection_output = bisection.output(); 242 | dbg!(bisection_output); 243 | */ 244 | 245 | let version_output: String = if let Ok(output) = std::process::Command::new(executable_bin) 246 | .arg("--version") 247 | .arg("--verbose") 248 | .output() 249 | { 250 | String::from_utf8(output.stdout).unwrap() 251 | } else if let Ok(output_verbose) = std::process::Command::new(executable_bin) 252 | .arg("--version") 253 | .output() 254 | { 255 | String::from_utf8(output_verbose.stdout).unwrap() 256 | } else { 257 | "".to_string() 258 | }; 259 | 260 | // if we failed to reduce the originl code, don't print original and snippet 261 | let snippet = if mvce_string == original_code { 262 | format!( 263 | "snippet: 264 | ````rust 265 | {original_code} 266 | {feature_flags} 267 | ````" 268 | ) 269 | // if we have a very long original snippet. collapse it 270 | } else if original_code.len() > 999 { 271 | format!( 272 | "auto-reduced (treereduce-rust): 273 | ````rust 274 | {mvce_string} 275 | {feature_flags} 276 | ```` 277 | 278 |
original code 279 |

280 | 281 | original: 282 | ````rust 283 | {original_code} 284 | ```` 285 |

286 |
" 287 | ) 288 | } else { 289 | format!( 290 | "auto-reduced (treereduce-rust): 291 | ````rust 292 | {mvce_string} 293 | {feature_flags} 294 | ```` 295 | 296 | original: 297 | ````rust 298 | {original_code} 299 | ````" 300 | ) 301 | }; 302 | 303 | let data = format!( 304 | " 308 | 309 | {snippet} 310 | 311 | Version information 312 | ```` 313 | {version_output} 314 | ```` 315 | 316 | Command: 317 | `{executable_bin} {flags}` 318 | 319 | 323 |
Program output 324 |

325 | 326 | ``` 327 | {output_stdout} 328 | ``` 329 | 330 |

331 |
332 | 333 | 337 | 338 | " 339 | ); 340 | 341 | Report { 342 | ice: ice.clone(), 343 | data, 344 | } 345 | } 346 | } 347 | 348 | pub(crate) static REPORTS_DIR: Lazy = Lazy::new(|| { 349 | let system_temp_dir = std::env::temp_dir(); 350 | let reports_dir = system_temp_dir.join("icemaker_reports"); 351 | // ':' in paths may not work under windows, yolo! 352 | let date = chrono::offset::Local::now() 353 | .format("%Y-%m-%d_%H-%M-%S") 354 | .to_string(); 355 | reports_dir.join(date) 356 | }); 357 | 358 | #[allow(unused)] 359 | impl Report { 360 | pub(crate) fn _print(&self) { 361 | println!("{}", self.data); 362 | } 363 | 364 | // save a report into /tmp/ for inspection while icemaker is still running 365 | pub(crate) fn to_disk(&self) { 366 | // only write ices and ub to disk for now 367 | if let ICEKind::Ice(..) | ICEKind::Ub(..) | ICEKind::DoubleIce = self.ice.kind { 368 | // we want these 369 | /* 370 | eprintln!("reported!"); 371 | eprint!("{}", self.data); 372 | */ 373 | } else { 374 | return; 375 | } 376 | 377 | // should just print Rustc, Miri, Clippy etc... 378 | // we need to append this so that if the miri and rustdoc crash on the file, we don't overwrite previous results :/ 379 | let executable = format!("{:?}", self.ice.executable); 380 | 381 | let reports_dir = REPORTS_DIR.to_owned(); 382 | if !PathBuf::from(&reports_dir).exists() { 383 | std::fs::create_dir_all(&reports_dir).expect("failed to create icemaker reports dir!"); 384 | } 385 | 386 | let display = self 387 | .ice 388 | .file 389 | .file_name() 390 | .unwrap_or_default() 391 | .to_str() 392 | .unwrap_or_default() 393 | .to_string(); 394 | let mut file_on_disk = display.to_string().replace(['/', '\\'], "_"); 395 | file_on_disk.push('_'); 396 | file_on_disk.push_str(&executable); 397 | let mut file_on_disk = file_on_disk.replace(".rs", ""); 398 | file_on_disk.push_str(".md"); 399 | 400 | let report_file_path = reports_dir.join(file_on_disk); 401 | 402 | dbg!(&report_file_path); 403 | eprintln!(); 404 | 405 | // FIXME file might already exist 406 | let mut file = std::fs::File::create(report_file_path) 407 | .expect("report.to_disk() failed to create file"); 408 | file.write_all(self.data.as_bytes()) 409 | .expect("failed to write report"); 410 | } 411 | } 412 | 413 | // in what channel a regression is first noticed? 414 | #[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq)] 415 | pub enum Regression { 416 | Stable, 417 | Beta, 418 | Nightly, 419 | Master, 420 | } 421 | 422 | // ice is reproducible on: 423 | #[allow(non_snake_case, unused)] 424 | pub struct RegressionDetailed { 425 | Stable: bool, 426 | Beta: bool, 427 | Nightly: bool, 428 | Master: bool, 429 | LocalDebugAssertions: bool, 430 | } 431 | 432 | lazy_static! { 433 | pub(crate) static ref RUSTUP_HOME: PathBuf = 434 | home::rustup_home().expect("could not find rustup home"); 435 | } 436 | 437 | impl std::fmt::Display for Regression { 438 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> { 439 | let s = match self { 440 | Regression::Stable => "stable", 441 | Regression::Beta => "beta", 442 | Regression::Nightly => "nightly", 443 | Regression::Master => "master", 444 | }; 445 | 446 | write!(f, "{s}") 447 | } 448 | } 449 | 450 | #[derive(Debug, Serialize, Deserialize, Clone, Eq, PartialEq, Hash)] 451 | pub enum Executable { 452 | Rustc, 453 | Clippy, 454 | Rustdoc, 455 | RustAnalyzer, 456 | Rustfmt, 457 | Miri, 458 | // extra: 459 | // icemaker --local-debug-assertions --cranelift-local --expensive-flags 460 | Cranelift, 461 | ClippyFix, 462 | RustFix, 463 | Kani, 464 | // https://github.com/rust-lang/rustc_codegen_gcc 465 | RustcCodegenGCC, 466 | // https://github.com/rust-marker/marker 467 | Marker, 468 | } 469 | 470 | static LOCAL_DEBUG_ASSERTIONS: Lazy = Lazy::new(|| Args::parse().local_debug_assertions); 471 | 472 | impl Executable { 473 | pub fn path(&self) -> String { 474 | match self { 475 | Executable::Rustc => { 476 | let mut p = home::rustup_home().unwrap(); 477 | p.push("toolchains"); 478 | p.push(if *LOCAL_DEBUG_ASSERTIONS { 479 | "local-debug-assertions" 480 | } else { 481 | "master" 482 | }); 483 | p.push("bin"); 484 | p.push("rustc"); 485 | p.display().to_string() 486 | } 487 | Executable::Clippy => { 488 | let mut p = home::rustup_home().unwrap(); 489 | p.push("toolchains"); 490 | p.push(if *LOCAL_DEBUG_ASSERTIONS { 491 | "local-debug-assertions" 492 | } else { 493 | "master" 494 | }); 495 | p.push("bin"); 496 | p.push("clippy-driver"); 497 | p.display().to_string() 498 | } 499 | Executable::ClippyFix => { 500 | let mut p = home::rustup_home().unwrap(); 501 | p.push("toolchains"); 502 | p.push(if *LOCAL_DEBUG_ASSERTIONS { 503 | "local-debug-assertions" 504 | } else { 505 | "master" 506 | }); 507 | p.push("bin"); 508 | p.push("clippy-driver"); 509 | p.display().to_string() 510 | } 511 | 512 | Executable::RustFix => { 513 | let mut p = home::rustup_home().unwrap(); 514 | p.push("toolchains"); 515 | p.push(if *LOCAL_DEBUG_ASSERTIONS { 516 | "local-debug-assertions" 517 | } else { 518 | "master" 519 | }); 520 | p.push("bin"); 521 | p.push("rustc"); 522 | p.display().to_string() 523 | } 524 | Executable::Rustdoc => { 525 | let mut p = home::rustup_home().unwrap(); 526 | p.push("toolchains"); 527 | p.push(if *LOCAL_DEBUG_ASSERTIONS { 528 | "local-debug-assertions" 529 | } else { 530 | "master" 531 | }); 532 | p.push("bin"); 533 | p.push("rustdoc"); 534 | p.display().to_string() 535 | } 536 | Executable::RustAnalyzer => { 537 | let mut p = home::rustup_home().unwrap(); 538 | p.push("toolchains"); 539 | p.push("master"); 540 | p.push("bin"); 541 | p.push("rust-analyzer"); 542 | p.display().to_string() 543 | } 544 | Executable::Rustfmt => { 545 | let mut p = home::rustup_home().unwrap(); 546 | p.push("toolchains"); 547 | p.push(if *LOCAL_DEBUG_ASSERTIONS { 548 | "local-debug-assertions" 549 | } else { 550 | "master" 551 | }); 552 | p.push("bin"); 553 | p.push("rustfmt"); 554 | p.display().to_string() 555 | } 556 | Executable::Miri => { 557 | // note: this is actually not what we run in the end, we need to run "cargo miri test" 558 | let mut p = home::rustup_home().unwrap(); 559 | p.push("toolchains"); 560 | p.push("x86_64-unknown-linux-gnu"); 561 | p.push("bin"); 562 | p.push("miri"); 563 | p.display().to_string() 564 | } 565 | 566 | Executable::Cranelift => { 567 | String::from("~/.rustup/toolchains/local-debug-assertions/bin/rustc") 568 | } 569 | Executable::Kani => "kani".into(), 570 | // env vars + -Zcodegen-backend= to the rest of the stuff, similar to cranelift 571 | Executable::RustcCodegenGCC => "rustc".into(), 572 | Executable::Marker => String::from("marker"), 573 | } 574 | } 575 | } 576 | 577 | #[cfg(test)] 578 | mod tests { 579 | use crate::ice::Executable; 580 | 581 | #[test] 582 | fn exec_rustc() { 583 | let ex = &Executable::Rustc.path(); 584 | assert!(ex.contains("rustc")); 585 | assert!(ex.contains("master")); 586 | } 587 | 588 | #[test] 589 | fn exec_clippy() { 590 | let ex = &Executable::Clippy.path(); 591 | assert!(ex.contains("master")); 592 | assert!(ex.contains("clippy-driver")); 593 | } 594 | 595 | #[test] 596 | fn exec_clippyfix() { 597 | assert_eq!(Executable::Clippy.path(), Executable::ClippyFix.path()) 598 | } 599 | 600 | #[test] 601 | fn exec_rustdoc() { 602 | let ex = &Executable::Rustdoc.path(); 603 | assert!(ex.contains("master")); 604 | assert!(ex.contains("rustdoc")); 605 | } 606 | 607 | #[test] 608 | fn exec_analyzer() { 609 | let ex = &Executable::RustAnalyzer.path(); 610 | assert!(ex.contains("master")); 611 | assert!(ex.contains("rust-analyzer")); 612 | } 613 | 614 | #[test] 615 | fn exec_rustfmt() { 616 | let ex = &Executable::Rustfmt.path(); 617 | assert!(ex.contains("master")); 618 | assert!(ex.contains("rustfmt")); 619 | } 620 | 621 | #[test] 622 | fn exec_miri() { 623 | let ex = &Executable::Miri.path(); 624 | // not master toolchain, but nightly 625 | assert!(ex.contains("miri")); 626 | } 627 | } 628 | -------------------------------------------------------------------------------- /src/library.rs: -------------------------------------------------------------------------------- 1 | use std::io; 2 | 3 | use clap::Parser; 4 | use itertools::Itertools; 5 | 6 | #[derive(Parser, Debug)] 7 | #[clap(author, version, about, long_about = None)] 8 | pub(crate) struct Args { 9 | #[clap(short, short = 'c', long)] 10 | pub(crate) clippy: bool, 11 | 12 | #[clap(long = "cf", long = "clippy-fix")] 13 | pub(crate) clippy_fix: bool, 14 | 15 | #[clap(long = "rf", long = "rust-fix")] 16 | pub(crate) rust_fix: bool, 17 | 18 | #[clap(short = 'd', long)] 19 | pub(crate) rustdoc: bool, 20 | 21 | #[clap(short, long)] 22 | pub(crate) analyzer: bool, // rla 23 | 24 | #[clap(long)] 25 | pub(crate) rustfmt: bool, 26 | 27 | #[clap(short, long)] 28 | pub(crate) silent: bool, 29 | 30 | #[clap(short = 'H', long)] 31 | pub(crate) heat: bool, // spaceheater mode, try to catch ICEs from random codeu 32 | 33 | #[clap(short, long)] 34 | pub(crate) miri: bool, 35 | 36 | #[clap(long)] 37 | pub(crate) codegen: bool, 38 | 39 | #[clap(short, long)] 40 | pub(crate) incremental_test: bool, 41 | 42 | #[clap(long)] 43 | pub(crate) fuzz: bool, 44 | 45 | #[clap(long)] 46 | pub(crate) fuzz2: bool, 47 | 48 | #[clap(short, long)] 49 | pub(crate) rustc: bool, 50 | 51 | #[clap(long)] 52 | pub(crate) cranelift: bool, 53 | 54 | #[clap(long)] 55 | pub(crate) expensive_flags: bool, 56 | 57 | #[clap(long)] 58 | pub(crate) kani: bool, 59 | 60 | #[clap(long)] 61 | pub(crate) rustc_codegen_gcc: bool, 62 | 63 | // use path to local rustc build with debug assertions 64 | #[clap(long)] 65 | pub(crate) local_debug_assertions: bool, 66 | 67 | #[clap(short = 'j', long = "jobs", long = "threads", default_value_t = 0)] 68 | pub(crate) threads: usize, 69 | 70 | #[clap(long = "order", long = "chain-order", default_value_t = 4)] 71 | pub(crate) chain_order: usize, 72 | 73 | #[clap(long = "projects", num_args = 1..)] 74 | pub(crate) projects: Vec, 75 | 76 | #[clap(long)] 77 | pub(crate) smolfuzz: bool, 78 | 79 | #[clap(long)] 80 | pub(crate) codegen_splice: bool, 81 | 82 | #[clap(long)] 83 | pub(crate) codegen_splice_omni: bool, 84 | 85 | #[clap(long)] 86 | pub(crate) incr_fuzz: bool, 87 | 88 | #[clap(long)] 89 | pub(crate) global_tempdir_path: Option, 90 | 91 | // read ice json and reduce, bisect, gen report? 92 | #[clap(long)] 93 | pub(crate) reduce: bool, 94 | // skip report generation to avoid running into OOMS or disk issues etc 95 | #[clap(long)] 96 | pub(crate) skip_report: bool, 97 | 98 | #[clap(long)] 99 | pub(crate) marker: bool, 100 | } 101 | 102 | /// check whether a file uses features or not 103 | pub fn uses_feature(file: &std::path::Path) -> bool { 104 | match std::fs::read_to_string(file) { 105 | Ok(file) => file.contains("feature("), 106 | _ => { 107 | eprintln!("Failed to read '{}'", file.display()); 108 | false 109 | } 110 | } 111 | } 112 | 113 | pub fn file_has_main(file: &dyn AsRef) -> bool { 114 | use std::io::BufRead; 115 | 116 | match std::fs::File::open(file) { 117 | Ok(file) => io::BufReader::new(file) 118 | .lines() 119 | .any(|line| line.unwrap_or_default().contains("fn main(")), 120 | Err(_) => false, 121 | } 122 | } 123 | 124 | pub fn _get_flag_combination<'a, 'b>(flags: &'a [&'b str]) -> Vec> { 125 | // get the power set : [a, b, c] => [a], [b], [c], [a,b], [a,c], [b,c], [a,b,c] 126 | 127 | // optimization: only check the first 5000 combinations to avoid OOM, usually that is good enough... 128 | let combs: Vec> = (0..=flags.len()) 129 | .flat_map(|numb_comb| flags.iter().combinations(numb_comb).take(10000)) 130 | // when bisecting flag combinations, only keep sets smaller than 11 131 | // it is unlikely that we need the entire set of a set of flags to reproduce an ice 132 | .filter(|v| v.len() <= 10) 133 | .collect(); 134 | 135 | // UPDATE: special cased in par_iter loop 136 | // add an empty "" flag so start with, in case an ice does not require any flags 137 | // let mut tmp = vec![vec![String::new()]]; 138 | // tmp.extend(combs); 139 | let mut tmp = combs; 140 | //dbg!(&x); 141 | 142 | // we may have a lot of Zmiroptlvl1 .. 2 .. 3 , 1, 3 .. 1, 4 .. combinations, dedupe these to only keep the last one 143 | 144 | let tmp2 = tmp.iter_mut().map(|vec| { 145 | // reverse 146 | let vec_reversed: Vec<&&str> = { 147 | let mut v = vec.clone(); 148 | v.reverse(); 149 | v 150 | }; 151 | 152 | // have we seen a mir-opt-level already? 153 | let mut seen: bool = false; 154 | 155 | // check the reversed vec for the first -Zmir and skip all other -Zmirs afterwards 156 | let vtemp: Vec<&&str> = vec_reversed 157 | .into_iter() 158 | .filter(|flag| { 159 | let cond = seen && flag.contains("-Zmir-opt-level"); 160 | if flag.contains("-Zmir-opt-level") { 161 | seen = true; 162 | } 163 | !cond 164 | }) 165 | .collect(); 166 | 167 | // now reverse again, so in the end we only kept the last -Zmir-opt-level 168 | let mut vfinal: Vec<&&str> = vtemp; 169 | vfinal.reverse(); 170 | vfinal 171 | }); 172 | 173 | let mut tmp2 = tmp2.collect::>>(); 174 | tmp2.sort(); 175 | // remove duplicates that occurred due to removed mir opt levels 176 | tmp2.dedup(); 177 | //finally, sort by length 178 | tmp2.sort_by_key(|x| x.len()); 179 | 180 | // we cant assert here when we remove redundant opt levels :/ 181 | // debug_assert_eq!(tmp2.iter().last().unwrap(), flags); 182 | 183 | tmp2 184 | } 185 | -------------------------------------------------------------------------------- /src/printing.rs: -------------------------------------------------------------------------------- 1 | use std::io::Write; 2 | use std::sync::RwLock; 3 | 4 | use crate::ice::*; 5 | 6 | #[derive(Eq, PartialEq, Debug, Clone)] 7 | pub(crate) enum PrintMessage { 8 | Progress { 9 | index: usize, 10 | total_number_of_files: usize, 11 | file_name: String, 12 | }, 13 | IceFound { 14 | ice: ICEDisplay, 15 | }, 16 | } 17 | 18 | pub(crate) struct Printer { 19 | prev: RwLock, 20 | logged_messages: RwLock>, 21 | } 22 | 23 | impl Printer { 24 | pub(crate) fn log(&self, new: PrintMessage) { 25 | let prev = self.prev.read().unwrap().clone(); 26 | 27 | if new == prev { 28 | // no new message, nothing to update 29 | return; 30 | } 31 | 32 | if let PrintMessage::IceFound { ref ice } = new { 33 | if self.logged_messages.read().unwrap().contains(ice) { 34 | // do not log duplicate ICEs 35 | return; 36 | } 37 | } 38 | 39 | match (prev, &new) { 40 | // displays "%perc Checking $file ..." 41 | ( 42 | PrintMessage::Progress { .. }, 43 | PrintMessage::Progress { 44 | index, 45 | total_number_of_files, 46 | file_name, 47 | }, 48 | ) => { 49 | let perc = ((index * 100) as f32 / *total_number_of_files as f32) as u8; 50 | 51 | // do not print a newline so we can (\r-eturn carry) our next status update to the same line, requires flushing though 52 | // we actually need to print a number of space at the end to "clear" remains of previous lines if previous filename was much longer 53 | print!("\r[{index}/{total_number_of_files} {perc}%] Checking {file_name: <150}",); 54 | let _stdout = std::io::stdout().flush(); 55 | // kinda ignore whether this fails or not 56 | } 57 | (PrintMessage::IceFound { .. }, PrintMessage::IceFound { ref ice }) => { 58 | println!("{ice}"); 59 | } 60 | (PrintMessage::Progress { .. }, PrintMessage::IceFound { ref ice }) => { 61 | println!("\r{ice}"); 62 | } 63 | ( 64 | PrintMessage::IceFound { .. }, 65 | PrintMessage::Progress { 66 | index, 67 | total_number_of_files, 68 | file_name, 69 | }, 70 | ) => { 71 | // let _stdout = std::io::stdout().flush(); 72 | 73 | let perc = ((index * 100) as f32 / *total_number_of_files as f32) as u8; 74 | 75 | // do not print a newline so we can (\r-eturn carry) our next status update to the same line, requires flushing though 76 | // we actually need to print a number of space at the end to "clear" remains of previous lines if previous filename was much longer 77 | print!("[{index}/{total_number_of_files} {perc}%] Checking {file_name: <150}",); 78 | let _stdout = std::io::stdout().flush(); 79 | } 80 | } 81 | 82 | if let PrintMessage::IceFound { ref ice } = new { 83 | for wait_dur in 10..=500 { 84 | if let Ok(mut w) = self.logged_messages.try_write() { 85 | w.push(ice.clone()); 86 | break; 87 | } else { 88 | let wait = wait_dur * 10; 89 | // eprintln!("failed to acquire rwlock, waiting {wait}ms until retry"); 90 | std::thread::sleep(std::time::Duration::from_millis(wait)); 91 | } 92 | } 93 | } 94 | 95 | // if we can't acquire the lock right away, wait 10 ms and retry. Try up to 10 times 96 | for wait_dur in 10..=500 { 97 | match self.prev.try_write() { 98 | Ok(mut w) => { 99 | *w = new; 100 | break; 101 | } 102 | // failed to acquire lock, wait 10 ms and retry 103 | _ => { 104 | let wait = wait_dur * 10; 105 | // eprintln!("failed to acquire rwlock, waiting {wait}ms until retry"); 106 | std::thread::sleep(std::time::Duration::from_millis(wait)); 107 | } 108 | } 109 | } 110 | } 111 | 112 | pub(crate) const fn new() -> Self { 113 | Printer { 114 | prev: RwLock::new(PrintMessage::Progress { 115 | index: 0, 116 | total_number_of_files: 0, 117 | file_name: String::new(), 118 | }), 119 | logged_messages: RwLock::new(Vec::new()), 120 | } 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /src/run_commands.rs: -------------------------------------------------------------------------------- 1 | use std::ffi::OsString; 2 | use std::io::Write; 3 | use std::path::{Path, PathBuf}; 4 | use std::process::{Command, Output, Stdio}; 5 | 6 | use lazy_static::lazy_static; 7 | use once_cell::sync::Lazy; 8 | use regex::Regex; 9 | 10 | use clap::Parser; 11 | use tempdir::TempDir; 12 | 13 | use crate::ice::Executable; 14 | use crate::library::{file_has_main, Args}; 15 | use crate::{find_ICE_string, flags}; 16 | 17 | lazy_static! { 18 | static ref HOME_DIR: PathBuf = home::home_dir().unwrap(); 19 | } 20 | 21 | static LOCAL_DEBUG_ASSERTIONS: Lazy = Lazy::new(|| Args::parse().local_debug_assertions); 22 | 23 | static EXPENSIVE_FLAGS_ACTIVE: Lazy = Lazy::new(|| Args::parse().expensive_flags); 24 | 25 | static SYSROOT_PATH: Lazy = Lazy::new(|| { 26 | format!( 27 | "{}", 28 | HOME_DIR 29 | .join(format!( 30 | ".rustup/toolchains/{}/", 31 | if *LOCAL_DEBUG_ASSERTIONS { 32 | "local-debug-assertions" 33 | } else { 34 | "master" 35 | } 36 | )) 37 | .display() 38 | ) 39 | }); 40 | 41 | pub(crate) const PROCESS_TIMEOUT_S: u8 = 30; 42 | pub(crate) const PROCESS_TIMEOUT_MIRI_S: u8 = 20; 43 | 44 | #[allow(unused)] 45 | #[derive(Clone, Debug)] 46 | pub(crate) struct CommandOutput { 47 | output: std::process::Output, 48 | cmd_string: String, 49 | // flags executed by the $Executable that hit the ICE 50 | flags: Vec, 51 | exec: crate::Executable, 52 | } 53 | 54 | impl CommandOutput { 55 | pub(crate) fn unwrap(self) -> (std::process::Output, String, Vec) { 56 | (self.output, self.cmd_string, self.flags) 57 | } 58 | 59 | fn new( 60 | output: std::process::Output, 61 | cmd_string: String, 62 | flags: Vec, 63 | exec: crate::Executable, 64 | ) -> Self { 65 | Self { 66 | output, 67 | cmd_string, 68 | flags, 69 | exec, 70 | } 71 | } 72 | } 73 | 74 | /// get a process::Command as String 75 | fn get_cmd_string(cmd: &std::process::Command) -> String { 76 | let envs: String = cmd 77 | .get_envs() 78 | .filter(|(_, y)| y.is_some()) 79 | .map(|(x, y)| format!("{}={}", x.to_string_lossy(), y.unwrap().to_string_lossy())) 80 | .collect::>() 81 | .join(" "); 82 | let command = format!("{cmd:?}"); 83 | format!("\"{envs}\" {command}").replace('"', "") 84 | } 85 | 86 | pub(crate) fn run_rustc( 87 | executable: &str, 88 | file: &Path, 89 | incremental: bool, 90 | rustc_flags: &[&str], 91 | global_tempdir_path: &PathBuf, 92 | ) -> CommandOutput { 93 | if incremental { 94 | // only run incremental compilation tests 95 | return run_rustc_incremental(executable, file, global_tempdir_path); 96 | } 97 | // if the file contains no "main", run with "--crate-type lib" 98 | let file_as_text = std::fs::read_to_string(file).unwrap_or_default(); 99 | let has_main = file_has_main(&file); 100 | 101 | let tempdir = TempDir::new_in(global_tempdir_path, "rustc_testrunner_tmpdir").unwrap(); 102 | let tempdir_path = tempdir.path().display(); 103 | 104 | // decide whether we want rustc to do codegen (slow!) or not 105 | let output_file = if *EXPENSIVE_FLAGS_ACTIVE || rustc_flags.contains(&"-ocodegen") { 106 | // do codegen 107 | Some(format!("-o{tempdir_path}/outfile")) 108 | } else { 109 | Some("-Zno-codegen".into()) 110 | }; 111 | 112 | // we need to remove the original -o flag from the rustflags because rustc will not accept two -o's 113 | let rustc_flags = rustc_flags.iter().filter(|flag| **flag != "-ocodegen"); 114 | // if a file has #![feature(foo)] and we pass "-Zcrate-attr=feature(foo)" in addition to that, that may cause an error 115 | let regex = Regex::new(r"\[feature\(.*\)\]").unwrap(); 116 | // extract all the used feature gates 117 | let features_enabled_in_file = regex 118 | .find_iter(&file_as_text) 119 | .map(|x| x.as_str()) 120 | .map(|s| s.strip_prefix("[feature(").unwrap_or(s)) 121 | .map(|s| s.strip_suffix(")]").unwrap_or(s)) 122 | .flat_map(|s| s.split(',')) 123 | .filter(|s| !s.is_empty()) 124 | // remove surrounding whitespaces etc 125 | .map(|s| s.trim()) 126 | .map(|s| s.trim_matches(|c| ['(', ')', '[', ']'].contains(&c))) 127 | .collect::>(); 128 | 129 | // if a rustc flag specifies a feature that is already contained in the file, skip the rustc flag to avoid duplicate features: 130 | let rustc_flags = rustc_flags 131 | .filter(|flag| { 132 | // no feature flag, keep 133 | !flag.contains("-Zcrate-attr=feature(") 134 | || 135 | // feature flag, only keep if not specified in file already 136 | flag.contains("-Zcrate-attr=feature(") 137 | && !features_enabled_in_file 138 | .iter() 139 | .any(|fif| flag.contains(fif)) 140 | }) 141 | .copied(); 142 | 143 | let dump_mir_dir = format!("-Zdump-mir-dir={tempdir_path}"); 144 | 145 | let mut cmd = Command::new(executable); 146 | cmd.arg(file) 147 | // always keep these: 148 | .arg(dump_mir_dir); 149 | cmd.args(output_file); 150 | 151 | if !has_main { 152 | cmd.arg("--crate-type=lib"); 153 | } 154 | // be able to override --crate-type=lib/bin 155 | cmd.args(rustc_flags); 156 | 157 | cmd.current_dir(format!("{tempdir_path}")); 158 | cmd.arg("-Zwrite-long-types-to-disk=no"); 159 | 160 | //dbg!(&cmd); 161 | 162 | let actual_args = cmd 163 | .get_args() 164 | .map(|s| s.to_owned()) 165 | .collect::>(); 166 | 167 | // run the command 168 | let output = prlimit_run_command(&mut cmd) 169 | .unwrap_or_else(|_| panic!("Error: {cmd:?}, executable: {executable:?}")); 170 | // dbg!(&output); 171 | 172 | CommandOutput::new( 173 | output, 174 | get_cmd_string(&cmd), 175 | actual_args, 176 | crate::Executable::Rustc, 177 | ) 178 | // remove tempdir 179 | //tempdir.close().unwrap(); 180 | } 181 | 182 | pub(crate) fn run_rustc_incremental( 183 | executable: &str, 184 | file: &Path, 185 | global_tempdir_path: &PathBuf, 186 | ) -> CommandOutput { 187 | let tempdir = TempDir::new_in(global_tempdir_path, "rustc_testrunner_tmpdir").unwrap(); 188 | let tempdir_path = tempdir.path(); 189 | 190 | let dump_mir_dir = String::from("-Zdump-mir-dir=/dev/null"); 191 | 192 | let has_main = file_has_main(&file); 193 | 194 | let mut cmd = Command::new("DUMMY"); 195 | let mut output = None; 196 | let mut actual_args = Vec::new(); 197 | for i in &[0, 1] { 198 | let mut command = Command::new(executable); 199 | if !has_main { 200 | command.arg("--crate-type=lib"); 201 | } 202 | command 203 | .arg(file) 204 | .env("SYSROOT", &*SYSROOT_PATH) 205 | // avoid error: the generated executable for the input file .. onflicts with the existing directory.. 206 | .arg(format!("-o{}/{}", tempdir_path.display(), i)) 207 | .arg(format!("-Cincremental={}", tempdir_path.display())) 208 | .arg("-Zwrite-long-types-to-disk=no") 209 | .arg("-Zincremental-verify-ich=yes") 210 | .arg(&dump_mir_dir) 211 | // also enable debuginfo for incremental, since we are codegenning anyway 212 | .arg("-Cdebuginfo=2"); 213 | // save-temps creates /tmp/rustc dirs that are not cleaned up properly 214 | //.arg("-Csave-temps=yes") 215 | // .arg("--edition=2021"); 216 | // .arg("-Cpasses=lint"); 217 | 218 | //dbg!(&command); 219 | 220 | output = Some(prlimit_run_command(&mut command)); 221 | actual_args = command 222 | .get_args() 223 | .map(|s| s.to_owned()) 224 | .collect::>(); 225 | //dbg!(&output); 226 | cmd = command; 227 | } 228 | 229 | let output = output.map(|output| output.unwrap()).unwrap(); 230 | 231 | tempdir.close().unwrap(); 232 | //dbg!(&output); 233 | CommandOutput::new( 234 | output, 235 | get_cmd_string(&cmd), 236 | actual_args, 237 | crate::Executable::Rustc, 238 | ) 239 | } 240 | 241 | #[allow(unused)] 242 | pub(crate) fn run_rustc_lazy_type_alias( 243 | executable: &str, 244 | file: &Path, 245 | global_tempdir_path: &PathBuf, 246 | ) -> CommandOutput { 247 | let tempdir = TempDir::new_in(global_tempdir_path, "rustc_testrunner_tmpdir").unwrap(); 248 | let tempdir_path = tempdir.path(); 249 | 250 | let has_main = std::fs::read_to_string(file) 251 | .unwrap_or_default() 252 | .contains("fn main("); 253 | 254 | let mut cmd = Command::new("DUMMY"); 255 | let mut output = None; 256 | let mut actual_args = Vec::new(); 257 | 258 | let mut output_without_flag = None; 259 | let mut output_with_flag = None; 260 | 261 | for i in &[0, 1] { 262 | let mut command = Command::new(executable); 263 | if !has_main { 264 | command.arg("--crate-type=lib"); 265 | } 266 | command 267 | .arg(file) 268 | .env("SYSROOT", &*SYSROOT_PATH) 269 | // avoid error: the generated executable for the input file .. onflicts with the existing directory.. 270 | .arg(format!("-o{}/{}", tempdir_path.display(), i)) 271 | .arg("--edition=2021") 272 | .arg("-Zwrite-long-types-to-disk=no"); 273 | 274 | if *i == 1 { 275 | command.arg("-Zcrate-attr=feature(lazy_type_alias)"); 276 | command.arg("-Aincomplete_features"); 277 | } 278 | 279 | //dbg!(&command); 280 | 281 | let output_ = Some(prlimit_run_command(&mut command)); 282 | actual_args = command 283 | .get_args() 284 | .map(|s| s.to_owned()) 285 | .collect::>(); 286 | //dbg!(&output); 287 | cmd = command; 288 | 289 | output = output_.map(|output| output.unwrap()); 290 | 291 | if *i == 0 { 292 | // shortcut: if rustc without lazy_type_alias encountered errors we can already stop checking 293 | 294 | let o = output.clone(); 295 | let o = o.unwrap(); 296 | if !o.status.success() { 297 | return CommandOutput::new( 298 | Command::new("false").output().unwrap(), 299 | String::new(), 300 | Vec::new(), 301 | crate::Executable::Rustc, 302 | ); 303 | } 304 | 305 | output_without_flag = Some(output.clone()); 306 | } else { 307 | output_with_flag = Some(output.clone()); 308 | } 309 | } 310 | let mut all_output_without_flag = String::new(); 311 | let o = output_without_flag.unwrap().unwrap(); 312 | let x = String::from_utf8_lossy(&o.stdout); 313 | let y = String::from_utf8_lossy(&o.stderr); 314 | all_output_without_flag.push_str(&x); 315 | all_output_without_flag.push_str(&y); 316 | 317 | let mut all_output_with_flag = String::new(); 318 | let o = output_with_flag.unwrap().unwrap(); 319 | let x = String::from_utf8_lossy(&o.stdout); 320 | let y = String::from_utf8_lossy(&o.stderr); 321 | all_output_with_flag.push_str(&x); 322 | all_output_with_flag.push_str(&y); 323 | 324 | // no warnings previously, no before output != after output 325 | if all_output_without_flag.is_empty() && all_output_without_flag != all_output_with_flag { 326 | eprintln!("\n\n LAZY TYPE ALIAS DIFFERENCE {}\n\n", file.display()); 327 | } 328 | 329 | tempdir.close().unwrap(); 330 | //dbg!(&output); 331 | CommandOutput::new( 332 | output.unwrap(), 333 | get_cmd_string(&cmd), 334 | actual_args, 335 | crate::Executable::Rustc, 336 | ) 337 | } 338 | 339 | // check if a file compiles with rustc while it doesnt with RA 340 | pub(crate) fn run_compare_ra_to_rustc( 341 | _executable: &str, 342 | file: &Path, 343 | global_tempdir_path: &PathBuf, 344 | ) -> CommandOutput { 345 | let tempdir = TempDir::new_in(global_tempdir_path, "rustc_testrunner_tmpdir").unwrap(); 346 | let tempdir_path = tempdir.path(); 347 | 348 | let file_stem = &format!("_{}", file.file_stem().unwrap().to_str().unwrap()) 349 | .replace('.', "_") 350 | .replace(['[', ']'], "_"); 351 | 352 | let file_string = std::fs::read_to_string(file).unwrap_or_default(); 353 | 354 | let mut rustc_command = Command::new(Executable::Rustc.path()); 355 | rustc_command 356 | .arg("--crate-type=lib") 357 | .arg(file) 358 | .env("SYSROOT", &*SYSROOT_PATH) 359 | // avoid error: the generated executable for the input file .. onflicts with the existing directory.. 360 | .arg(format!("-o{}/output", tempdir_path.display())) 361 | .arg("--edition=2015") 362 | .arg("-Zwrite-long-types-to-disk=no"); 363 | 364 | let rustc_output = prlimit_run_command(&mut rustc_command).unwrap(); 365 | 366 | //dbg!(&rustc_output); 367 | // SPEEDUP: if rustc already throws errors, abort: 368 | if !rustc_output.status.success() { 369 | return CommandOutput::new( 370 | std::process::Command::new("true") 371 | .output() 372 | .expect("failed to run 'true'"), 373 | String::new(), 374 | Vec::new(), 375 | crate::Executable::RustAnalyzer, 376 | ); 377 | } 378 | 379 | if !std::process::Command::new("cargo") 380 | .arg("new") 381 | .arg(file_stem) 382 | .args(["--vcs", "none"]) 383 | .arg("--edition=2015") 384 | .current_dir(tempdir_path) 385 | .output() 386 | .expect("failed to exec cargo new") 387 | .status 388 | .success() 389 | { 390 | eprintln!( 391 | "ERROR: cargo new failed for: '{file_stem}', run_compare_ra_to_rustc() {}:{}:{}", 392 | file!(), 393 | line!(), 394 | column!() 395 | ); 396 | return CommandOutput::new( 397 | std::process::Command::new("true") 398 | .output() 399 | .expect("failed to run 'true'"), 400 | String::new(), 401 | Vec::new(), 402 | crate::Executable::RustAnalyzer, 403 | ); 404 | } 405 | let source_path = { 406 | let mut sp = tempdir_path.to_owned(); 407 | sp.push(file_stem); 408 | sp.push("src/"); 409 | sp.push("main.rs"); 410 | sp 411 | }; 412 | 413 | // write the content of the file we want to check into tmpcrate/src/main.rs 414 | std::fs::write(source_path, file_string).expect("failed to write to file"); 415 | 416 | // we should have everything prepared for the miri invocation now: execute "cargo miri run" 417 | 418 | let mut crate_path = tempdir_path.to_owned(); 419 | crate_path.push(file_stem); 420 | 421 | let mut ra_command = Command::new(Executable::RustAnalyzer.path()); 422 | 423 | ra_command.arg("diagnostics").arg(crate_path); 424 | 425 | //dbg!(&command); 426 | 427 | let ra_output = prlimit_run_command(&mut ra_command).unwrap(); 428 | 429 | let rustc_status = rustc_output.status.success(); 430 | let ra_status = ra_output.status.success(); 431 | // if rustc does not complain while rust-analyzer does, raise an error 432 | if rustc_status && !ra_status { 433 | eprintln!("\n\n RUST_ALIAS_PARSER DIFFERENCE {}\n\n", file.display()); 434 | } 435 | 436 | tempdir.close().unwrap(); 437 | //dbg!(&output); 438 | CommandOutput::new( 439 | ra_output, 440 | get_cmd_string(&ra_command), 441 | Vec::new(), 442 | crate::Executable::Rustc, 443 | ) 444 | } 445 | 446 | // compile 2 variations of a file with shared incr comp cache and try to find crashes 447 | pub(crate) fn run_rustc_incremental_with_two_files( 448 | executable: &str, 449 | file_1: &Path, 450 | // mutation 451 | file_2: &String, 452 | global_tempdir_path: &PathBuf, 453 | ) -> CommandOutput { 454 | let tempdir = TempDir::new_in(global_tempdir_path, "rustc_testrunner_tmpdir").unwrap(); 455 | let tempdir_path = tempdir.path(); 456 | let file_2_string = file_2; 457 | let file_2 = tempdir_path.join("file2"); 458 | let file_2 = file_2.as_path(); 459 | let mut file_2_handle = std::fs::File::create(file_2).unwrap(); 460 | file_2_handle.write_all(file_2_string.as_bytes()).unwrap(); 461 | 462 | let dump_mir_dir = String::from("-Zdump-mir-dir=/dev/null"); 463 | 464 | let has_main = std::fs::read_to_string(file_1) 465 | .unwrap_or_default() 466 | .contains("fn main("); 467 | 468 | let mut cmd = Command::new("DUMMY"); 469 | let mut output = None; 470 | let mut actual_args = Vec::new(); 471 | for i in &[0, 1] { 472 | let input = match i { 473 | 0 => file_1, 474 | 1 => file_2, 475 | _ => unreachable!(), 476 | }; 477 | let mut command = Command::new(executable); 478 | if !has_main { 479 | command.arg("--crate-type=lib"); 480 | } 481 | command 482 | .arg(input) 483 | .env("SYSROOT", &*SYSROOT_PATH) 484 | // avoid error: the generated executable for the input file .. onflicts with the existing directory.. 485 | .arg(format!("-o{}/{}", tempdir_path.display(), i)) 486 | .arg(format!("-Cincremental={}", tempdir_path.display())) 487 | .arg("-Zincremental-verify-ich=yes") 488 | .arg("-Zwrite-long-types-to-disk=no") 489 | .arg(&dump_mir_dir) 490 | // also enable debuginfo for incremental, since we are codegenning anyway 491 | .arg("-Cdebuginfo=2") 492 | .arg("--edition=2021"); 493 | // save-temps creates /tmp/rustc dirs that are not cleaned up properly 494 | //.arg("-Csave-temps=yes") 495 | // .arg("--edition=2021"); 496 | // .arg("-Cpasses=lint"); 497 | 498 | //dbg!(&command); 499 | 500 | output = Some(prlimit_run_command(&mut command)); 501 | actual_args = command 502 | .get_args() 503 | .map(|s| s.to_owned()) 504 | .collect::>(); 505 | //dbg!(&output); 506 | cmd = command; 507 | } 508 | 509 | let output = output.map(|output| output.unwrap()).unwrap(); 510 | 511 | tempdir.close().unwrap(); 512 | //dbg!(&output); 513 | CommandOutput::new( 514 | output, 515 | get_cmd_string(&cmd), 516 | actual_args, 517 | crate::Executable::Rustc, 518 | ) 519 | } 520 | 521 | pub(crate) fn run_clippy( 522 | executable: &str, 523 | file: &Path, 524 | global_tempdir_path: &Path, 525 | ) -> CommandOutput { 526 | // runs clippy-driver, not cargo-clippy! 527 | 528 | let mut cmd = Command::new(executable); 529 | 530 | if !file_has_main(&file) { 531 | cmd.arg("--crate-type=lib"); 532 | } 533 | 534 | cmd.env("RUSTFLAGS", "-Z force-unstable-if-unmarked") 535 | .env("SYSROOT", &*SYSROOT_PATH) 536 | .env("CARGO_TERM_COLOR", "never") 537 | .arg(file) 538 | .args(flags::CLIPPYLINTS) 539 | .args(flags::RUSTC_ALLOW_BY_DEFAULT_LINTS) 540 | .arg("-Zwrite-long-types-to-disk=no") 541 | .arg("-Zunstable-options") 542 | .arg("--edition=2024") 543 | .arg("-Zvalidate-mir") 544 | .arg("-Zlint-mir") 545 | .args(["--cap-lints", "warn"]) 546 | .args(["-o", "/dev/null"]) 547 | .current_dir(global_tempdir_path); 548 | 549 | let output = prlimit_run_command(&mut cmd).unwrap(); 550 | 551 | CommandOutput::new( 552 | output, 553 | get_cmd_string(&cmd), 554 | Vec::new(), 555 | crate::Executable::Clippy, 556 | ) 557 | } 558 | 559 | pub(crate) fn run_clippy_fix( 560 | _executable: &str, 561 | file: &Path, 562 | global_tempdir_path: &PathBuf, 563 | ) -> CommandOutput { 564 | // we need the "cargo-clippy" executable for --fix 565 | // s/clippy-driver/cargo-clippy 566 | /* let cargo_clippy = executable 567 | .to_string() 568 | .replace("clippy-driver", "cargo-clippy"); */ 569 | 570 | let file_stem = &format!("_{}", file.file_stem().unwrap().to_str().unwrap()) 571 | .replace('.', "_") 572 | .replace(['[', ']'], "_"); 573 | 574 | let file_string = std::fs::read_to_string(file).unwrap_or_default(); 575 | 576 | // we need to get the full path to work with --project 577 | // https://github.com/matthiaskrgr/icemaker/issues/26 578 | let file = std::fs::canonicalize(file).unwrap(); 579 | 580 | let has_main = file_has_main(&file); 581 | 582 | let tempdir = TempDir::new_in(global_tempdir_path, "icemaker_clippyfix_tempdir").unwrap(); 583 | let tempdir_path = tempdir.path(); 584 | 585 | // @FIXME should this actually be clippy to catch clippy ICEs 586 | if !file_compiles( 587 | &file, 588 | &crate::ice::Executable::Rustc.path(), 589 | global_tempdir_path, 590 | ) { 591 | return CommandOutput::new( 592 | std::process::Command::new("true") 593 | .output() 594 | .expect("failed to run 'true'"), 595 | String::new(), 596 | Vec::new(), 597 | crate::Executable::ClippyFix, 598 | ); 599 | } 600 | 601 | // create a new cargo project inside the tmpdir 602 | if !std::process::Command::new("cargo") 603 | .env("SYSROOT", &*SYSROOT_PATH) 604 | .env("CARGO_TERM_COLOR", "never") 605 | .arg("new") 606 | .args(["--vcs", "none"]) 607 | .arg(if has_main { "--bin" } else { "--lib" }) 608 | .arg(file_stem) 609 | .current_dir(tempdir_path) 610 | .output() 611 | .expect("failed to exec cargo new") 612 | .status 613 | .success() 614 | { 615 | eprintln!( 616 | "ERROR: cargo new failed for: '{file_stem}', run_clippy_fix() {}:{}:{}", 617 | file!(), 618 | line!(), 619 | column!() 620 | ); 621 | 622 | return CommandOutput::new( 623 | std::process::Command::new("true") 624 | .output() 625 | .expect("failed to run 'true'"), 626 | String::new(), 627 | Vec::new(), 628 | crate::Executable::ClippyFix, 629 | ); 630 | } 631 | let source_path = { 632 | let mut sp = tempdir_path.to_owned(); 633 | sp.push(file_stem); 634 | sp.push("src/"); 635 | sp.push("main.rs"); 636 | sp 637 | }; 638 | 639 | // write the content of the file we want to check into tmpcrate/src/main.rs 640 | std::fs::write(source_path, file_string).expect("failed to write to file"); 641 | 642 | let mut crate_path = tempdir_path.to_owned(); 643 | crate_path.push(file_stem); 644 | 645 | let mut cmd = Command::new("cargo"); 646 | 647 | cmd.arg(if *LOCAL_DEBUG_ASSERTIONS { 648 | "+local-debug-assertions" 649 | } else { 650 | "+master" 651 | }) 652 | .arg("clippy") 653 | .env("CARGO_TERM_COLOR", "never") 654 | .env("RUSTFLAGS", "-Z force-unstable-if-unmarked") 655 | .env("SYSROOT", &*SYSROOT_PATH) 656 | .current_dir(crate_path) 657 | .arg("--fix") 658 | .arg("--allow-no-vcs") 659 | .arg("--") 660 | .args(flags::CLIPPYLINTS) 661 | .args(flags::RUSTC_ALLOW_BY_DEFAULT_LINTS) 662 | .args(["--cap-lints", "warn"]); 663 | //dbg!(&cmd); 664 | 665 | let output = prlimit_run_command(&mut cmd).unwrap(); 666 | 667 | // grab the output from the clippy-fix command to get the lints that we ran so we can bisect the offending lint later on 668 | let lint_output = String::from_utf8(output.clone().stderr).unwrap(); 669 | 670 | let mut clippy_lint_lines = lint_output 671 | .lines() 672 | .filter(|l| l.contains("https://rust-lang.github.io/rust-clippy/master/index.html#")) 673 | .map(|l| l.split('#').last().unwrap()) 674 | // .map(|lintname| format!("-Wclippy::{}", lintname.replace('_', "-"))) 675 | .map(|lintname| lintname.replace('_', "-")) 676 | .map(|lint| format!("--force-warn clippy::{lint}")) 677 | .map(|l| l.into()) 678 | .collect::>(); 679 | clippy_lint_lines.sort(); 680 | clippy_lint_lines.dedup(); 681 | 682 | let rustc_lint_lines_default = lint_output 683 | .lines() 684 | .filter(|l| l.contains(" = note: `#[warn(") && l.contains(")]` on by default")) 685 | .map(|l| l.split('(').last().unwrap()) 686 | .map(|l| l.split(')').next().unwrap()); 687 | 688 | let rustc_lint_lints_cmdline = lint_output 689 | .lines() 690 | .filter(|l| l.contains(" = note: requested on the command line with `")) 691 | .map(|l| l.split('`').nth(1).unwrap()) 692 | .map(|l| l.split("-W ").last().unwrap()); 693 | 694 | let mut rustc_lints_all = rustc_lint_lines_default 695 | .chain(rustc_lint_lints_cmdline) 696 | // added later 697 | // .map(|lint| format!("-W{}", lint)) 698 | .map(|lint| format!("--force-warn {lint}")) 699 | .map(OsString::from) 700 | .collect::>(); 701 | 702 | rustc_lints_all.sort(); 703 | rustc_lints_all.dedup(); 704 | 705 | clippy_lint_lines.extend(rustc_lints_all); 706 | 707 | let used_lints = clippy_lint_lines; 708 | 709 | //dbg!(String::from_utf8_lossy(&output.stderr)); 710 | 711 | CommandOutput::new( 712 | output, 713 | get_cmd_string(&cmd), 714 | used_lints, 715 | crate::Executable::ClippyFix, 716 | ) 717 | } 718 | 719 | pub(crate) fn run_rustfix( 720 | _executable: &str, 721 | file: &Path, 722 | global_tempdir_path: &PathBuf, 723 | ) -> CommandOutput { 724 | // run cargo fix --broken-code and check if rustc provides any suggestions that do not fix the actual problemy 725 | 726 | let file_stem = &format!("_{}", file.file_stem().unwrap().to_str().unwrap()) 727 | .replace('.', "_") 728 | .replace(['[', ']'], "_"); 729 | 730 | let file_string = std::fs::read_to_string(file).unwrap_or_default(); 731 | 732 | let tempdir = TempDir::new_in(global_tempdir_path, "icemaker_rustffix_tempdir").unwrap(); 733 | let tempdir_path = tempdir.path(); 734 | // create a new cargo project inside the tmpdir 735 | if !std::process::Command::new("cargo") 736 | .env("SYSROOT", &*SYSROOT_PATH) 737 | .env("CARGO_TERM_COLOR", "never") 738 | .arg("new") 739 | .args(["--vcs", "none"]) 740 | .arg(file_stem) 741 | .current_dir(tempdir_path) 742 | .output() 743 | .expect("failed to exec cargo new") 744 | .status 745 | .success() 746 | { 747 | eprintln!("ERROR: cargo new failed for: {file_stem}"); 748 | return CommandOutput::new( 749 | std::process::Command::new("true") 750 | .output() 751 | .expect("failed to run 'true'"), 752 | String::new(), 753 | Vec::new(), 754 | crate::Executable::RustFix, 755 | ); 756 | } 757 | 758 | let source_path = { 759 | let mut sp = tempdir_path.to_owned(); 760 | sp.push(file_stem); 761 | sp.push("src/"); 762 | sp.push("main.rs"); 763 | sp 764 | }; 765 | 766 | // write the content of the file we want to check into tmpcrate/src/main.rs 767 | std::fs::write(source_path, &file_string).expect("failed to write to file"); 768 | 769 | // we should have everything prepared for the miri invocation now: execute "cargo miri run" 770 | 771 | let mut crate_path = tempdir_path.to_owned(); 772 | crate_path.push(file_stem); 773 | 774 | let mut cmd = Command::new("cargo"); 775 | 776 | cmd.arg(if *LOCAL_DEBUG_ASSERTIONS { 777 | "+local-debug-assertions" 778 | } else { 779 | "+master" 780 | }) 781 | .env("RUSTFLAGS", "-Z force-unstable-if-unmarked -Aunused") 782 | .env("SYSROOT", &*SYSROOT_PATH) 783 | .env("CARGO_TERM_COLOR", "never") 784 | .current_dir(&crate_path) 785 | .arg("fix") 786 | .arg("--allow-no-vcs") 787 | .arg("--broken-code"); 788 | // cargo fix doesnt need this 789 | // .args(["--", "--cap-lints", "warn"]); 790 | 791 | //dbg!(&cmd); 792 | 793 | let output = prlimit_run_command(&mut cmd).unwrap(); 794 | 795 | let fixed_file = &crate_path.join("src").join("main.rs"); 796 | let file_after_fixing = std::fs::read_to_string(fixed_file).unwrap_or_default(); 797 | if file_string == file_after_fixing { 798 | // we didn't actually apply any changes, ignore 799 | return CommandOutput::new( 800 | std::process::Command::new("true") 801 | .output() 802 | .expect("failed to run 'true'"), 803 | String::new(), 804 | Vec::new(), 805 | crate::Executable::RustFix, 806 | ); 807 | } 808 | 809 | //dbg!(&output); 810 | 811 | // modified the file! BUT if we fixed all errors, we are not intersted in this... 812 | if find_ICE_string(file, &crate::Executable::RustFix, output.clone()).is_some() { 813 | let diff = diff::lines(&file_string, &file_after_fixing) 814 | .iter() 815 | .map(|diff| match diff { 816 | diff::Result::Left(l) => format!("-{l}\n"), 817 | diff::Result::Both(l, _) => format!(" {l}\n"), 818 | diff::Result::Right(r) => format!("+{r}\n"), 819 | }) 820 | .collect::(); 821 | 822 | let file_str = file.display(); 823 | // let stderr = String::from_utf8(output.clone().stderr).unwrap(); 824 | eprintln!("\n\n{file_str}\n{diff}\n" /*{stderr}*/); 825 | } 826 | 827 | CommandOutput::new( 828 | output, 829 | get_cmd_string(&cmd), 830 | Vec::new(), 831 | crate::Executable::RustFix, 832 | ) 833 | } 834 | 835 | pub(crate) fn run_clippy_fix_with_args( 836 | executable: &str, 837 | file: &Path, 838 | args: &[&str], 839 | global_tempdir_path: &PathBuf, 840 | ) -> CommandOutput { 841 | // dbg!(&args); 842 | // we need the "cargo-clippy" executable for --fix 843 | // s/clippy-driver/cargo-clippy 844 | // dbg!(args); 845 | let _cargo_clippy = executable 846 | .to_string() 847 | .replace("clippy-driver", "cargo-clippy"); 848 | 849 | let file_stem = &format!("_{}", file.file_stem().unwrap().to_str().unwrap()) 850 | .replace('.', "_") 851 | .replace(['[', ']'], "_"); 852 | 853 | let file_string = std::fs::read_to_string(file).unwrap_or_default(); 854 | 855 | // let has_main = file_string.contains("pub(crate) fn main("); 856 | 857 | // since we already run clippy successfully on the file we SHOULD not encounter any errors here. 858 | // I assume that cargo clippy --fix throws errors somehow and that returns early here 859 | 860 | let tempdir = TempDir::new_in(global_tempdir_path, "icemaker_clippyfix_tempdir").unwrap(); 861 | let tempdir_path = tempdir.path(); 862 | // create a new cargo project inside the tmpdir 863 | if !std::process::Command::new("cargo") 864 | .env("SYSROOT", &*SYSROOT_PATH) 865 | .env("CARGO_TERM_COLOR", "never") 866 | .arg("new") 867 | .args(["--vcs", "none"]) 868 | .arg(file_stem) 869 | .current_dir(tempdir_path) 870 | .output() 871 | .expect("failed to exec cargo new") 872 | .status 873 | .success() 874 | { 875 | eprintln!( 876 | "ERROR: cargo new failed for: '{file_stem}', run_clippy_fix_with_args() {}:{}:{}", 877 | file!(), 878 | line!(), 879 | column!() 880 | ); 881 | 882 | return CommandOutput::new( 883 | std::process::Command::new("true") 884 | .output() 885 | .expect("failed to run 'true'"), 886 | String::new(), 887 | Vec::new(), 888 | crate::Executable::ClippyFix, 889 | ); 890 | } 891 | let source_path = { 892 | let mut sp = tempdir_path.to_owned(); 893 | sp.push(file_stem); 894 | sp.push("src/"); 895 | sp.push("main.rs"); 896 | sp 897 | }; 898 | 899 | // write the content of the file we want to check into tmpcrate/src/main.rs 900 | std::fs::write(source_path, file_string).expect("failed to write to file"); 901 | 902 | // we should have everything prepared for the miri invocation now: execute "cargo miri run" 903 | 904 | let mut crate_path = tempdir_path.to_owned(); 905 | crate_path.push(file_stem); 906 | 907 | let mut cmd = Command::new("cargo"); 908 | 909 | cmd.arg(if *LOCAL_DEBUG_ASSERTIONS { 910 | "+local-debug-assertions" 911 | } else { 912 | "+master" 913 | }) 914 | .arg("clippy") 915 | .env("RUSTFLAGS", "-Z force-unstable-if-unmarked") 916 | .env("SYSROOT", &*SYSROOT_PATH) 917 | .env("CARGO_TERM_COLOR", "never") 918 | .current_dir(crate_path) 919 | .arg("--fix") 920 | .arg("--allow-no-vcs") 921 | .arg("--") 922 | .arg("-Aclippy::all") 923 | // need to silence all default rustc lints first so we can properly bisect them 924 | // also add 925 | .arg("-Awarnings") 926 | .args(args.iter().flat_map(|a| a.split_whitespace())) 927 | .args(["--cap-lints", "warn"]); 928 | 929 | //dbg!(&cmd); 930 | 931 | let output = prlimit_run_command(&mut cmd).unwrap(); 932 | 933 | // dbg!(&output); 934 | // } 935 | 936 | CommandOutput::new( 937 | output, 938 | get_cmd_string(&cmd), 939 | Vec::new(), 940 | crate::Executable::ClippyFix, 941 | ) 942 | } 943 | 944 | pub(crate) fn run_rustdoc( 945 | executable: &str, 946 | file: &Path, 947 | global_tempdir_path: &Path, 948 | ) -> CommandOutput { 949 | let mut cmd = Command::new(executable); 950 | cmd.env("RUSTFLAGS", "-Z force-unstable-if-unmarked") 951 | .env("SYSROOT", &*SYSROOT_PATH) 952 | .env("CARGO_TERM_COLOR", "never") 953 | .arg(file) 954 | .arg("-Znormalize-docs") 955 | .arg("--edition=2021") 956 | .arg("-Zunstable-options") 957 | .arg("--document-private-items") 958 | .arg("--document-hidden-items") 959 | .args(["--output-format", "json"]) 960 | .args(["--cap-lints", "warn"]) 961 | .arg("-Wrustdoc::invalid-html-tags") 962 | .arg("-Wrustdoc::missing-crate-level-docs") 963 | .arg("-Wrustdoc::missing-doc-code-examples") 964 | .arg("-Wrustdoc::private-doc-tests") 965 | .arg("-Zwrite-long-types-to-disk=no") 966 | .arg("--show-type-layout") 967 | .args(["-o", "/dev/null"]) 968 | .current_dir(global_tempdir_path); 969 | let output = prlimit_run_command(&mut cmd).unwrap(); 970 | 971 | CommandOutput::new( 972 | output, 973 | get_cmd_string(&cmd), 974 | Vec::new(), 975 | crate::Executable::Rustdoc, 976 | ) 977 | } 978 | 979 | #[allow(unused)] 980 | pub(crate) fn run_rust_analyzer( 981 | executable: &str, 982 | file: &Path, 983 | _global_tempdir_path: &Path, 984 | ) -> CommandOutput { 985 | let file_content = 986 | std::fs::read_to_string(file).expect("run_rust_analyzer: failed to read file"); 987 | 988 | let mut cmd = Command::new("prlimit") 989 | .args(["--noheadings", "--as=3076000000", "--cpu=30"]) 990 | .arg(executable) 991 | // THIS cmd NEEDS TO BE IN SYNC WITH fn reduce_ice_code_to_string() !! 992 | .arg("highlight") 993 | .stdin(Stdio::piped()) 994 | .stdout(Stdio::piped()) 995 | .stderr(Stdio::piped()) 996 | .spawn() 997 | .unwrap(); 998 | 999 | let stdin = &mut cmd.stdin.as_mut().unwrap(); 1000 | stdin.write_all(file_content.as_bytes()).unwrap(); 1001 | 1002 | let output = cmd.wait_with_output().unwrap(); 1003 | //dbg!(&output); 1004 | 1005 | CommandOutput::new( 1006 | output, 1007 | get_cmd_string(Command::new("rust-analyser").arg("symbols")), 1008 | Vec::new(), 1009 | crate::Executable::RustAnalyzer, 1010 | ) 1011 | 1012 | /* 1013 | let output = process.wait_with_output().unwrap(); 1014 | println!("\n\n{:?}\n\n", output); 1015 | output 1016 | */ 1017 | } 1018 | pub(crate) fn run_rustfmt( 1019 | executable: &str, 1020 | file: &Path, 1021 | _global_tempdir_path: &Path, 1022 | ) -> CommandOutput { 1023 | let mut cmd = Command::new(executable); 1024 | cmd.env("SYSROOT", &*SYSROOT_PATH) 1025 | .arg(file) 1026 | .arg("--check") 1027 | .args(["--color", "never"]) 1028 | .args(["--edition", "2021"]); 1029 | let output = prlimit_run_command(&mut cmd).unwrap(); 1030 | CommandOutput::new( 1031 | output, 1032 | get_cmd_string(&cmd), 1033 | Vec::new(), 1034 | crate::Executable::Rustfmt, 1035 | ) 1036 | } 1037 | 1038 | pub(crate) fn run_miri( 1039 | executable: &str, 1040 | file: &Path, 1041 | miri_flags: &[&str], 1042 | rustc_flags: &[&str], 1043 | global_tempdir_path: &PathBuf, 1044 | ) -> CommandOutput { 1045 | let file_stem = &format!("_{}", file.file_stem().unwrap().to_str().unwrap()) 1046 | .replace('.', "_") 1047 | .replace(['[', ']'], "_"); 1048 | 1049 | let file_string = std::fs::read_to_string(file).unwrap_or_default(); 1050 | /* // only check files that have main() as entrypoint 1051 | // assume that if we find "fn main() {\n", the main contains something 1052 | let has_main = file_string.contains("fn main() {\n"); 1053 | 1054 | // let has_test = file_string.contains("#[test"); 1055 | 1056 | let has_unsafe = file_string.contains("unsafe "); 1057 | if (!has_main/*&& !has_test*/) || has_unsafe { 1058 | // @FIXME, move this out of run_miri 1059 | // we need some kind main entry point and code should not contain unsafe code 1060 | return ( 1061 | std::process::Command::new("true") 1062 | .output() 1063 | .expect("failed to run 'true'"), 1064 | String::new(), 1065 | Vec::new(), 1066 | ); 1067 | } 1068 | assert!(!has_unsafe, "file should not contain any unsafe code!"); 1069 | */ 1070 | 1071 | let has_main = file_string.contains("fn main() {\n"); 1072 | 1073 | // running miri is a bit more complicated: 1074 | // first we need a new tempdir 1075 | 1076 | let has_test = file_string.contains("#[test]"); 1077 | 1078 | let no_std = file_string.contains("#![no_std]"); 1079 | let platform_intrinsics = file_string.contains("platform_intrinsics"); 1080 | let custom_mir = file_string.contains("mir!"); 1081 | 1082 | if no_std || platform_intrinsics || (!has_main && !has_test) || custom_mir { 1083 | // miri is know to not really handles this well 1084 | return CommandOutput::new( 1085 | std::process::Command::new("true") 1086 | .output() 1087 | .expect("failed to run 'true'"), 1088 | String::new(), 1089 | Vec::new(), 1090 | crate::Executable::Miri, 1091 | ); 1092 | } 1093 | 1094 | let edition = rustc_flags 1095 | .iter() 1096 | .find(|flag| flag.starts_with("--edition=")); 1097 | 1098 | let tempdir = TempDir::new_in(global_tempdir_path, "icemaker_miri_tempdir").unwrap(); 1099 | let tempdir_path = tempdir.path(); 1100 | // create a new cargo project inside the tmpdir 1101 | if !std::process::Command::new("cargo") 1102 | .arg("new") 1103 | .arg(file_stem) 1104 | .args(["--vcs", "none"]) 1105 | .arg(edition.expect("miri got no --edition passed via its MIRI_RUSTFLAGS")) 1106 | .current_dir(tempdir_path) 1107 | .output() 1108 | .expect("failed to exec cargo new") 1109 | .status 1110 | .success() 1111 | { 1112 | eprintln!( 1113 | "ERROR: cargo new failed for: '{file_stem}', run_miri() {}:{}:{}", 1114 | file!(), 1115 | line!(), 1116 | column!() 1117 | ); 1118 | return CommandOutput::new( 1119 | std::process::Command::new("true") 1120 | .output() 1121 | .expect("failed to run 'true'"), 1122 | String::new(), 1123 | Vec::new(), 1124 | crate::Executable::Miri, 1125 | ); 1126 | } 1127 | let source_path = { 1128 | let mut sp = tempdir_path.to_owned(); 1129 | sp.push(file_stem); 1130 | sp.push("src/"); 1131 | sp.push("main.rs"); 1132 | sp 1133 | }; 1134 | 1135 | // write the content of the file we want to check into tmpcrate/src/main.rs 1136 | std::fs::write(source_path, file_string).expect("failed to write to file"); 1137 | 1138 | // we should have everything prepared for the miri invocation now: execute "cargo miri run" 1139 | 1140 | let mut crate_path = tempdir_path.to_owned(); 1141 | crate_path.push(file_stem); 1142 | 1143 | let mut cmd = std::process::Command::new("cargo"); 1144 | /* if !has_main && has_test { 1145 | cmd.arg("miri") 1146 | .arg("test") 1147 | .current_dir(crate_path) 1148 | .env("MIRIFLAGS", miri_flags.join(" ")); 1149 | } else { */ 1150 | cmd.arg(if *LOCAL_DEBUG_ASSERTIONS { 1151 | "+local-debug-assertions" 1152 | } else { 1153 | "+master" 1154 | }) 1155 | .arg("miri") 1156 | .arg(if has_test && !has_main { "test" } else { "run" }) 1157 | .current_dir(&crate_path) 1158 | .env("MIRIFLAGS", miri_flags.join(" ")) 1159 | .env( 1160 | "RUSTFLAGS", 1161 | rustc_flags 1162 | .iter() 1163 | .filter(|f| !f.contains("--edition")) 1164 | .map(|f| format!(" {f}")) 1165 | .collect::(), 1166 | ) 1167 | .env("MIRI_CWD", &crate_path); 1168 | 1169 | let out = prlimit_run_command(&mut cmd) 1170 | .unwrap_or_else(|_| panic!("Error: {cmd:?}, executable: {executable:?}")); 1171 | 1172 | // dbg!(&out); 1173 | 1174 | //let stderr = String::from_utf8(out.stderr.clone()).unwrap(); 1175 | //eprintln!("{}", stderr); 1176 | let out2 = out.clone(); 1177 | //let out3 = out.clone(); // hax 1178 | if [out2.stderr, out2.stdout].into_iter().any(|out| { 1179 | let out = String::from_utf8(out).unwrap(); 1180 | out.contains("compiler_builtins ") 1181 | }) { 1182 | /* eprintln!("\n\n\n\n"); 1183 | eprintln!("STDOUT:\n {}", String::from_utf8(out3.stdout).unwrap()); 1184 | eprintln!("STDERR:\n {}", String::from_utf8(out3.stderr).unwrap()); 1185 | */ 1186 | 1187 | panic!( 1188 | "miri tried to recompile std!!\n{executable:?} {file:?} {miri_flags:?} in {crate_path:?}\n\n" 1189 | ) 1190 | } 1191 | CommandOutput::new( 1192 | out, 1193 | get_cmd_string(&cmd), 1194 | Vec::new(), 1195 | crate::Executable::Miri, 1196 | ) 1197 | } 1198 | 1199 | pub(crate) fn run_kani( 1200 | executable: &str, 1201 | file: &Path, 1202 | _kani_flags: &[&str], 1203 | rustc_flags: &[&str], 1204 | global_tempdir_path: &PathBuf, 1205 | ) -> CommandOutput { 1206 | let file_stem = &format!("_{}", file.file_stem().unwrap().to_str().unwrap()) 1207 | .replace('.', "_") 1208 | .replace(['[', ']'], "_"); 1209 | 1210 | let file_string = &std::fs::read_to_string(file).unwrap_or_default(); 1211 | 1212 | let has_main = file_string.contains("fn main() {\n"); 1213 | 1214 | // let has_test = file_string.contains("#[test]"); 1215 | 1216 | let no_std = file_string.contains("#![no_std]"); 1217 | let platform_intrinsics = file_string.contains("feature(platform_intrinsics)"); 1218 | if no_std || platform_intrinsics { 1219 | // miri is know to not really handles this well 1220 | return CommandOutput::new( 1221 | std::process::Command::new("true") 1222 | .output() 1223 | .expect("failed to run 'true'"), 1224 | String::new(), 1225 | Vec::new(), 1226 | crate::Executable::Miri, 1227 | ); 1228 | } 1229 | 1230 | let mut out = None; 1231 | let mut cmd_ = None; 1232 | let mut v = Vec::new(); 1233 | #[allow(non_snake_case)] 1234 | for RUSTCFLAGS in &["-Zmir-opt-level=0", "-Zmir-opt-level=5"] { 1235 | let mut RUSTCFLAGS = vec![RUSTCFLAGS.to_string()]; 1236 | RUSTCFLAGS.extend( 1237 | rustc_flags 1238 | .iter() 1239 | .cloned() 1240 | .map(|x| x.to_string()) 1241 | .collect::>(), 1242 | ); 1243 | if !has_main { 1244 | RUSTCFLAGS.push("--crate-type lib".into()); 1245 | } 1246 | 1247 | let RUSTCFLAGS = RUSTCFLAGS.join(" "); 1248 | 1249 | let tempdir = TempDir::new_in(global_tempdir_path, "icemaker_miri_tempdir").unwrap(); 1250 | let tempdir_path = tempdir.path(); 1251 | // create a new cargo project inside the tmpdir 1252 | if !std::process::Command::new("cargo") 1253 | .arg("new") 1254 | .arg(file_stem) 1255 | .args(["--vcs", "none"]) 1256 | .current_dir(tempdir_path) 1257 | .output() 1258 | .expect("failed to exec cargo new") 1259 | .status 1260 | .success() 1261 | { 1262 | eprintln!( 1263 | "ERROR: cargo new failed for: '{file_stem}', run_kani() {}:{}:{}", 1264 | file!(), 1265 | line!(), 1266 | column!() 1267 | ); 1268 | return CommandOutput::new( 1269 | std::process::Command::new("true") 1270 | .output() 1271 | .expect("failed to run 'true'"), 1272 | String::new(), 1273 | Vec::new(), 1274 | crate::Executable::Miri, 1275 | ); 1276 | } 1277 | let source_path = { 1278 | let mut sp = tempdir_path.to_owned(); 1279 | sp.push(file_stem); 1280 | sp.push("src/"); 1281 | sp.push("main.rs"); 1282 | sp 1283 | }; 1284 | 1285 | //fmt! 1286 | let mut rustfmt = std::process::Command::new("rustfmt") 1287 | .args(["--config", "max_width=2000000", "--edition", "2021"]) 1288 | .stdin(Stdio::piped()) 1289 | .stdout(Stdio::piped()) 1290 | .stderr(Stdio::null()) 1291 | .spawn() 1292 | .unwrap(); 1293 | let fmt_stdin = rustfmt.stdin.as_mut().unwrap(); 1294 | 1295 | fmt_stdin.write_all(file_string.as_bytes()).unwrap(); 1296 | // drop(fmt_stdin); 1297 | let fmt_output = rustfmt.wait_with_output().unwrap(); 1298 | 1299 | // if we fail formatting, fall back to unformatted output 1300 | let maybe_formatted = if !fmt_output.status.success() { 1301 | String::from_utf8(fmt_output.stdout).unwrap() 1302 | } else { 1303 | file_string.clone() 1304 | }; 1305 | 1306 | // https://github.com/model-checking/kani/blob/main/library/kani/src/arbitrary.rs 1307 | const ALLOWED_TYPES: &[&str; 21] = &[ 1308 | "u8", "u16", "u32", "u64", "u128", "usize", "i8", "i16", "i32", "i64", "i128", "isize", 1309 | "f32", "f64", "()", "bool", "char", "[", "Option", "Result", "Phantom", 1310 | ]; 1311 | 1312 | let file_instrumented = maybe_formatted 1313 | .lines() 1314 | // ignore comments 1315 | .filter(|line| !line.starts_with("//")) 1316 | .map(|line| { 1317 | // note: the kani::proof attr does NOT work on functions that have args :( 1318 | // try to only add it to argless fns 1319 | if line.contains("fn ") 1320 | && Regex::new(r"[[:word:]]\(\)").unwrap().is_match(line) 1321 | // dont treat generics 1322 | && !(line.contains('<') || line.contains('>')) 1323 | { 1324 | format!("#[kani::proof]\n{}", line) 1325 | // no ret type 1326 | } else if let Some(shortest_match_initial) = 1327 | Regex::new(r"fn [[:word:]]\(.+\) ->").unwrap().find(line) 1328 | { 1329 | let shortest_match = shortest_match_initial.as_str(); 1330 | // dbg!(&shortest_match); 1331 | let shortest_match_args = Regex::new(r"\(.*\)") 1332 | .unwrap() 1333 | .find(shortest_match) 1334 | .unwrap() 1335 | .as_str(); 1336 | // dbg!(shortest_match_args); 1337 | // remove the args from the line, since we are going to add instrument them 1338 | let mut new_line = line.replace(shortest_match_args, "()"); 1339 | // skip first and last char 1340 | let args = &shortest_match_args[1..shortest_match_args.len() - 1]; 1341 | let args = args.split(',').collect::>(); 1342 | let new_args = args 1343 | .iter() 1344 | .map(|binding_plus_ty| { 1345 | if ALLOWED_TYPES.iter().any(|ty| binding_plus_ty.contains(ty)) { 1346 | format!("let {binding_plus_ty} = kani::any(); \n") 1347 | } else { 1348 | format!("let {binding_plus_ty} = Default::default();\n") 1349 | } 1350 | }) 1351 | .collect::(); 1352 | new_line.insert_str( 1353 | new_line.rfind('{').unwrap() + 1, /* insert after the '{' */ 1354 | &new_args, 1355 | ); 1356 | 1357 | format!("#[kani::proof] {new_line}") 1358 | } else if let Some(shortest_match_initial) = 1359 | Regex::new(r"fn [[:word:]]\(.*\) \{").unwrap().find(line) 1360 | { 1361 | let shortest_match = shortest_match_initial.as_str(); 1362 | // dbg!(&shortest_match); 1363 | let shortest_match_args = Regex::new(r"\(.*\)") 1364 | .unwrap() 1365 | .find(shortest_match) 1366 | .unwrap() 1367 | .as_str(); 1368 | // dbg!(shortest_match_args); 1369 | // remove the args from the line, since we are going to add instrument them 1370 | let mut new_line = line.replace(shortest_match_args, "()"); 1371 | 1372 | // skip first and last char 1373 | let args = &shortest_match_args[1..shortest_match_args.len() - 1]; 1374 | let args = args.split(',').collect::>(); 1375 | 1376 | let new_args = args 1377 | .iter() 1378 | .map(|binding_plus_ty| { 1379 | if ALLOWED_TYPES.iter().any(|ty| binding_plus_ty.contains(ty)) { 1380 | format!("let {binding_plus_ty} = kani::any(); \n") 1381 | } else { 1382 | format!("let {binding_plus_ty} = Default::default(); ") 1383 | } 1384 | }) 1385 | .collect::(); 1386 | new_line.insert_str( 1387 | new_line.rfind('{').unwrap() + 1, /* insert after the '{' */ 1388 | &new_args, 1389 | ); 1390 | 1391 | format!("#[kani::proof] {new_line}") 1392 | // with ret type 1393 | } else { 1394 | line.into() 1395 | } 1396 | }) 1397 | // Lines iterator by default removes linebreaks, so readd them 1398 | .map(|line| format!("{line}\n")) 1399 | .collect::(); 1400 | 1401 | // eprintln!("\n\n{file_instrumented}\n\n"); 1402 | // panic!(); 1403 | // write the content of the file we want to check into tmpcrate/src/main.rs 1404 | std::fs::write(source_path, file_instrumented).expect("failed to write to file"); 1405 | 1406 | // we should have everything prepared for the miri invocation now: execute "cargo miri run" 1407 | 1408 | let mut crate_path = tempdir_path.to_owned(); 1409 | crate_path.push(file_stem); 1410 | 1411 | let mut cmd = std::process::Command::new("cargo"); 1412 | /* if !has_main && has_test { 1413 | cmd.arg("miri") 1414 | .arg("test") 1415 | .current_dir(crate_path) 1416 | .env("MIRIFLAGS", miri_flags.join(" ")); 1417 | } else { */ 1418 | cmd.arg("kani") 1419 | .current_dir(&crate_path) 1420 | .env("RUSTFLAGS", RUSTCFLAGS) 1421 | .env("RUSTC_WRAPPER", ""); 1422 | 1423 | out = Some( 1424 | prlimit_run_command(&mut cmd) 1425 | .unwrap_or_else(|_| panic!("Error: {cmd:?}, executable: {executable:?}")), 1426 | ); 1427 | cmd_ = Some(cmd); 1428 | v.push(out.clone()); 1429 | } 1430 | 1431 | let out = out.unwrap(); 1432 | let cmd = cmd_.unwrap(); 1433 | 1434 | // dbg!(&out); 1435 | // eprintln!("{}", String::from_utf8(out.clone().stderr).unwrap()); 1436 | // eprintln!("{}", String::from_utf8(out.clone().stdout).unwrap()); 1437 | 1438 | let res = v 1439 | .iter() 1440 | .flatten() 1441 | .map(|output| { 1442 | let mut std = String::from_utf8(output.clone().stdout).unwrap(); 1443 | let stderr = String::from_utf8(output.clone().stderr).unwrap(); 1444 | std.push_str(&stderr); 1445 | 1446 | std.lines() 1447 | .filter(|l| l.contains("`kani::Arbitrary` is not implemented")) 1448 | .for_each(|l| eprintln!("{l}")); 1449 | std.lines() 1450 | .filter(|l| l.contains("https://github.com/model-checking/kani/issues/")) 1451 | .for_each(|l| eprintln!("{} {l}", file.display())); 1452 | std.lines() 1453 | .filter(|line| line.contains("Status: FAILURE")) 1454 | .count() 1455 | }) 1456 | .collect::>(); 1457 | if res[0] < res[1] { 1458 | eprintln!( 1459 | "\n\n{} MIR OPT CAUSES PANICS: {} to {}\n\n", 1460 | file.display(), 1461 | res[0], 1462 | res[1] 1463 | ); 1464 | } 1465 | 1466 | CommandOutput::new( 1467 | out, 1468 | get_cmd_string(&cmd), 1469 | Vec::new(), 1470 | crate::Executable::Kani, 1471 | ) 1472 | } 1473 | 1474 | // https://github.com/rust-lang/rustc_codegen_gcc 1475 | pub(crate) fn rustc_codegen_gcc_local( 1476 | executable: &str, 1477 | file: &Path, 1478 | incremental: bool, 1479 | rustc_flags: &[&str], 1480 | global_tempdir_path: &PathBuf, 1481 | ) -> CommandOutput { 1482 | if incremental { 1483 | // only run incremental compilation tests 1484 | return run_rustc_incremental(executable, file, global_tempdir_path); 1485 | } 1486 | // if the file contains no "main", run with "--crate-type lib" 1487 | let has_main = std::fs::read_to_string(file) 1488 | .unwrap_or_default() 1489 | .contains("fn main("); 1490 | 1491 | //let tempdir = TempDir::new("rustc_testrunner_tmpdir").unwrap(); 1492 | //let tempdir_path = tempdir.path(); 1493 | 1494 | let new_tempdir = TempDir::new_in(global_tempdir_path, "newdir").unwrap(); 1495 | let new_tempdir = new_tempdir.path(); 1496 | let new_tempdir = new_tempdir.join("executablename"); 1497 | 1498 | let dump_mir_dir = String::from("-Zdump-mir-dir=/dev/null"); 1499 | 1500 | let mut cmd = Command::new("rustc"); 1501 | cmd 1502 | .args(["+nightly-2023-06-19" , "-Zcodegen-backend=/home/matthias/vcs/github/rustc_codegen_gcc_attempt2/rustc_codegen_gcc/target/release/librustc_codegen_gcc.so", 1503 | "--sysroot", 1504 | "/home/matthias/vcs/github/rustc_codegen_gcc_attempt2/rustc_codegen_gcc/build_sysroot/sysroot"]).env("LD_LIBRARY_PATH","/home/matthias/vcs/github/rustc_codegen_gcc_attempt2/gcc-build/gcc" ) 1505 | .arg(file) 1506 | .env("RUST_COMPILER_RT_ROOT", "/home/matthias/vcs/github/rustc_codegen_gcc_attempt2/llvm/compiler-rt/") 1507 | .args(rustc_flags) 1508 | // always keep these: 1509 | .arg("-o") 1510 | .arg(new_tempdir) 1511 | .arg(dump_mir_dir); 1512 | if !has_main { 1513 | cmd.arg("--crate-type=lib"); 1514 | } 1515 | // dbg!(&cmd); 1516 | 1517 | let actual_args = cmd 1518 | .get_args() 1519 | .map(|s| s.to_owned()) 1520 | .collect::>(); 1521 | 1522 | // run the command 1523 | let output = prlimit_run_command(&mut cmd) 1524 | .unwrap_or_else(|_| panic!("Error: {cmd:?}, executable: {executable:?}")); 1525 | 1526 | // eprintln!("{:?}", output); 1527 | CommandOutput::new( 1528 | output, 1529 | get_cmd_string(&cmd), 1530 | actual_args, 1531 | crate::Executable::Rustc, 1532 | ) 1533 | // remove tempdir 1534 | //tempdir.close().unwrap(); 1535 | } 1536 | 1537 | // https://github.com/rust-marker/marker 1538 | pub(crate) fn run_marker( 1539 | file: &Path, 1540 | // @TODO pass editions here? 1541 | _compiler_flags: &[&str], 1542 | global_tempdir_path: &PathBuf, 1543 | ) -> CommandOutput { 1544 | /* 1545 | LD_LIBRARY_PATH='/home/matthias/.rustup/toolchains/nightly-2023-11-16-x86_64-unknown-linux-gnu/lib:/home/matthias/.rustup/toolchains/nightly-2023-11-16-x86_64-unknown-linux-gnu/lib:/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib' 1546 | /home/matthias/.rustup/toolchains/nightly-2023-11-16-x86_64-unknown-linux-gnu/bin/marker_rustc_driver /home/matthias/.rustup/toolchains/nightly-2023-11-16-x86_64-unknown-linux-gnu/bin/rustc /tmp/GLACIER2/fixed/83017.rs 1547 | */ 1548 | 1549 | let has_main = std::fs::read_to_string(file) 1550 | .unwrap_or_default() 1551 | .contains("pub(crate) fn main("); 1552 | 1553 | let mut cmd = Command::new("/home/matthias/.rustup/toolchains/nightly-2023-11-16-x86_64-unknown-linux-gnu/bin/marker_rustc_driver"); 1554 | cmd.arg( 1555 | "/home/matthias/.rustup/toolchains/nightly-2023-11-16-x86_64-unknown-linux-gnu/bin/rustc", 1556 | ); 1557 | 1558 | if !has_main { 1559 | cmd.arg("--crate-type=lib"); 1560 | } 1561 | cmd.env("RUSTFLAGS", "-Z force-unstable-if-unmarked") 1562 | // .env("SYSROOT", &*SYSROOT_PATH) 1563 | .env("CARGO_TERM_COLOR", "never") 1564 | .env("LD_LIBRARY_PATH", "/home/matthias/.rustup/toolchains/nightly-2023-11-16-x86_64-unknown-linux-gnu/lib:/home/matthias/.rustup/toolchains/nightly-2023-11-16-x86_64-unknown-linux-gnu/lib:/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib") 1565 | .arg(file) 1566 | .arg("-Zunstable-options") 1567 | .arg("--edition=2024") 1568 | .args(["--cap-lints", "warn"]) 1569 | .args(["-o", "/dev/null"]) 1570 | .current_dir(global_tempdir_path); 1571 | 1572 | let output = prlimit_run_command(&mut cmd).unwrap(); 1573 | 1574 | CommandOutput::new( 1575 | output, 1576 | get_cmd_string(&cmd), 1577 | Vec::new(), 1578 | crate::Executable::Marker, 1579 | ) 1580 | } 1581 | 1582 | pub(crate) fn prlimit_run_command( 1583 | new_command: &mut std::process::Command, 1584 | ) -> std::result::Result { 1585 | // THIS SHOULD ONLY DO THE ABSOLUTE MINIMUM 1586 | // do not add any additional flags here to the cmd 1587 | 1588 | // deconstruct our previous Command and wrap it by a "prlimit run ..." 1589 | if cfg!(feature = "ci") { 1590 | // return as is 1591 | new_command.output() 1592 | } else { 1593 | let program = new_command.get_program(); 1594 | let args = new_command.get_args(); 1595 | let current_dir = new_command.get_current_dir(); 1596 | let envs = new_command 1597 | .get_envs() 1598 | .map(|(k, v)| { 1599 | ( 1600 | k, 1601 | v.unwrap_or_else(|| panic!("failed to unwrap env {:?}", k.to_str())), 1602 | ) 1603 | }) 1604 | .chain(std::iter::once(( 1605 | std::ffi::OsStr::new("RUSTC_ICE"), 1606 | std::ffi::OsStr::new("0"), 1607 | ))) 1608 | .collect::>(); 1609 | let full_miri = new_command 1610 | .get_args() 1611 | .chain(std::iter::once(program)) 1612 | .any(|s| s == std::ffi::OsStr::new("miri")); 1613 | 1614 | let mut cmd = Command::new("prlimit"); 1615 | cmd.arg("--noheadings"); 1616 | let runtime_limit = if full_miri { 1617 | // miri timout: 20 seconds 1618 | PROCESS_TIMEOUT_MIRI_S 1619 | } else { 1620 | // all other timeouts: 30 seconds 1621 | PROCESS_TIMEOUT_S 1622 | }; 1623 | cmd.arg(format!("--as={}", 3076_u32 * 1000_u32 * 1000_u32)); // 3 GB 1624 | cmd.arg(format!("--cpu={runtime_limit}")); 1625 | 1626 | cmd.arg(program); 1627 | cmd.args(args); 1628 | if let Some(dir) = current_dir { 1629 | cmd.current_dir(dir); 1630 | } 1631 | cmd.envs(envs); 1632 | cmd.output() 1633 | } 1634 | } 1635 | 1636 | pub(crate) fn file_compiles( 1637 | file: &std::path::PathBuf, 1638 | executable: &str, 1639 | global_tempdir_path: &PathBuf, 1640 | ) -> bool { 1641 | let has_main = std::fs::read_to_string(file) 1642 | .unwrap_or_default() 1643 | .contains("fn main("); 1644 | 1645 | let file = file.canonicalize().unwrap(); 1646 | let tempdir = TempDir::new_in(global_tempdir_path, "rustc_testrunner_tmpdir").unwrap(); 1647 | let tempdir_path = tempdir.path(); 1648 | 1649 | ["2015", "2018", "2021", "2024"] 1650 | .iter() 1651 | .map(|year| format!("--edition={year}")) 1652 | .any(|edition_flag| { 1653 | let mut cmd = Command::new(executable); 1654 | if !has_main { 1655 | cmd.arg("--crate-type=lib"); 1656 | } else { 1657 | cmd.arg("--crate-type=bin"); 1658 | } 1659 | cmd.arg(&file) 1660 | .arg("-Zno-codegen") 1661 | .arg("-Zforce-unstable-if-unmarked") 1662 | .arg(edition_flag) 1663 | .args(["--cap-lints", "warn"]) 1664 | .env("CARGO_TERM_COLOR", "never") 1665 | .current_dir(tempdir_path) 1666 | .env("CARGO_TERM_COLOR", "never") 1667 | .env("SYSROOT", &*SYSROOT_PATH); 1668 | 1669 | matches!( 1670 | prlimit_run_command(&mut cmd) 1671 | .ok() 1672 | .map(|x| x.status.success()), 1673 | Some(true) 1674 | ) 1675 | }) 1676 | } 1677 | 1678 | pub(crate) fn file_compiles_from_string( 1679 | file_content: &String, 1680 | executable: &str, 1681 | global_tempdir_path: &PathBuf, 1682 | ) -> bool { 1683 | let has_main = file_content.contains("fn main("); 1684 | 1685 | let tempdir = TempDir::new_in(global_tempdir_path, "compiles_from_string_tempdir").unwrap(); 1686 | let tempdir_path = tempdir.path(); 1687 | 1688 | let file_path = tempdir_path.join("file.rs"); 1689 | 1690 | let mut file_handle = 1691 | std::fs::File::create(&file_path).expect("failed to create file_compiles_from_string file"); 1692 | 1693 | file_handle.write_all(file_content.as_bytes()).unwrap(); 1694 | 1695 | // to path 1696 | let file = file_path; 1697 | ["2015", "2018", "2021", "2024"] 1698 | .iter() 1699 | .map(|year| format!("--edition={year}")) 1700 | .any(|edition_flag| { 1701 | let mut cmd = Command::new(executable); 1702 | if !has_main { 1703 | cmd.arg("--crate-type=lib"); 1704 | } else { 1705 | cmd.arg("--crate-type=bin"); 1706 | } 1707 | cmd.arg(&file) 1708 | .arg("-Zno-codegen") 1709 | .arg("-Zforce-unstable-if-unmarked") 1710 | .arg(edition_flag) 1711 | .args(["--cap-lints", "warn"]) 1712 | .env("CARGO_TERM_COLOR", "never") 1713 | .current_dir(tempdir_path) 1714 | .env("CARGO_TERM_COLOR", "never") 1715 | .env("SYSROOT", &*SYSROOT_PATH); 1716 | 1717 | matches!( 1718 | prlimit_run_command(&mut cmd) 1719 | .ok() 1720 | .map(|x| x.status.success()), 1721 | Some(true) 1722 | ) 1723 | }) 1724 | } 1725 | 1726 | pub(crate) fn incremental_stress_test( 1727 | file_a: &std::path::PathBuf, 1728 | files: &Vec, 1729 | executable: &str, 1730 | global_tempdir_path: &PathBuf, 1731 | ) -> Option<(Output, String, Vec, PathBuf, PathBuf)> { 1732 | use rand::seq::SliceRandom; 1733 | 1734 | let file_b = files.choose(&mut rand::thread_rng()).unwrap(); 1735 | 1736 | let files = [&file_a, &file_b]; 1737 | 1738 | let tempdir = TempDir::new_in(global_tempdir_path, "rustc_testrunner_tmpdir").unwrap(); 1739 | let tempdir_path = tempdir.path(); 1740 | 1741 | let mut cmd = Command::new("DUMMY"); 1742 | let mut output = None; 1743 | let mut actual_args = Vec::new(); 1744 | 1745 | // make sure both files compile 1746 | for file in files { 1747 | if !file_compiles(file, executable, global_tempdir_path) { 1748 | return None; 1749 | } 1750 | } 1751 | // both files compile, continue with actual incremental checking 1752 | eprintln!("found possible pair: {files:?}"); 1753 | for i in &[0_usize, 1_usize] { 1754 | let file = files[*i]; 1755 | 1756 | let has_main = std::fs::read_to_string(file) 1757 | .unwrap_or_default() 1758 | .contains("fn main("); 1759 | 1760 | let mut command = Command::new(executable); 1761 | 1762 | if !has_main { 1763 | command.arg("--crate-type=lib"); 1764 | } 1765 | command 1766 | .arg(file) 1767 | // avoid error: the generated executable for the input file .. onflicts with the existing directory.. 1768 | .arg(format!("-o{}/{}", tempdir_path.display(), i)) 1769 | .arg(format!("-Cincremental={}", tempdir_path.display())) 1770 | .arg("-Zincremental-verify-ich=yes") 1771 | .arg("-Csave-temps=yes") 1772 | .arg("--edition=2021"); 1773 | 1774 | //dbg!(&command); 1775 | 1776 | // the output from the second invocation is the interesting one! 1777 | output = Some(prlimit_run_command(&mut command)); 1778 | actual_args = command 1779 | .get_args() 1780 | .map(|s| s.to_owned()) 1781 | .collect::>(); 1782 | //dbg!(&output); 1783 | cmd = command; 1784 | } 1785 | 1786 | let output = output.map(|output| output.unwrap()).unwrap(); 1787 | 1788 | tempdir.close().unwrap(); 1789 | //dbg!(&output); 1790 | 1791 | let mut cmd_str = get_cmd_string(&cmd); 1792 | cmd_str.push_str(&file_a.display().to_string()); 1793 | cmd_str.push_str(" | "); 1794 | cmd_str.push_str(&file_b.display().to_string()); 1795 | 1796 | Some((output, cmd_str, actual_args, file_a.clone(), file_b.clone())) 1797 | } 1798 | -------------------------------------------------------------------------------- /src/smolfuzz.rs: -------------------------------------------------------------------------------- 1 | use itertools::Itertools; 2 | use std::io::prelude::*; 3 | 4 | /// https://users.rust-lang.org/t/how-can-i-create-a-function-with-all-permutations-of-all-digits-up-to-the-number-of-permutations-asked/75675/2 5 | fn variations_up_to_length(items: &[char]) -> impl Iterator + '_ { 6 | (1..=items.len()) 7 | .flat_map(|n| { 8 | std::iter::repeat(items.iter()) 9 | .take(n) 10 | .multi_cartesian_product() 11 | }) 12 | .map(|v| v.into_iter().collect::()) 13 | .filter(|x| x.len() == items.len()) 14 | } 15 | 16 | pub(crate) fn gen_smol_code_char_set() -> impl Iterator { 17 | const CHARS: &[char] = &['[', ']', '#', '=', 'e', 'e', 'e']; 18 | 19 | // snippet will have length of the input charscd / 20 | //const SNIPPET_LENGTH: usize = 5; 21 | const ITEM_LIMIT: usize = 10_0000; 22 | 23 | variations_up_to_length(CHARS).take(ITEM_LIMIT) 24 | } 25 | 26 | pub(crate) fn codegen_smolfuzz() { 27 | gen_smol_code_char_set().enumerate().for_each(|(id, code)| { 28 | let mut file = std::fs::File::create(std::path::PathBuf::from(format!("{id}.rs"))).unwrap(); 29 | file.write_all(code.as_bytes()).unwrap(); 30 | }) 31 | } 32 | -------------------------------------------------------------------------------- /test.rs: -------------------------------------------------------------------------------- 1 | pub fn main() {} 2 | --------------------------------------------------------------------------------