Skip to content

chore: remove dead parse_comptime_decl method from parser - #28

Merged
hyperpolymath merged 1 commit into
mainfrom
cleanup/remove-parse-comptime-decl
May 15, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
cleanup/remove-parse-comptime-decl

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Remove the unused parse_comptime_decl helper from crates/my-lang/src/parser.rs. It was never called -- the comptime top-level declaration is handled inline in parse_top_level (the Some(TokenKind::Comptime) arm reads the comptime keyword, optionally branches to parse_orchestrate_decl, and otherwise builds a ComptimeDecl directly from the block).

Identified during the #22 dead-code review (PR4 / #26) but deferred at the time to avoid merge-conflict risk with the depth-guard PR #21 also modifying parser.rs. With #21 merged this is a one-method delete.

Test plan

  • cargo test -p my-lang --lib parser:: -- 32/32 pass (same count as before; the method had no associated tests).
  • cargo clippy -p my-lang --lib --no-deps -- the lone parse_comptime_decl is never used warning at parser.rs:825 is gone.

This is the deferred one-liner from #26.

`parse_comptime_decl` was never called -- the `comptime` top-level
declaration is handled inline in `parse_top_level` (the `Some(TokenKind::Comptime)`
arm reads `comptime`, optionally branches to `parse_orchestrate_decl`,
and otherwise builds a `ComptimeDecl` directly from the block). The
separate helper was a leftover from an earlier factoring.

Identified during the #22 dead-code review (PR4 / #26) but deferred at
the time to avoid merge-conflict risk with the depth-guard PR #21 also
modifying parser.rs. With #21 merged this is a one-method delete.

Tests: `cargo test -p my-lang --lib parser::` -- 32/32 pass (same count
as before; the method had no associated tests).

Clippy: the lone `parse_comptime_decl is never used` warning at
parser.rs:825 is now gone.
@github-actions

Copy link
Copy Markdown

🔍 Hypatia Security Scan

Findings: 44 issues detected

Severity Count
🔴 Critical 8
🟠 High 18
🟡 Medium 18

⚠️ Action Required: Critical security issues found!

View findings
[
  {
    "reason": "codeql.yml lists `language: javascript-typescript` but the repo has no source files in any CodeQL-scannable language. The analyze job will exit 'no source files' on every run. Switch the matrix to `actions` (which scans workflow files — every repo has those).",
    "type": "codeql_language_matrix_mismatch",
    "file": "codeql.yml",
    "action": "switch_codeql_matrix_to_actions",
    "rule_module": "workflow_audit",
    "severity": "high"
  },
  {
    "reason": "Admitted leaves proof hole (1 occurrences, CWE-704)",
    "type": "admitted",
    "file": "/home/runner/work/my-lang/my-lang/proofs/verification/coq/Typing.v",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "Docker reference in Nickel config -- RSR requires Podman/Containerfile (1 occurrences, CWE-1104)",
    "type": "ncl_docker_not_podman",
    "file": "/home/runner/work/my-lang/my-lang/.machine_readable/svc/k9/my-lang-metadata.k9.ncl",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (2 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/my-lang/my-lang/src/proptest.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "panic! macro causes unrecoverable crash (1 occurrences, CWE-754)",
    "type": "panic_macro",
    "file": "/home/runner/work/my-lang/my-lang/src/proptest.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "unwrap_or(0) with dangerous default (1 occurrences, CWE-754)",
    "type": "unwrap_dangerous_default",
    "file": "/home/runner/work/my-lang/my-lang/playground/hives/me/crates/parser/src/lib.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "critical"
  },
  {
    "reason": "expect() in hot path (80 occurrences, CWE-754)",
    "type": "expect_in_hot_path",
    "file": "/home/runner/work/my-lang/my-lang/playground/hives/me/crates/parser/src/lib.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "medium"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (2 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/my-lang/my-lang/dialects/solo/compiler/src/lexer.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (1 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/my-lang/my-lang/lib/common/string.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  },
  {
    "reason": "unwrap() without prior check -- DoS via panic (13 occurrences, CWE-754)",
    "type": "unwrap_without_check",
    "file": "/home/runner/work/my-lang/my-lang/lib/common/concurrency.rs",
    "action": "flag",
    "rule_module": "code_safety",
    "severity": "high"
  }
]

Powered by Hypatia Neurosymbolic CI/CD Intelligence

@hyperpolymath
hyperpolymath merged commit 6eff13f into main May 15, 2026
19 checks passed
@hyperpolymath
hyperpolymath deleted the cleanup/remove-parse-comptime-decl branch May 15, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant