Expand to 265 rules / 26 categories, refresh for Rust 1.96, add compile-checked CI#2
Merged
Merged
Conversation
Add unsafe, concurrency, conversions, and pattern-matching categories plus rules across existing ones, and correct advice that was outdated for Rust 1.96.
Type-check every rust code block in the rules and fix real bugs in Good examples.
Also add an index generator and CONTRIBUTING/CHANGELOG.
f98abca to
dad723a
Compare
The SIMD/target-cpu examples returned () from cfg(target_arch="x86_64") blocks and unsafe fns, so they only compiled on non-x86 hosts (where the blocks are cfg'd out). Make them return their declared types and compile on every arch.
Add checks/check.sh as the single entrypoint CI and contributors both run. Pin the toolchain and compile target via checks/rust-toolchain.toml (Rust 1.95.0, x86_64-unknown-linux-gnu) and commit Cargo.lock so example checks are deterministic across machines. Baseline regenerated for the x86_64 target.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Grows the skill from 179 rules / 14 categories to 265 rules / 26 categories, refreshes everything for the Rust 2024 edition / Rust 1.96, and makes every code example compile-verified and guarded by CI.
New categories (86 new rules)
unsafe-), Concurrency (conc-), Conversions (conv-), Pattern Matching (pat-)num-), Serde (serde-)macro-), Observability (obs-)closure-)const-), Trait & Generics Design (trait-), Collections (coll-)…plus new rules added across existing categories (e.g.
mem-take-replace,async-fn-in-trait,api-impl-fromiterator,perf-ahash).Currency & correctness
&mut Tis notCopy,impl Traitin traits is stable (1.75),collect_intois still nightly,resolver = "3",env::set_varis nowunsafe,MaybeUninitarray conversions (stable 1.95), and a false "specialization works on stable" claim in blanket impls.Tooling & maintainability
checks/compile harness: extracts every```rustblock and type-checks it; classifies failures by compiler error code (real bugs vs undefined-symbol fragments). 275 examples compile clean on Rust 1.95.checks/gen_index.pygeneratesSKILL.md's table + Quick Reference and the rule counts from the rule files, so the index can't drift..github/workflows/ci.yml): validates rule structure, links, and index parity, then compile-checks the examples against a baseline (fails only on new regressions).CONTRIBUTING.mdandCHANGELOG.md; expanded README + per-rule sourcing.Verification
checks/validate.py,checks/gen_index.py --check, and the compile baseline all pass locally on Rust 1.95.🤖 Generated with Claude Code