diff --git a/crates/bindings/tests/fixtures/idc_receiver/lib.rs b/crates/bindings/tests/fixtures/idc_receiver/mod.rs similarity index 100% rename from crates/bindings/tests/fixtures/idc_receiver/lib.rs rename to crates/bindings/tests/fixtures/idc_receiver/mod.rs diff --git a/crates/bindings/tests/pass/outbox_arg_columns.rs b/crates/bindings/tests/pass/outbox_arg_columns.rs index 305bbd5c667..b899db39374 100644 --- a/crates/bindings/tests/pass/outbox_arg_columns.rs +++ b/crates/bindings/tests/pass/outbox_arg_columns.rs @@ -1,4 +1,4 @@ -#[path = "../fixtures/idc_receiver/lib.rs"] +#[path = "../fixtures/idc_receiver/mod.rs"] mod receiver; mod remote_bindings { diff --git a/crates/bindings/tests/test_utils.rs b/crates/bindings/tests/test_utils.rs index c8ac1848cb7..9ce6b867522 100644 --- a/crates/bindings/tests/test_utils.rs +++ b/crates/bindings/tests/test_utils.rs @@ -2,7 +2,7 @@ use spacetimedb::spacetimedb_lib::RawModuleDef; use spacetimedb::test_utils::{TestAuth, TestQueryError}; use spacetimedb::{reducer, table, AnonymousViewContext, Query, ReducerContext, Table, Timestamp, ViewContext}; -#[path = "fixtures/idc_receiver/lib.rs"] +#[path = "fixtures/idc_receiver/mod.rs"] mod receiver; #[table(accessor = test_utils_user, public)] diff --git a/crates/bindings/tests/ui/outbox_mutation.rs b/crates/bindings/tests/ui/outbox_mutation.rs index 3a2cc5c3447..2172b0e09f4 100644 --- a/crates/bindings/tests/ui/outbox_mutation.rs +++ b/crates/bindings/tests/ui/outbox_mutation.rs @@ -1,6 +1,6 @@ use spacetimedb::Table; -#[path = "../fixtures/idc_receiver/lib.rs"] +#[path = "../fixtures/idc_receiver/mod.rs"] mod receiver; #[spacetimedb::table( diff --git a/crates/bindings/tests/ui/outbox_receiver_typecheck.rs b/crates/bindings/tests/ui/outbox_receiver_typecheck.rs index 55cb1e0d732..5802e772769 100644 --- a/crates/bindings/tests/ui/outbox_receiver_typecheck.rs +++ b/crates/bindings/tests/ui/outbox_receiver_typecheck.rs @@ -1,4 +1,4 @@ -#[path = "../fixtures/idc_receiver/lib.rs"] +#[path = "../fixtures/idc_receiver/mod.rs"] mod receiver; #[spacetimedb::table(accessor = outbound_ping, outbox(receiver::receive_ping))] pub struct OutboundPing { diff --git a/crates/bindings/tests/ui/outbox_receiver_typecheck.stderr b/crates/bindings/tests/ui/outbox_receiver_typecheck.stderr index 5bc3baf3a49..3db4bf21813 100644 --- a/crates/bindings/tests/ui/outbox_receiver_typecheck.stderr +++ b/crates/bindings/tests/ui/outbox_receiver_typecheck.stderr @@ -1,5 +1,5 @@ error: outbox has no column matching remote reducer parameter `body` - --> tests/ui/../fixtures/idc_receiver/lib.rs + --> tests/ui/../fixtures/idc_receiver/mod.rs | | / compile_error!(concat!( | | "outbox has no column matching remote reducer parameter `", @@ -16,7 +16,7 @@ error: outbox has no column matching remote reducer parameter `body` = note: this error originates in the macro `__outbox_receiver::__spacetimedb_typecheck_outbox_receive_ping_body` which comes from the expansion of the attribute macro `spacetimedb::table` (in Nightly builds, run with -Z macro-backtrace for more info) error: outbox has multiple columns matching remote reducer parameter `body` - --> tests/ui/../fixtures/idc_receiver/lib.rs + --> tests/ui/../fixtures/idc_receiver/mod.rs | | / compile_error!(concat!( | | "outbox has multiple columns matching remote reducer parameter `", @@ -33,7 +33,7 @@ error: outbox has multiple columns matching remote reducer parameter `body` = note: this error originates in the macro `__outbox_receiver::__spacetimedb_typecheck_outbox_receive_ping_body_reject_duplicate` which comes from the expansion of the attribute macro `spacetimedb::table` (in Nightly builds, run with -Z macro-backtrace for more info) error: outbox has no column matching remote reducer parameter `body` - --> tests/ui/../fixtures/idc_receiver/lib.rs + --> tests/ui/../fixtures/idc_receiver/mod.rs | | / compile_error!(concat!( | | "outbox has no column matching remote reducer parameter `", @@ -58,7 +58,7 @@ error[E0308]: mismatched types = note: this error originates in the attribute macro `spacetimedb::table` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0308]: mismatched types - --> tests/ui/../fixtures/idc_receiver/lib.rs + --> tests/ui/../fixtures/idc_receiver/mod.rs | | let _ = |x: $ty| { let _: ::std::string::String = x; }; | --------------------- ^ expected `String`, found `u64` diff --git a/crates/bindings/tests/ui/outbox_table_shape.rs b/crates/bindings/tests/ui/outbox_table_shape.rs index 7a79dd71aec..38c97bd0091 100644 --- a/crates/bindings/tests/ui/outbox_table_shape.rs +++ b/crates/bindings/tests/ui/outbox_table_shape.rs @@ -1,4 +1,4 @@ -#[path = "../fixtures/idc_receiver/lib.rs"] +#[path = "../fixtures/idc_receiver/mod.rs"] mod receiver; #[spacetimedb::table(accessor = missing_pk, outbox(receiver::receive_ping))] pub struct MissingPk { diff --git a/crates/cli/src/subcommands/generate.rs b/crates/cli/src/subcommands/generate.rs index ca065fc5ae7..e1d47a8d272 100644 --- a/crates/cli/src/subcommands/generate.rs +++ b/crates/cli/src/subcommands/generate.rs @@ -670,11 +670,7 @@ fn generate_dependency_module_files(files: Vec, dependency_name: &st files .into_iter() .map(|OutputFile { filename, code }| { - let filename = if filename == "lib.rs" { - format!("{dependency_name}/mod.rs") - } else { - format!("{dependency_name}/{filename}") - }; + let filename = format!("{dependency_name}/{filename}"); OutputFile { filename, code } }) .collect() diff --git a/crates/codegen/src/rust.rs b/crates/codegen/src/rust.rs index 4c52ced6797..7ebb8b1a064 100644 --- a/crates/codegen/src/rust.rs +++ b/crates/codegen/src/rust.rs @@ -1400,7 +1400,7 @@ fn generate_module_bindings_root_file(module: &ModuleDef, type_refs: &BTreeSet