From e2dc1a3f8524834a82263676a45842f41965e8a7 Mon Sep 17 00:00:00 2001 From: sofia Date: Thu, 17 Jul 2025 14:31:40 +0300 Subject: [PATCH] Fix some warnings --- reid/src/codegen.rs | 18 ------------------ reid/src/mir/impl.rs | 6 +----- reid/src/mir/linker.rs | 1 - reid/src/mir/typecheck.rs | 2 +- reid/src/token_stream.rs | 7 ------- 5 files changed, 2 insertions(+), 32 deletions(-) diff --git a/reid/src/codegen.rs b/reid/src/codegen.rs index 94d9fca..a85078c 100644 --- a/reid/src/codegen.rs +++ b/reid/src/codegen.rs @@ -68,24 +68,6 @@ pub enum StackValueKind { Any(InstructionValue), } -impl StackValueKind { - unsafe fn get_instr(&self) -> &InstructionValue { - match self { - StackValueKind::Immutable(val) => val, - StackValueKind::Mutable(val) => val, - StackValueKind::Any(val) => val, - } - } - - fn with_instr(&self, instr: InstructionValue) -> StackValueKind { - match self { - StackValueKind::Immutable(_) => StackValueKind::Immutable(instr), - StackValueKind::Mutable(_) => StackValueKind::Mutable(instr), - StackValueKind::Any(_) => StackValueKind::Any(instr), - } - } -} - impl<'ctx, 'a> Scope<'ctx, 'a> { fn with_block(&self, block: Block<'ctx>) -> Scope<'ctx, 'a> { Scope { diff --git a/reid/src/mir/impl.rs b/reid/src/mir/impl.rs index e175b68..6969043 100644 --- a/reid/src/mir/impl.rs +++ b/reid/src/mir/impl.rs @@ -1,8 +1,4 @@ -use super::{ - typecheck::ErrorKind, - typerefs::{ScopeTypeRefs, TypeRef, TypeRefs}, - VagueType as Vague, *, -}; +use super::{typecheck::ErrorKind, typerefs::TypeRefs, VagueType as Vague, *}; #[derive(Debug, Clone)] pub enum ReturnTypeOther { diff --git a/reid/src/mir/linker.rs b/reid/src/mir/linker.rs index c212ef2..f336f47 100644 --- a/reid/src/mir/linker.rs +++ b/reid/src/mir/linker.rs @@ -2,7 +2,6 @@ use std::{ cell::RefCell, collections::HashMap, convert::Infallible, - fmt::Error, fs::{self}, path::PathBuf, rc::Rc, diff --git a/reid/src/mir/typecheck.rs b/reid/src/mir/typecheck.rs index b2c97cc..c39fcf2 100644 --- a/reid/src/mir/typecheck.rs +++ b/reid/src/mir/typecheck.rs @@ -6,7 +6,7 @@ use crate::{mir::*, util::try_all}; use VagueType as Vague; use super::{ - pass::{Pass, PassState, ScopeFunction, ScopeVariable, Storage}, + pass::{Pass, PassState, ScopeFunction, ScopeVariable}, typerefs::TypeRefs, }; diff --git a/reid/src/token_stream.rs b/reid/src/token_stream.rs index 7f9853b..824f521 100644 --- a/reid/src/token_stream.rs +++ b/reid/src/token_stream.rs @@ -162,13 +162,6 @@ impl<'a, 'b> TokenStream<'a, 'b> { end: self.position, }) } - - pub fn get_one_token_range(&self) -> TokenRange { - TokenRange { - start: self.position - 1, - end: self.position, - } - } } impl Drop for TokenStream<'_, '_> {