fix: resolve all cargo compiler warnings
- Fix unused import std::io::Read in interpreter.rs by using qualified call - Add #[allow(dead_code)] to CGenError.span (kept for future error reporting) - Add #[allow(dead_code)] to local_vars field (planned for free variable analysis) - Add #[allow(dead_code)] to unbox_value and emit_all_scope_cleanup methods All 263 tests pass. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -50,6 +50,7 @@ use std::fmt::Write;
|
|||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct CGenError {
|
pub struct CGenError {
|
||||||
pub message: String,
|
pub message: String,
|
||||||
|
#[allow(dead_code)]
|
||||||
pub span: Option<Span>,
|
pub span: Option<Span>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,6 +97,7 @@ pub struct CBackend {
|
|||||||
/// Closures to emit (collected during expression generation)
|
/// Closures to emit (collected during expression generation)
|
||||||
closures: Vec<ClosureInfo>,
|
closures: Vec<ClosureInfo>,
|
||||||
/// Variables in scope (for free variable analysis)
|
/// Variables in scope (for free variable analysis)
|
||||||
|
#[allow(dead_code)]
|
||||||
local_vars: HashSet<String>,
|
local_vars: HashSet<String>,
|
||||||
/// Functions that return closures
|
/// Functions that return closures
|
||||||
closure_returning_functions: HashSet<String>,
|
closure_returning_functions: HashSet<String>,
|
||||||
@@ -2388,6 +2390,7 @@ impl CBackend {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(dead_code)]
|
||||||
fn unbox_value(&self, val: &str, type_hint: Option<&str>) -> String {
|
fn unbox_value(&self, val: &str, type_hint: Option<&str>) -> String {
|
||||||
match type_hint {
|
match type_hint {
|
||||||
Some("LuxInt") => format!("lux_unbox_int({})", val),
|
Some("LuxInt") => format!("lux_unbox_int({})", val),
|
||||||
@@ -3323,6 +3326,7 @@ impl CBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Emit decrefs for all variables in all scopes (for early return)
|
/// Emit decrefs for all variables in all scopes (for early return)
|
||||||
|
#[allow(dead_code)]
|
||||||
fn emit_all_scope_cleanup(&mut self) {
|
fn emit_all_scope_cleanup(&mut self) {
|
||||||
// Collect all decrefs first to avoid borrow issues
|
// Collect all decrefs first to avoid borrow issues
|
||||||
let decrefs: Vec<String> = self.rc_scopes.iter().rev()
|
let decrefs: Vec<String> = self.rc_scopes.iter().rev()
|
||||||
|
|||||||
@@ -3442,11 +3442,7 @@ impl Interpreter {
|
|||||||
|
|
||||||
// Read body
|
// Read body
|
||||||
let mut body = String::new();
|
let mut body = String::new();
|
||||||
{
|
let _ = std::io::Read::read_to_string(&mut request.as_reader(), &mut body);
|
||||||
use std::io::Read;
|
|
||||||
let reader = request.as_reader();
|
|
||||||
let _ = reader.read_to_string(&mut body);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Extract headers
|
// Extract headers
|
||||||
let headers: Vec<Value> = request.headers()
|
let headers: Vec<Value> = request.headers()
|
||||||
|
|||||||
Reference in New Issue
Block a user