Skip to content

Commit 6a23bc6

Browse files
committed
Fixed compile errors and warnings on Windows
1 parent c39bb46 commit 6a23bc6

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

crates/bench/benches/generic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use spacetimedb_testing::modules::{Csharp, Rust};
1515

1616
#[cfg(target_env = "msvc")]
1717
#[global_allocator]
18-
static GLOBAL: MiMalloc = MiMalloc;
18+
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
1919

2020
#[cfg(not(target_env = "msvc"))]
2121
use tikv_jemallocator::Jemalloc;

crates/bench/benches/special.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::sync::OnceLock;
1515

1616
#[cfg(target_env = "msvc")]
1717
#[global_allocator]
18-
static GLOBAL: MiMalloc = MiMalloc;
18+
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
1919

2020
#[cfg(not(target_env = "msvc"))]
2121
use tikv_jemallocator::Jemalloc;

crates/core/src/db/relational_db.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,6 +1939,7 @@ mod tests {
19391939
use spacetimedb_sats::buffer::BufReader;
19401940
use spacetimedb_sats::product;
19411941
use spacetimedb_schema::schema::RowLevelSecuritySchema;
1942+
#[cfg(unix)]
19421943
use spacetimedb_snapshot::Snapshot;
19431944
use spacetimedb_table::read_column::ReadColumn;
19441945
use spacetimedb_table::table::RowRef;
@@ -2909,6 +2910,7 @@ mod tests {
29092910
let (dir, repo) = make_snapshot(root.clone(), Identity::ZERO, 0, CompressType::None, true);
29102911
stdb.take_snapshot(&repo)?;
29112912

2913+
#[cfg(unix)]
29122914
let total_objects = repo.size_on_disk()?.object_count;
29132915
// Another snapshots that will hardlink part of the first one
29142916
for i in 0..2 {

crates/core/src/worker_metrics/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,14 +265,15 @@ pub static WORKER_METRICS: Lazy<WorkerMetrics> = Lazy::new(WorkerMetrics::new);
265265
#[cfg(not(target_env = "msvc"))]
266266
use tikv_jemalloc_ctl::{epoch, stats};
267267

268+
#[cfg(not(target_env = "msvc"))]
268269
static SPAWN_JEMALLOC_GUARD: Once = Once::new();
269-
pub fn spawn_jemalloc_stats(node_id: String) {
270+
pub fn spawn_jemalloc_stats(_node_id: String) {
270271
#[cfg(not(target_env = "msvc"))]
271272
SPAWN_JEMALLOC_GUARD.call_once(|| {
272273
spawn(async move {
273-
let allocated_bytes = WORKER_METRICS.jemalloc_allocated_bytes.with_label_values(&node_id);
274-
let resident_bytes = WORKER_METRICS.jemalloc_resident_bytes.with_label_values(&node_id);
275-
let active_bytes = WORKER_METRICS.jemalloc_active_bytes.with_label_values(&node_id);
274+
let allocated_bytes = WORKER_METRICS.jemalloc_allocated_bytes.with_label_values(&_node_id);
275+
let resident_bytes = WORKER_METRICS.jemalloc_resident_bytes.with_label_values(&_node_id);
276+
let active_bytes = WORKER_METRICS.jemalloc_active_bytes.with_label_values(&_node_id);
276277

277278
let e = epoch::mib().unwrap();
278279
loop {

crates/paths/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,13 +268,14 @@ impl SpacetimePaths {
268268

269269
#[cfg(test)]
270270
mod tests {
271-
use std::ffi::{OsStr, OsString};
272271
use std::path::Path;
273272

274273
use super::*;
275274

275+
#[cfg(not(windows))]
276276
mod vars {
277277
use super::*;
278+
use std::ffi::{OsStr, OsString};
278279
struct ResetVar<'a>(&'a str, Option<OsString>);
279280
impl Drop for ResetVar<'_> {
280281
fn drop(&mut self) {

crates/update/src/proxy.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::process::ExitCode;
99

1010
pub(crate) fn run_cli(
1111
paths: Option<&SpacetimePaths>,
12-
argv0: Option<&OsStr>,
12+
_argv0: Option<&OsStr>,
1313
args: Vec<OsString>,
1414
) -> anyhow::Result<ExitCode> {
1515
let parse_args = || PartialCliArgs::parse(&args);
@@ -44,8 +44,8 @@ pub(crate) fn run_cli(
4444
#[cfg(unix)]
4545
{
4646
use std::os::unix::process::CommandExt;
47-
if let Some(argv0) = argv0 {
48-
cmd.arg0(argv0);
47+
if let Some(_argv0) = _argv0 {
48+
cmd.arg0(_argv0);
4949
}
5050
};
5151
let exec_result = exec_replace(&mut cmd).with_context(|| format!("exec failed for {}", cli_path.display()));

0 commit comments

Comments
 (0)