From a10d8d7f9493c6f5975391a469f379eef9a3dd39 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Tue, 22 Jul 2025 20:37:45 -0500 Subject: [PATCH 1/2] silence clippy errors with features disabled When compiling with features disabled, there are lots of clippy warnings. This PR silences them. For the utils file, I am using a bit of a hammer and just allowing unused stuff in the whole file. Due to the box of utilities nature of this file, it'll always be the case that things will be unused depending on the feature-set. --- core/ext/mod.rs | 5 ++++- core/io/unix.rs | 7 ++++++- core/lib.rs | 2 ++ core/util.rs | 1 + core/vdbe/execute.rs | 4 +++- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/core/ext/mod.rs b/core/ext/mod.rs index 52761741b..7e5cb375a 100644 --- a/core/ext/mod.rs +++ b/core/ext/mod.rs @@ -4,9 +4,11 @@ mod vtab_xconnect; use crate::schema::{Schema, Table}; #[cfg(all(target_os = "linux", feature = "io_uring"))] use crate::UringIO; -use crate::{function::ExternalFunc, Connection, Database, LimboError, IO}; +use crate::{function::ExternalFunc, Connection, Database}; use crate::{vtab::VirtualTable, SymbolTable}; #[cfg(feature = "fs")] +use crate::{LimboError, IO}; +#[cfg(feature = "fs")] pub use dynamic::{add_builtin_vfs_extensions, add_vfs_module, list_vfs_modules, VfsMod}; use std::{ ffi::{c_char, c_void, CStr, CString}, @@ -168,6 +170,7 @@ impl Database { syms, schema: schema_mutex_ptr as *mut c_void, })); + #[allow(unused)] let mut ext_api = ExtensionApi { ctx: ctx as *mut c_void, register_scalar_function, diff --git a/core/io/unix.rs b/core/io/unix.rs index d15a23a53..c07285bc9 100644 --- a/core/io/unix.rs +++ b/core/io/unix.rs @@ -16,7 +16,9 @@ use std::{ }; use std::{io::ErrorKind, sync::Arc}; -use tracing::{debug, instrument, trace, Level}; +#[cfg(feature = "fs")] +use tracing::debug; +use tracing::{instrument, trace, Level}; struct OwnedCallbacks(UnsafeCell); // We assume we locking on IO level is done by user. @@ -25,6 +27,7 @@ unsafe impl Sync for OwnedCallbacks {} struct BorrowedCallbacks<'io>(UnsafeCell<&'io mut Callbacks>); impl OwnedCallbacks { + #[allow(dead_code)] fn new() -> Self { Self(UnsafeCell::new(Callbacks::new())) } @@ -57,6 +60,7 @@ impl BorrowedCallbacks<'_> { struct EventsHandler(UnsafeCell); impl EventsHandler { + #[allow(dead_code)] fn new() -> Self { Self(UnsafeCell::new(Events::new())) } @@ -87,6 +91,7 @@ impl BorrowedPollHandler<'_> { } impl PollHandler { + #[allow(dead_code)] fn new() -> Self { Self(UnsafeCell::new(Poller::new().unwrap())) } diff --git a/core/lib.rs b/core/lib.rs index 946898db8..e1b5c0491 100644 --- a/core/lib.rs +++ b/core/lib.rs @@ -45,6 +45,7 @@ use crate::storage::sqlite3_ondisk::is_valid_page_size; use crate::storage::{header_accessor, wal::DummyWAL}; use crate::translate::optimizer::optimize_plan; use crate::translate::pragma::TURSO_CDC_DEFAULT_TABLE_NAME; +#[cfg(feature = "fs")] use crate::util::{OpenMode, OpenOptions}; use crate::vtab::VirtualTable; use core::str; @@ -935,6 +936,7 @@ impl Connection { } pub fn list_vfs(&self) -> Vec { + #[allow(unused_mut)] let mut all_vfs = vec![String::from("memory")]; #[cfg(feature = "fs")] { diff --git a/core/util.rs b/core/util.rs index 4e485d7d6..d6df82059 100644 --- a/core/util.rs +++ b/core/util.rs @@ -1,3 +1,4 @@ +#![allow(unused)] use crate::translate::expr::WalkControl; use crate::types::IOResult; use crate::IO; diff --git a/core/vdbe/execute.rs b/core/vdbe/execute.rs index ef9aa97ad..ac103cbdc 100644 --- a/core/vdbe/execute.rs +++ b/core/vdbe/execute.rs @@ -90,8 +90,10 @@ use crate::{ use super::{make_record, Program, ProgramState, Register}; use crate::{ - bail_constraint_error, must_be_btree_cursor, resolve_ext_path, MvStore, Pager, Result, + bail_constraint_error, must_be_btree_cursor, MvStore, Pager, Result, }; +#[cfg(feature = "fs")] +use crate::resolve_ext_path; macro_rules! return_if_io { ($expr:expr) => { From a13fc3515e46ef4bf2d31f869cc7b10e47ea26fc Mon Sep 17 00:00:00 2001 From: PThorpe92 Date: Tue, 22 Jul 2025 21:47:15 -0400 Subject: [PATCH 2/2] Fix cargo fmt warning --- core/vdbe/execute.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/vdbe/execute.rs b/core/vdbe/execute.rs index ac103cbdc..855658201 100644 --- a/core/vdbe/execute.rs +++ b/core/vdbe/execute.rs @@ -89,11 +89,10 @@ use crate::{ }; use super::{make_record, Program, ProgramState, Register}; -use crate::{ - bail_constraint_error, must_be_btree_cursor, MvStore, Pager, Result, -}; + #[cfg(feature = "fs")] use crate::resolve_ext_path; +use crate::{bail_constraint_error, must_be_btree_cursor, MvStore, Pager, Result}; macro_rules! return_if_io { ($expr:expr) => {