Something went wrong. Try again.
Structural ast-grep rules for Rust, Nix and Mojo, with fixture tests and a pinned Mojo grammar
Something went wrong. Try again.
796 B · 25 lines
YAML
at main
1234567891011121314151617181920212223242526# A spawn per iteration creates threads proportional to input size; the OS# limit arrives before the loop does. The spawn-collect-join idiom (push the# handle, join after) is still matched - the handles bound the joins, not the# creation rate - so this stays a warning to justify, not an error.id: rust-thread-spawn-in-looplanguage: rustseverity: errormessage: >- This spawns an OS thread per iteration. Bound the concurrency: a fixed pool, scoped threads over chunks, or async tasks.files: - "**/*.rs"ignores: - "apps/wiki/vendor/**" - "safety/oxidized/**"rule: any: - pattern: thread::spawn($$$A) - pattern: std::thread::spawn($$$A) inside: any: - {kind: for_expression} - {kind: while_expression} - {kind: loop_expression} stopBy: end