refactor(cleanup): Remove unused BindingContext methods

Removed dead code from BindingContext after analysis of actual usage:

**Deleted Methods (3)**:
- contains() - never used
- len() - never used
- is_empty() - never used

**Feature Gate Fix**:
- binding_map(): Added #[cfg(feature = "normalized_dev")]
  - Method only used within normalized_dev feature gates
  - Prevents "never used" warning in standard builds

**Analysis**:
BindingContext is actively used via:
- lookup() - variable name to BindingId resolution
- insert() - variable registration
- remove() - variable removal
- binding_map() - internal map access (normalized_dev only)

Files using binding_ctx:
- vars/lexical_scope.rs (5 usages)
- pattern3_with_if_phi.rs (2 usages)
- pattern4_with_continue.rs (2 usages)
- trim_loop_lowering.rs (2 usages)
- pattern2_inputs_facts_box.rs (1 usage)

**Result**: All BindingContext dead_code warnings eliminated

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-24 04:18:24 +09:00
parent 2da730de35
commit f1ff305c08

View File

@ -73,24 +73,12 @@ impl BindingContext {
}
/// Get immutable reference to the binding map (for BindingMapProvider)
pub fn binding_map(&self) -> &BTreeMap<String, BindingId> {
/// Phase 136: Used only with normalized_dev feature
#[cfg(feature = "normalized_dev")]
pub(super) fn binding_map(&self) -> &BTreeMap<String, BindingId> {
&self.binding_map
}
/// Check if a variable has a binding
pub fn contains(&self, name: &str) -> bool {
self.binding_map.contains_key(name)
}
/// Get the number of bindings
pub fn len(&self) -> usize {
self.binding_map.len()
}
/// Check if there are no bindings
pub fn is_empty(&self) -> bool {
self.binding_map.is_empty()
}
}
#[cfg(test)]