Skip to content

Commit 8955931

Browse files
olwangclaude
andcommitted
feat(selfhost-checker): add RS0009 (invalid pure effect)
A pure fn is flagged for a resource return, a mut/take param, a retains item, or a body with/manage/non-pure-call. Non-pure-call resolution mirrors the analyzer: type-qualified calls and constructors/enum-variants/pure-fns are allowed; declared non-pure fns flag; unresolved names are ignored. Adds a resource/sum-variant/pure-fn pre-pass. Corpus-green over 619 files. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e559c1f commit 8955931

2 files changed

Lines changed: 336 additions & 2 deletions

File tree

crates/rsscript/src/selfhost_parity.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ fn parser_parity_corpus() {
503503
// ---------------------------------------------------------------------------
504504

505505
/// Diagnostic codes the rss checker is expected to reproduce.
506-
const CHECKER_TARGET_CODES: &[&str] = &["RS0002","RS0003","RS0004","RS0005","RS0006","RS0007","RS0008","RS0010","RS0011","RS0012","RS0016","RS0017","RS0024","RS0028","RS0033"];
506+
const CHECKER_TARGET_CODES: &[&str] = &["RS0002","RS0003","RS0004","RS0005","RS0006","RS0007","RS0008","RS0009","RS0010","RS0011","RS0012","RS0016","RS0017","RS0024","RS0028","RS0033"];
507507

508508
fn is_target_code(code: &str) -> bool {
509509
CHECKER_TARGET_CODES.contains(&code)

0 commit comments

Comments
 (0)