Skip to content

Commit 948af82

Browse files
asaf-swclaude
andauthored
blockifier: remove stale allow(dead_code) (#14398)
Removes a stale `#[allow(dead_code)]` from the free function `get_compiled_class_hash_v2` in `blockifier::state::utils`. The function is NOT dead — only the annotation is removed; no behavior changes. Why it's stale: - The function is `pub` and lives in a fully public module path (`pub mod state` in lib.rs -> `pub mod utils` in state.rs), so it is part of blockifier's public API. The `dead_code` lint never fires on items reachable from the crate root via public visibility, so the annotation suppresses nothing. - It is, in fact, actively used: `blockifier_reexecution` imports it as `default_get_compiled_class_hash_v2` and calls it from both `rpc_state_reader.rs` and `offline_state_reader.rs` (`StateReader::get_compiled_class_hash_v2` default-impl plumbing), and `starknet_transaction_prover` calls it from `running/classes_provider.rs`. Verification (RUSTC_WRAPPER unset, CARGO_INCREMENTAL=0): - `scripts/rust_fmt.sh` — clean - `cargo build -p blockifier` — zero dead_code/unused warnings (default cfg) - `cargo clippy -p blockifier --all-targets` — clean; this compiles the lib, test and bench targets, so it also confirms the `--tests` cfg builds with zero dead_code warnings. This is a pure lint-attribute removal (no codegen/runtime effect), so the two clean builds above are the load-bearing proof. Environmental note: `cargo check -p blockifier --features cairo_native` could not run in this sandbox — the `tblgen v0.5.2` build dependency (an LLVM/MLIR TableGen binding pulled in by `cairo_native`) fails its build script because the full LLVM-19 tooling is unavailable here. This failure happens before blockifier is compiled, is unrelated to removing a lint attribute, and reproduces identically on `main`. The cairo_native-gated match arm is unaffected by this change. Co-authored-by: Claude <noreply@anthropic.com>
1 parent a215c31 commit 948af82

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

crates/blockifier/src/state/utils.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use crate::state::state_api::{StateReader, StateResult};
99
/// Returns the compiled class hash (v2) of the given class hash.
1010
/// Returns `StateError::MissingCompiledClassHashV2` if no v1_class is found for the given class
1111
/// hash.
12-
#[allow(dead_code)]
1312
pub fn get_compiled_class_hash_v2(
1413
state_reader: &impl StateReader,
1514
class_hash: ClassHash,

0 commit comments

Comments
 (0)