From e7284b2b87a318dab066adcb04136a54b317def7 Mon Sep 17 00:00:00 2001 From: Noa Date: Wed, 9 Sep 2026 12:48:58 -0500 Subject: [PATCH 1/6] Add rust-toolchain-sync.sh --- .github/workflows/benchmarks.yml | 1 + crates/bench/Dockerfile | 2 +- crates/standalone/Dockerfile | 1 + rust-toolchain.toml | 5 ++--- tools/rust-toolchain-sync.sh | 20 ++++++++++++++++++++ 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100755 tools/rust-toolchain-sync.sh diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index 2c69e0ef06e..a08a650e3f5 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -184,6 +184,7 @@ jobs: runs-on: spacetimedb-linux timeout-minutes: 20 # on a successful run, runs in 8 minutes container: + # !rust-toolchain-sync image: rust:1.93.0 options: --privileged # disable until we fix the benchmarks diff --git a/crates/bench/Dockerfile b/crates/bench/Dockerfile index 0f64f819c82..4559c71b88a 100644 --- a/crates/bench/Dockerfile +++ b/crates/bench/Dockerfile @@ -2,7 +2,7 @@ # Set up to run from linux / WSL (running from a windows file system will be extremely slow). # See the README for commands to run. -# sync with: ../../rust-toolchain.toml +# !rust-toolchain-sync FROM rust:1.93.0 RUN apt-get update && \ diff --git a/crates/standalone/Dockerfile b/crates/standalone/Dockerfile index fa74fa1f232..0f4515ad25b 100644 --- a/crates/standalone/Dockerfile +++ b/crates/standalone/Dockerfile @@ -1,6 +1,7 @@ ARG CARGO_PROFILE=release +# !rust-toolchain-sync FROM rust:1.93.0 AS chef RUN rust_target=$(rustc -vV | awk '/^host:/{ print $2 }') && \ curl https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-$rust_target.tgz -fL | tar xz -C $CARGO_HOME/bin diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 28f0403f3d4..9b425e79c6d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,6 @@ [toolchain] -# change crates/{standalone,bench}/Dockerfile, .github/Dockerfile, and the docker image tag in -# .github/workflows/benchmarks.yml:jobs/callgrind_benchmark/container/image -# maybe also the rust-version in Cargo.toml +# run ./tools/rust-toolchain-sync.sh when you change the channel! +# also consider changing the rust-version in Cargo.toml channel = "1.93.0" profile = "default" targets = ["wasm32-unknown-unknown"] diff --git a/tools/rust-toolchain-sync.sh b/tools/rust-toolchain-sync.sh new file mode 100755 index 00000000000..bad777a5a2a --- /dev/null +++ b/tools/rust-toolchain-sync.sh @@ -0,0 +1,20 @@ +#!/bin/bash +set -euo pipefail + +VERSION_REGEX="[0-9]+\.[0-9]+\.[0-9]+" +MAGIC_COMMENT="!rust-toolchain-sync" + +REPO_ROOT="$(dirname "$0")/.." + +TOOLCHAIN_FILE="${1:-$REPO_ROOT/rust-toolchain.toml}" +[[ $# -ge 1 ]] && shift + +toolchain="$(rg -o "channel = \"($VERSION_REGEX)\"" -r '$1' "$TOOLCHAIN_FILE")" || { + echo >&2 "$0: couldn't extract version from rust-toolchain.toml" + exit 1 +} + +rg -.F "$MAGIC_COMMENT" -l "$@" | xargs gawk -i inplace -v toolchain_ver="$toolchain" " +/$MAGIC_COMMENT/ { version = 1; print; next } +{ if (version) { gsub(/$VERSION_REGEX/, toolchain_ver); version = 0; } print } +" From ead631701edf5ed2cad201d83fb72607d7a3979c Mon Sep 17 00:00:00 2001 From: Noa Date: Wed, 9 Sep 2026 12:59:39 -0500 Subject: [PATCH 2/6] Bump rust toolchain to 1.96.1 --- .github/workflows/benchmarks.yml | 2 +- Cargo.toml | 2 +- crates/bench/Dockerfile | 2 +- crates/standalone/Dockerfile | 2 +- rust-toolchain.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/benchmarks.yml b/.github/workflows/benchmarks.yml index a08a650e3f5..4d8fe135192 100644 --- a/.github/workflows/benchmarks.yml +++ b/.github/workflows/benchmarks.yml @@ -185,7 +185,7 @@ jobs: timeout-minutes: 20 # on a successful run, runs in 8 minutes container: # !rust-toolchain-sync - image: rust:1.93.0 + image: rust:1.96.1 options: --privileged # disable until we fix the benchmarks if: false diff --git a/Cargo.toml b/Cargo.toml index a2b27d448c4..37661eac3b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -144,7 +144,7 @@ debug = true version = "2.10.1" edition = "2024" # update rust-toolchain.toml too! -rust-version = "1.93.0" +rust-version = "1.96.0" [workspace.dependencies] spacetimedb = { path = "crates/bindings", version = "=2.10.1" } diff --git a/crates/bench/Dockerfile b/crates/bench/Dockerfile index 4559c71b88a..2e01d684110 100644 --- a/crates/bench/Dockerfile +++ b/crates/bench/Dockerfile @@ -3,7 +3,7 @@ # See the README for commands to run. # !rust-toolchain-sync -FROM rust:1.93.0 +FROM rust:1.96.1 RUN apt-get update && \ apt-get install -y valgrind bash && \ diff --git a/crates/standalone/Dockerfile b/crates/standalone/Dockerfile index 0f4515ad25b..cd321e802d4 100644 --- a/crates/standalone/Dockerfile +++ b/crates/standalone/Dockerfile @@ -2,7 +2,7 @@ ARG CARGO_PROFILE=release # !rust-toolchain-sync -FROM rust:1.93.0 AS chef +FROM rust:1.96.1 AS chef RUN rust_target=$(rustc -vV | awk '/^host:/{ print $2 }') && \ curl https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-$rust_target.tgz -fL | tar xz -C $CARGO_HOME/bin RUN cargo binstall -y cargo-chef@0.1.70 diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 9b425e79c6d..96fcd8bf21f 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,7 +1,7 @@ [toolchain] # run ./tools/rust-toolchain-sync.sh when you change the channel! # also consider changing the rust-version in Cargo.toml -channel = "1.93.0" +channel = "1.96.1" profile = "default" targets = ["wasm32-unknown-unknown"] components = ["rust-src"] From c3ebbf8a0b28250a1d1e36784ea657ffcba1e3cc Mon Sep 17 00:00:00 2001 From: Noa Date: Wed, 9 Sep 2026 13:05:53 -0500 Subject: [PATCH 3/6] Fix clippy lints --- crates/cli/src/subcommands/dev.rs | 2 +- crates/cli/src/subcommands/repl.rs | 2 +- crates/codegen/src/unrealcpp.rs | 2 +- crates/commitlog/src/segment.rs | 2 +- crates/core/src/host/instance_env.rs | 2 +- crates/core/src/host/v8/error.rs | 2 +- .../datastore/src/locking_tx_datastore/datastore.rs | 5 ++--- crates/engine/src/relational_db.rs | 11 ++++------- crates/engine/src/update.rs | 4 ++-- crates/pg/src/pg_server.rs | 1 + crates/schema/src/def/validate/v10.rs | 2 +- crates/sqltest/src/main.rs | 12 ++++-------- tools/ci/commands/update-flow/src/main.rs | 2 +- tools/release/src/crates_resolver.rs | 4 ++-- tools/release/src/targets/docker.rs | 2 +- tools/xtask-llm-benchmark/src/bin/llm_benchmark.rs | 2 +- tools/xtask-llm-benchmark/src/context/combine.rs | 2 +- 17 files changed, 26 insertions(+), 33 deletions(-) diff --git a/crates/cli/src/subcommands/dev.rs b/crates/cli/src/subcommands/dev.rs index 95cc579182f..d24344b6490 100644 --- a/crates/cli/src/subcommands/dev.rs +++ b/crates/cli/src/subcommands/dev.rs @@ -1270,7 +1270,7 @@ async fn select_database(config: &Config, server: &str, token: &str) -> Result = stream::iter(result.identities.into_iter()) + let databases: Vec = stream::iter(result.identities) .map(|identity_str| { let config = config.clone(); async move { diff --git a/crates/cli/src/subcommands/repl.rs b/crates/cli/src/subcommands/repl.rs index 6561475ca92..9e4d7e5b50d 100644 --- a/crates/cli/src/subcommands/repl.rs +++ b/crates/cli/src/subcommands/repl.rs @@ -61,7 +61,7 @@ pub(crate) async fn exec(con: Connection, format: Format) -> Result<(), anyhow:: let api = ClientApi::new(con); loop { - let readline = rl.readline(&format!("🪐{}>", &database).green()); + let readline = rl.readline(&format!("🪐{}>", database).green()); match readline { Ok(line) => match line.as_str() { ".exit" => break, diff --git a/crates/codegen/src/unrealcpp.rs b/crates/codegen/src/unrealcpp.rs index a521e739180..f5d03e3f3de 100644 --- a/crates/codegen/src/unrealcpp.rs +++ b/crates/codegen/src/unrealcpp.rs @@ -416,7 +416,7 @@ impl Lang for UnrealCpp<'_> { let name = type_ref_name(self.module_prefix, module, typ.ty); let filename = format!( "Source/{}/Public/ModuleBindings/Types/{}Type.g.h", - self.module_name, &name + self.module_name, name ); let code: String = match &module.typespace_for_generate()[typ.ty] { AlgebraicTypeDef::PlainEnum(plain_enum) => autogen_cpp_enum(&name, plain_enum), diff --git a/crates/commitlog/src/segment.rs b/crates/commitlog/src/segment.rs index c810e2399ae..c67246f8cf3 100644 --- a/crates/commitlog/src/segment.rs +++ b/crates/commitlog/src/segment.rs @@ -16,7 +16,7 @@ use crate::{ Options, }; -pub const MAGIC: [u8; 6] = [b'(', b'd', b's', b')', b'^', b'2']; +pub const MAGIC: [u8; 6] = *b"(ds)^2"; pub const DEFAULT_LOG_FORMAT_VERSION: u8 = 1; pub const DEFAULT_CHECKSUM_ALGORITHM: u8 = CHECKSUM_ALGORITHM_CRC32C; diff --git a/crates/core/src/host/instance_env.rs b/crates/core/src/host/instance_env.rs index 97609d60bb3..76f605d2244 100644 --- a/crates/core/src/host/instance_env.rs +++ b/crates/core/src/host/instance_env.rs @@ -406,7 +406,7 @@ impl InstanceEnv { /// End a console timer by logging the span at INFO level. pub(crate) fn console_timer_end(&self, span: &TimingSpan, function: Option<&str>) { let elapsed = span.start.elapsed(); - let message = format!("Timing span {:?}: {:?}", &span.name, elapsed); + let message = format!("Timing span {:?}: {:?}", span.name, elapsed); self.console_log_simple_message(LogLevel::Info, function, &message); } diff --git a/crates/core/src/host/v8/error.rs b/crates/core/src/host/v8/error.rs index 54095f657cf..aa462506bef 100644 --- a/crates/core/src/host/v8/error.rs +++ b/crates/core/src/host/v8/error.rs @@ -520,7 +520,7 @@ impl fmt::Display for JsStackTraceFrame { // TODO(v8): make it more like chrome in the future. f.write_fmt(format_args!( "at {} ({}:{}:{})", - fn_name, script_name, &self.line, &self.column + fn_name, script_name, self.line, self.column ))?; if self.is_ctor { diff --git a/crates/datastore/src/locking_tx_datastore/datastore.rs b/crates/datastore/src/locking_tx_datastore/datastore.rs index 1082e0ae9c6..205de3567fe 100644 --- a/crates/datastore/src/locking_tx_datastore/datastore.rs +++ b/crates/datastore/src/locking_tx_datastore/datastore.rs @@ -229,9 +229,8 @@ impl Locking { /// error. pub fn take_snapshot(&self, repo: &DynSnapshotRepo) -> Result> { Self::take_snapshot_internal(&self.committed_state, repo)? - .map(|(_offset, snap)| snap.sync_all()) + .map(|(_offset, snap)| snap.sync_all().map_err(Into::into)) .transpose() - .map_err(Into::into) } pub fn assert_system_tables_match(&self) -> Result<()> { @@ -3021,7 +3020,7 @@ pub(crate) mod tests { fn assert_rows(datastore: &Locking, table_id: TableId, rows: Vec) -> ResultTest<()> { let tx = begin_tx(datastore); - for (actual, expected) in datastore.iter_tx(&tx, table_id)?.zip_eq(rows.into_iter()) { + for (actual, expected) in datastore.iter_tx(&tx, table_id)?.zip_eq(rows) { assert_eq!(actual.to_bsatn_vec()?, expected.to_bsatn_vec()?); } Ok(()) diff --git a/crates/engine/src/relational_db.rs b/crates/engine/src/relational_db.rs index 19cda5b6fbe..800148f9251 100644 --- a/crates/engine/src/relational_db.rs +++ b/crates/engine/src/relational_db.rs @@ -627,13 +627,10 @@ impl RelationalDB { // Try to restore from any snapshot that was taken within the // range `(min_commitlog_offset + 1)..=durable_tx_offset`. let mut upper_bound = durable_tx_offset; - loop { - let Some(snapshot_offset) = snapshot_repo - .latest_snapshot_older_than(upper_bound) - .map_err(Box::new)? - else { - break; - }; + while let Some(snapshot_offset) = snapshot_repo + .latest_snapshot_older_than(upper_bound) + .map_err(Box::new)? + { if min_commitlog_offset > 0 && min_commitlog_offset > snapshot_offset + 1 { log::debug!("snapshot_offset={snapshot_offset} min_commitlog_offset={min_commitlog_offset}"); break; diff --git a/crates/engine/src/update.rs b/crates/engine/src/update.rs index 5b9e6e0fde2..ab864688d1c 100644 --- a/crates/engine/src/update.rs +++ b/crates/engine/src/update.rs @@ -705,7 +705,7 @@ pub fn create_table_from_view_def( view_def: &ViewDef, ) -> anyhow::Result<()> { stdb.create_view(tx, module_def, view_def) - .with_context(|| format!("failed to create table for view {}", &view_def.name))?; + .with_context(|| format!("failed to create table for view {}", view_def.name))?; Ok(()) } @@ -719,7 +719,7 @@ pub fn create_table_from_view_def_with_prefix( name_prefix: &NamespacePath, ) -> anyhow::Result<()> { stdb.create_view_with_prefix(tx, owning_def, view_def, name_prefix) - .with_context(|| format!("failed to create table for view {}{}", name_prefix, &view_def.name))?; + .with_context(|| format!("failed to create table for view {}{}", name_prefix, view_def.name))?; Ok(()) } diff --git a/crates/pg/src/pg_server.rs b/crates/pg/src/pg_server.rs index f1de39f4efd..361da919418 100644 --- a/crates/pg/src/pg_server.rs +++ b/crates/pg/src/pg_server.rs @@ -157,6 +157,7 @@ where let params = self.cached.lock().await.clone().unwrap(); let name_or_identity = database::NameOrIdentity::Name(DatabaseName(params.database.clone())); let database_identity = response(name_or_identity.resolve(&self.ctx).await, ¶ms.database).await?; + #[expect(clippy::result_large_err)] let database = response( self.ctx .get_database_by_identity(&database_identity) diff --git a/crates/schema/src/def/validate/v10.rs b/crates/schema/src/def/validate/v10.rs index 11fbcf4e3d4..a57d56a9212 100644 --- a/crates/schema/src/def/validate/v10.rs +++ b/crates/schema/src/def/validate/v10.rs @@ -398,7 +398,7 @@ fn validate_submodules(submodules: Vec) -> Result errors.extend(e.into_iter()), + Err(e) => errors.extend(e), } } } diff --git a/crates/sqltest/src/main.rs b/crates/sqltest/src/main.rs index 7856008afd3..304042fc21c 100644 --- a/crates/sqltest/src/main.rs +++ b/crates/sqltest/src/main.rs @@ -449,15 +449,11 @@ async fn update_test_file { - if sql.contains("NOT_REWRITE") { - continue; - } + Record::Statement { sql, .. } if sql.contains("NOT_REWRITE") => { + continue; } - Record::Query { sql, .. } => { - if sql.contains("NOT_REWRITE") { - continue; - } + Record::Query { sql, .. } if sql.contains("NOT_REWRITE") => { + continue; } _ => (), } diff --git a/tools/ci/commands/update-flow/src/main.rs b/tools/ci/commands/update-flow/src/main.rs index 273e5f26efc..be9d99b8460 100644 --- a/tools/ci/commands/update-flow/src/main.rs +++ b/tools/ci/commands/update-flow/src/main.rs @@ -56,7 +56,7 @@ fn main() -> Result<()> { ["run", "-p", "spacetimedb-update"] .into_iter() .chain(common_args.clone()) - .chain(["--", "self-install", &root_arg, "--yes"].into_iter()), + .chain(["--", "self-install", &root_arg, "--yes"]), ) .run()?; diff --git a/tools/release/src/crates_resolver.rs b/tools/release/src/crates_resolver.rs index 3412ecf93da..158cfcc441c 100644 --- a/tools/release/src/crates_resolver.rs +++ b/tools/release/src/crates_resolver.rs @@ -72,9 +72,9 @@ pub fn get_crate_deps(crate_name: &String, manifest_map: &HashMap>) -> Option> = HashMap::new(); for g in groups { - out.entry(g.vendor).or_default().extend(g.models.into_iter()); + out.entry(g.vendor).or_default().extend(g.models); } Some(out) } diff --git a/tools/xtask-llm-benchmark/src/context/combine.rs b/tools/xtask-llm-benchmark/src/context/combine.rs index ac8eb278c1b..9c3b1a2f59f 100644 --- a/tools/xtask-llm-benchmark/src/context/combine.rs +++ b/tools/xtask-llm-benchmark/src/context/combine.rs @@ -163,7 +163,7 @@ fn build_context_from_rustdoc_json() -> Result { }); } - rows.sort_by(|a, b| (order_key(&a.kind), a.path.to_lowercase()).cmp(&(order_key(&b.kind), b.path.to_lowercase()))); + rows.sort_by_key(|a| (order_key(&a.kind), a.path.to_lowercase())); let mut out = String::with_capacity(1024 * 1024); out.push_str(&format!( From b302c14d9e79dfbe1c45bbfcfbf3269e6c47f967 Mon Sep 17 00:00:00 2001 From: Noa Date: Thu, 17 Sep 2026 12:14:25 -0500 Subject: [PATCH 4/6] Run cargo fmt --- crates/lib/src/lib.rs | 2 +- sdks/rust/src/db_connection.rs | 2 +- sdks/rust/src/spacetime_module.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/lib/src/lib.rs b/crates/lib/src/lib.rs index 55d5621a16d..0ee6395186b 100644 --- a/crates/lib/src/lib.rs +++ b/crates/lib/src/lib.rs @@ -40,12 +40,12 @@ pub use filterable_value::Private; pub use filterable_value::{FilterableValue, IndexScanRangeBoundsTerminator, TermBound, ViewPrimaryKeyColumn}; pub use identity::Identity; pub use scheduler::ScheduleAt; +pub use spacetimedb_sats::__make_register_reftype; pub use spacetimedb_sats::hash::{self, hash_bytes, Hash}; pub use spacetimedb_sats::time_duration::TimeDuration; pub use spacetimedb_sats::timestamp::Timestamp; pub use spacetimedb_sats::uuid::Uuid; pub use spacetimedb_sats::SpacetimeType; -pub use spacetimedb_sats::__make_register_reftype; pub use spacetimedb_sats::{self as sats, bsatn, buffer, de, ser}; pub use spacetimedb_sats::{AlgebraicType, ProductType, ProductTypeElement, SumType}; pub use spacetimedb_sats::{AlgebraicValue, ProductValue}; diff --git a/sdks/rust/src/db_connection.rs b/sdks/rust/src/db_connection.rs index 137166ae614..c1810f7e5dd 100644 --- a/sdks/rust/src/db_connection.rs +++ b/sdks/rust/src/db_connection.rs @@ -19,7 +19,6 @@ //! This module is internal, and may incompatibly change without warning. use crate::{ - Event, ReducerEvent, Status, __codegen::{InternalError, Reducer}, callbacks::{ CallbackId, DbCallbacks, ProcedureCallback, ProcedureCallbacks, ReducerCallback, ReducerCallbacks, RowCallback, @@ -29,6 +28,7 @@ use crate::{ spacetime_module::{AbstractEventContext, AppliedDiff, DbConnection, DbUpdate, InModule, SpacetimeModule}, subscription::{PendingUnsubscribeResult, SubscriptionHandleImpl, SubscriptionManager}, websocket::{WsConnection, WsParams}, + Event, ReducerEvent, Status, }; use bytes::Bytes; use futures::StreamExt; diff --git a/sdks/rust/src/spacetime_module.rs b/sdks/rust/src/spacetime_module.rs index dfec381e56d..cba7c73122b 100644 --- a/sdks/rust/src/spacetime_module.rs +++ b/sdks/rust/src/spacetime_module.rs @@ -3,12 +3,12 @@ //! This module is internal, and may incompatibly change without warning. use crate::{ + __codegen::InternalError, callbacks::DbCallbacks, client_cache::ClientCache, db_connection::DbContextImpl, subscription::{OnEndedCallback, SubscriptionHandleImpl}, Event, ReducerEvent, - __codegen::InternalError, }; use bytes::Bytes; use spacetimedb_client_api_messages::websocket::{self as ws, common::RowListLen as _, v2::BsatnRowList}; From 8bcd971de45b1a144e52dd4893c59ffc6091ec9a Mon Sep 17 00:00:00 2001 From: Noa Date: Fri, 18 Sep 2026 11:07:03 -0500 Subject: [PATCH 5/6] Fix test_detect_getrandom - now fails with a linker error --- crates/smoketests/tests/standalone/detect_wasm_bindgen.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/smoketests/tests/standalone/detect_wasm_bindgen.rs b/crates/smoketests/tests/standalone/detect_wasm_bindgen.rs index baf95009eb4..af848bb5b1d 100644 --- a/crates/smoketests/tests/standalone/detect_wasm_bindgen.rs +++ b/crates/smoketests/tests/standalone/detect_wasm_bindgen.rs @@ -61,7 +61,7 @@ fn test_detect_getrandom() { let stderr = String::from_utf8_lossy(&output.stderr); assert!( - stderr.contains("getrandom usage detected"), + stderr.contains("getrandom usage detected") || stderr.contains("undefined symbol: __getrandom_custom"), "Expected 'getrandom usage detected' in stderr, got: {}", stderr ); From 2e0ba8659ea987edfef080fcc730eb286c979b03 Mon Sep 17 00:00:00 2001 From: Noa Date: Fri, 18 Sep 2026 11:16:07 -0500 Subject: [PATCH 6/6] Bless ui tests --- .../bindings/tests/ui/environment_enum.stderr | 12 +- .../tests/ui/environment_types.stderr | 24 +- crates/bindings/tests/ui/http_handlers.stderr | 235 +++--------------- crates/bindings/tests/ui/reducers.stderr | 52 ++-- crates/bindings/tests/ui/tables.stderr | 6 +- crates/bindings/tests/ui/views.stderr | 90 +++---- 6 files changed, 120 insertions(+), 299 deletions(-) diff --git a/crates/bindings/tests/ui/environment_enum.stderr b/crates/bindings/tests/ui/environment_enum.stderr index f3f3d25ddc0..cb64199e845 100644 --- a/crates/bindings/tests/ui/environment_enum.stderr +++ b/crates/bindings/tests/ui/environment_enum.stderr @@ -46,13 +46,13 @@ error: expected string literal 38 | #[env(value = 1)] | ^ -error[E0277]: the trait bound `Option: RequiredEnvironmentValue` is not satisfied +error[E0277]: the trait bound `Option: spacetimedb::rt::RequiredEnvironmentValue` is not satisfied --> tests/ui/environment_enum.rs:51:17 | 51 | pub NESTED: Option>, - | ^^^^^^^^^^^^^^^^^^^^ the trait `RequiredEnvironmentValue` is not implemented for `Option` + | ^^^^^^^^^^^^^^^^^^^^ the trait `spacetimedb::rt::RequiredEnvironmentValue` is not implemented for `Option` | -help: the following other types implement trait `RequiredEnvironmentValue` +help: the following other types implement trait `spacetimedb::rt::RequiredEnvironmentValue` --> tests/ui/environment_enum.rs:42:10 | 42 | #[derive(spacetimedb::EnvironmentValue)] @@ -62,7 +62,7 @@ help: the following other types implement trait `RequiredEnvironmentValue` | | impl RequiredEnvironmentValue for String {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::string::String` - = note: required for `Option>` to implement `EnvironmentValue` + = note: required for `Option>` to implement `spacetimedb::rt::EnvironmentValue` = note: this error originates in the derive macro `spacetimedb::EnvironmentValue` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: `#[env(values(...))]` requires `String` or `Option`; map enum variants with `#[env(value = "...")]` instead @@ -71,12 +71,12 @@ error[E0277]: `#[env(values(...))]` requires `String` or `Option`; map e 50 | pub MODE: Mode, | ^^^^ unsatisfied trait bound | -help: the trait `StringEnvironmentValue` is not implemented for `Mode` +help: the trait `spacetimedb::rt::StringEnvironmentValue` is not implemented for `Mode` --> tests/ui/environment_enum.rs:43:1 | 43 | pub enum Mode { | ^^^^^^^^^^^^^ -help: the following other types implement trait `StringEnvironmentValue` +help: the following other types implement trait `spacetimedb::rt::StringEnvironmentValue` --> src/rt.rs | | impl StringEnvironmentValue for String {} diff --git a/crates/bindings/tests/ui/environment_types.stderr b/crates/bindings/tests/ui/environment_types.stderr index f884a635897..9341025b102 100644 --- a/crates/bindings/tests/ui/environment_types.stderr +++ b/crates/bindings/tests/ui/environment_types.stderr @@ -4,12 +4,12 @@ error[E0277]: environment fields must be `String`, an enum deriving `Environment 6 | pub VALUE: String, | ^^^^^^ unsatisfied trait bound | -help: the trait `EnvironmentValue` is not implemented for `shadowed_string::String` +help: the trait `spacetimedb::rt::EnvironmentValue` is not implemented for `shadowed_string::String` --> tests/ui/environment_types.rs:2:5 | 2 | pub struct String; | ^^^^^^^^^^^^^^^^^ -help: the following other types implement trait `EnvironmentValue` +help: the following other types implement trait `spacetimedb::rt::EnvironmentValue` --> src/rt.rs | | impl EnvironmentValue for String { @@ -24,12 +24,12 @@ error[E0277]: environment fields must be `String`, an enum deriving `Environment 15 | pub VALUE: Option, | ^^^^^^^^^^^^^^ unsatisfied trait bound | -help: the trait `EnvironmentValue` is not implemented for `shadowed_option::Option` +help: the trait `spacetimedb::rt::EnvironmentValue` is not implemented for `shadowed_option::Option` --> tests/ui/environment_types.rs:11:5 | 11 | pub struct Option(T); | ^^^^^^^^^^^^^^^^^^^^ -help: the following other types implement trait `EnvironmentValue` +help: the following other types implement trait `spacetimedb::rt::EnvironmentValue` --> src/rt.rs | | impl EnvironmentValue for String { @@ -42,9 +42,9 @@ error[E0277]: environment fields must be `String`, an enum deriving `Environment --> tests/ui/environment_types.rs:21:15 | 21 | pub BOOL: bool, - | ^^^^ the trait `EnvironmentValue` is not implemented for `bool` + | ^^^^ the trait `spacetimedb::rt::EnvironmentValue` is not implemented for `bool` | -help: the following other types implement trait `EnvironmentValue` +help: the following other types implement trait `spacetimedb::rt::EnvironmentValue` --> src/rt.rs | | impl EnvironmentValue for String { @@ -53,26 +53,26 @@ help: the following other types implement trait `EnvironmentValue` | impl EnvironmentValue for Option { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `std::option::Option` -error[E0277]: the trait bound `std::option::Option: RequiredEnvironmentValue` is not satisfied +error[E0277]: the trait bound `std::option::Option: spacetimedb::rt::RequiredEnvironmentValue` is not satisfied --> tests/ui/environment_types.rs:22:17 | 22 | pub NESTED: Option>, - | ^^^^^^^^^^^^^^^^^^^^^^ the trait `RequiredEnvironmentValue` is not implemented for `std::option::Option` + | ^^^^^^^^^^^^^^^^^^^^^^ the trait `spacetimedb::rt::RequiredEnvironmentValue` is not implemented for `std::option::Option` | -help: the trait `RequiredEnvironmentValue` is implemented for `std::string::String` +help: the trait `spacetimedb::rt::RequiredEnvironmentValue` is implemented for `std::string::String` --> src/rt.rs | | impl RequiredEnvironmentValue for String {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: required for `std::option::Option>` to implement `EnvironmentValue` + = note: required for `std::option::Option>` to implement `spacetimedb::rt::EnvironmentValue` error[E0277]: environment fields must be `String`, an enum deriving `EnvironmentValue`, or an `Option` of either --> tests/ui/environment_types.rs:24:14 | 24 | pub get: u32, - | ^^^ the trait `EnvironmentValue` is not implemented for `u32` + | ^^^ the trait `spacetimedb::rt::EnvironmentValue` is not implemented for `u32` | -help: the following other types implement trait `EnvironmentValue` +help: the following other types implement trait `spacetimedb::rt::EnvironmentValue` --> src/rt.rs | | impl EnvironmentValue for String { diff --git a/crates/bindings/tests/ui/http_handlers.stderr b/crates/bindings/tests/ui/http_handlers.stderr index c28936ac12e..d22111bb64e 100644 --- a/crates/bindings/tests/ui/http_handlers.stderr +++ b/crates/bindings/tests/ui/http_handlers.stderr @@ -1,205 +1,48 @@ -error: HTTP handlers must take exactly two arguments - --> tests/ui/http_handlers.rs:5:1 - | -5 | fn handler_no_args() -> Response { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: HTTP handlers must take exactly two arguments - --> tests/ui/http_handlers.rs:20:1 - | -20 | fn handler_no_request_arg(_ctx: &mut HandlerContext) -> Response { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: HTTP handlers must return `spacetimedb::http::Response` - --> tests/ui/http_handlers.rs:30:1 - | -30 | fn handler_no_return_type(_ctx: &mut HandlerContext, _req: Request) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error: expected `fn` - --> tests/ui/http_handlers.rs:58:1 - | -58 | static ROUTER_NOT_A_FUNCTION: Router = Router::new(); - | ^^^^^^ - -error: HTTP router functions must take no arguments - --> tests/ui/http_handlers.rs:61:1 - | -61 | fn router_fn_with_args(ctx: &mut HandlerContext) -> Router { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -warning: unused import: `Router` - --> tests/ui/http_handlers.rs:1:77 +error[E0432]: unresolved imports `spacetimedb::http::handler`, `spacetimedb::http::router`, `spacetimedb::http::HandlerContext`, `spacetimedb::http::Router` + --> tests/ui/http_handlers.rs:1:25 | 1 | use spacetimedb::http::{handler, router, HandlerContext, Request, Response, Router}; - | ^^^^^^ + | ^^^^^^^ ^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^ no `Router` in `http` + | | | | + | | | no `HandlerContext` in `http` + | | no `router` in `http` + | no `handler` in `http` + | +note: found an item that was configured out + --> src/http.rs + | + | #[cfg(feature = "unstable")] + | -------------------- the item is gated behind the `unstable` feature + | #[doc(inline)] + | pub use spacetimedb_bindings_macro::http_handler as handler; + | ^^^^^^^ +note: found an item that was configured out + --> src/http.rs | - = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default + | #[cfg(feature = "unstable")] + | -------------------- the item is gated behind the `unstable` feature + | #[doc(inline)] + | pub use spacetimedb_bindings_macro::http_router as router; + | ^^^^^^ +note: found an item that was configured out + --> src/http.rs + | + | #[cfg(feature = "unstable")] + | -------------------- the item is gated behind the `unstable` feature + | #[non_exhaustive] + | pub struct HandlerContext { + | ^^^^^^^^^^^^^^ +note: found an item that was configured out + --> src/http.rs + | + | #[cfg(feature = "unstable")] + | -------------------- the item is gated behind the `unstable` feature + | #[derive(Clone, Default)] + | pub struct Router { + | ^^^^^^ error[E0601]: `main` function not found in crate `$CRATE` --> tests/ui/http_handlers.rs:68:2 | 68 | } | ^ consider adding a `main` function to `$DIR/tests/ui/http_handlers.rs` - -error[E0308]: mismatched types - --> tests/ui/http_handlers.rs:10:4 - | - 9 | #[handler] - | ---------- arguments to this function are incorrect -10 | fn handler_immutable_ctx(_ctx: &HandlerContext, _req: Request) -> Response { - | ^^^^^^^^^^^^^^^^^^^^^ types differ in mutability - | - = note: expected fn pointer `for<'a> fn(&'a mut HandlerContext, http::request::Request) -> http::response::Response` - found fn item `for<'a> fn(&'a HandlerContext, http::request::Request) -> http::response::Response {__spacetimedb_http_handler_handler_immutable_ctx}` -note: function defined here - --> src/rt.rs - | - | pub fn register_http_handler(name: &'static str, handler: HttpHandlerFn) { - | ^^^^^^^^^^^^^^^^^^^^^ - -error[E0277]: the first argument of an HTTP handler must be `&mut HandlerContext` - --> tests/ui/http_handlers.rs:10:32 - | -10 | fn handler_immutable_ctx(_ctx: &HandlerContext, _req: Request) -> Response { - | ^^^^^^^^^^^^^^^ first argument must be `&mut HandlerContext` - | - = help: the trait `HttpHandlerContextArg` is not implemented for `&HandlerContext` -help: the trait `HttpHandlerContextArg` is implemented for `&mut HandlerContext` - --> src/rt.rs - | - | impl HttpHandlerContextArg for &mut HandlerContext {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: `HttpHandlerContextArg` is implemented for `&mut HandlerContext`, but not for `&HandlerContext` - -error[E0308]: mismatched types - --> tests/ui/http_handlers.rs:15:4 - | -14 | #[handler] - | ---------- arguments to this function are incorrect -15 | fn handler_wrong_ctx(_ctx: &mut ProcedureContext, _req: Request) -> Response { - | ^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item - | - = note: expected fn pointer `for<'a> fn(&'a mut HandlerContext, http::request::Request) -> http::response::Response` - found fn item `for<'a> fn(&'a mut ProcedureContext, http::request::Request) -> http::response::Response {__spacetimedb_http_handler_handler_wrong_ctx}` -note: function defined here - --> src/rt.rs - | - | pub fn register_http_handler(name: &'static str, handler: HttpHandlerFn) { - | ^^^^^^^^^^^^^^^^^^^^^ - -error[E0277]: the first argument of an HTTP handler must be `&mut HandlerContext` - --> tests/ui/http_handlers.rs:15:28 - | -15 | fn handler_wrong_ctx(_ctx: &mut ProcedureContext, _req: Request) -> Response { - | ^^^^^^^^^^^^^^^^^^^^^ first argument must be `&mut HandlerContext` - | - = help: the trait `HttpHandlerContextArg` is not implemented for `&mut ProcedureContext` -help: the trait `HttpHandlerContextArg` is implemented for `&mut HandlerContext` - --> src/rt.rs - | - | impl HttpHandlerContextArg for &mut HandlerContext {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0308]: mismatched types - --> tests/ui/http_handlers.rs:25:4 - | -24 | #[handler] - | ---------- arguments to this function are incorrect -25 | fn handler_wrong_request_arg_type(_ctx: &mut HandlerContext, _req: u32) -> Response { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item - | - = note: expected fn pointer `for<'a> fn(&'a mut HandlerContext, http::request::Request) -> http::response::Response` - found fn item `for<'a> fn(&'a mut HandlerContext, u32) -> http::response::Response {__spacetimedb_http_handler_handler_wrong_request_arg_type}` -note: function defined here - --> src/rt.rs - | - | pub fn register_http_handler(name: &'static str, handler: HttpHandlerFn) { - | ^^^^^^^^^^^^^^^^^^^^^ - -error[E0277]: the second argument of an HTTP handler must be `spacetimedb::http::Request` - --> tests/ui/http_handlers.rs:25:68 - | -25 | fn handler_wrong_request_arg_type(_ctx: &mut HandlerContext, _req: u32) -> Response { - | ^^^ the trait `HttpHandlerRequestArg` is not implemented for `u32` - | -help: the trait `HttpHandlerRequestArg` is implemented for `http::request::Request` - --> src/rt.rs - | - | impl HttpHandlerRequestArg for crate::http::Request {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0308]: mismatched types - --> tests/ui/http_handlers.rs:35:4 - | -34 | #[handler] - | ---------- arguments to this function are incorrect -35 | fn handler_wrong_return_type(_ctx: &mut HandlerContext, _req: Request) -> u32 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item - | - = note: expected fn pointer `for<'a> fn(&'a mut HandlerContext, http::request::Request) -> http::response::Response` - found fn item `for<'a> fn(&'a mut HandlerContext, http::request::Request) -> u32 {__spacetimedb_http_handler_handler_wrong_return_type}` -note: function defined here - --> src/rt.rs - | - | pub fn register_http_handler(name: &'static str, handler: HttpHandlerFn) { - | ^^^^^^^^^^^^^^^^^^^^^ - -error[E0277]: HTTP handlers must return `spacetimedb::http::Response` - --> tests/ui/http_handlers.rs:35:75 - | -35 | fn handler_wrong_return_type(_ctx: &mut HandlerContext, _req: Request) -> u32 { - | ^^^ the trait `HttpHandlerReturn` is not implemented for `u32` - | -help: the trait `HttpHandlerReturn` is implemented for `http::response::Response` - --> src/rt.rs - | - | impl HttpHandlerReturn for crate::http::Response {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -error[E0599]: no method named `sender` found for mutable reference `&mut HandlerContext` in the current scope - --> tests/ui/http_handlers.rs:41:23 - | -41 | let _sender = ctx.sender(); - | ^^^^^^ method not found in `&mut HandlerContext` - -error[E0599]: no method named `connection_id` found for mutable reference `&mut HandlerContext` in the current scope - --> tests/ui/http_handlers.rs:42:24 - | -42 | let _conn_id = ctx.connection_id(); - | ^^^^^^^^^^^^^ method not found in `&mut HandlerContext` - -error[E0609]: no field `db` on type `&mut HandlerContext` - --> tests/ui/http_handlers.rs:53:21 - | -53 | let _rows = ctx.db.test_table().iter(); - | ^^ unknown field - | - = note: available fields are: `env`, `timestamp`, `http` - -error[E0308]: mismatched types - --> tests/ui/http_handlers.rs:66:4 - | -65 | #[router] - | --------- expected due to this -66 | fn router_fn_wrong_return_type() -> u32 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item - | - = note: expected fn pointer `fn() -> Router` - found fn item `fn() -> u32 {router_fn_wrong_return_type}` - -error[E0308]: mismatched types - --> tests/ui/http_handlers.rs:66:4 - | -65 | #[router] - | --------- arguments to this function are incorrect -66 | fn router_fn_wrong_return_type() -> u32 { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found fn item - | - = note: expected fn pointer `fn() -> Router` - found fn item `fn() -> u32 {router_fn_wrong_return_type}` -note: function defined here - --> src/rt.rs - | - | pub fn register_http_router(build: fn() -> crate::http::Router) { - | ^^^^^^^^^^^^^^^^^^^^ diff --git a/crates/bindings/tests/ui/reducers.stderr b/crates/bindings/tests/ui/reducers.stderr index acc25c83008..cbade14ff0a 100644 --- a/crates/bindings/tests/ui/reducers.stderr +++ b/crates/bindings/tests/ui/reducers.stderr @@ -28,13 +28,13 @@ error[E0277]: invalid reducer signature 6 | fn bad_type(_ctx: &ReducerContext, _a: Test) {} | ^^^^^^^^ this reducer signature is not valid | - = help: the trait `Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext, Test) {bad_type}` + = help: the trait `spacetimedb::rt::Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext, Test) {bad_type}` = note: = note: reducer signatures must match the following pattern: = note: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]` = note: where each `Ti` type implements `SpacetimeType`. = note: -note: required by a bound in `register_reducer` +note: required by a bound in `spacetimedb::rt::register_reducer` --> src/rt.rs | | pub fn register_reducer<'a, A: Args<'a>, I: FnInfo>(_: impl Reducer<'a, A>) { @@ -62,7 +62,7 @@ help: the trait `SpacetimeType` is not implemented for `Test` Box ColumnAttribute and $N others - = note: required for `Test` to implement `ReducerArg` + = note: required for `Test` to implement `spacetimedb::rt::ReducerArg` error[E0277]: invalid reducer signature --> tests/ui/reducers.rs:6:4 @@ -72,13 +72,13 @@ error[E0277]: invalid reducer signature 6 | fn bad_type(_ctx: &ReducerContext, _a: Test) {} | ^^^^^^^^ this reducer signature is not valid | - = help: the trait `Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext, Test) {bad_type}` + = help: the trait `spacetimedb::rt::Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext, Test) {bad_type}` = note: = note: reducer signatures must match the following pattern: = note: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]` = note: where each `Ti` type implements `SpacetimeType`. = note: -note: required by a bound in `invoke_reducer` +note: required by a bound in `spacetimedb::rt::invoke_reducer` --> src/rt.rs | | pub fn invoke_reducer<'a, A: Args<'a>>( @@ -94,13 +94,13 @@ error[E0277]: invalid reducer signature 9 | fn bad_return_type(_ctx: &ReducerContext) -> Test { | ^^^^^^^^^^^^^^^ this reducer signature is not valid | - = help: the trait `Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext) -> Test {bad_return_type}` + = help: the trait `spacetimedb::rt::Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext) -> Test {bad_return_type}` = note: = note: reducer signatures must match the following pattern: = note: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]` = note: where each `Ti` type implements `SpacetimeType`. = note: -note: required by a bound in `register_reducer` +note: required by a bound in `spacetimedb::rt::register_reducer` --> src/rt.rs | | pub fn register_reducer<'a, A: Args<'a>, I: FnInfo>(_: impl Reducer<'a, A>) { @@ -112,13 +112,13 @@ error[E0277]: `Test` is not a valid reducer return type 9 | fn bad_return_type(_ctx: &ReducerContext) -> Test { | ^^^^ unsatisfied trait bound | -help: the trait `IntoReducerResult` is not implemented for `Test` +help: the trait `spacetimedb::rt::IntoReducerResult` is not implemented for `Test` --> tests/ui/reducers.rs:3:1 | 3 | struct Test; | ^^^^^^^^^^^ = note: reducers cannot return values -- you can only return `()` or `Result<(), impl Display>` -help: the following other types implement trait `IntoReducerResult` +help: the following other types implement trait `spacetimedb::rt::IntoReducerResult` --> src/rt.rs | | impl IntoReducerResult for () { @@ -135,13 +135,13 @@ error[E0277]: invalid reducer signature 9 | fn bad_return_type(_ctx: &ReducerContext) -> Test { | ^^^^^^^^^^^^^^^ this reducer signature is not valid | - = help: the trait `Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext) -> Test {bad_return_type}` + = help: the trait `spacetimedb::rt::Reducer<'_, _>` is not implemented for fn item `for<'a> fn(&'a ReducerContext) -> Test {bad_return_type}` = note: = note: reducer signatures must match the following pattern: = note: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]` = note: where each `Ti` type implements `SpacetimeType`. = note: -note: required by a bound in `invoke_reducer` +note: required by a bound in `spacetimedb::rt::invoke_reducer` --> src/rt.rs | | pub fn invoke_reducer<'a, A: Args<'a>>( @@ -157,13 +157,13 @@ error[E0277]: invalid reducer signature 23 | fn missing_ctx(_a: u8) {} | ^^^^^^^^^^^ this reducer signature is not valid | - = help: the trait `Reducer<'_, _>` is not implemented for fn item `fn(u8) {missing_ctx}` + = help: the trait `spacetimedb::rt::Reducer<'_, _>` is not implemented for fn item `fn(u8) {missing_ctx}` = note: = note: reducer signatures must match the following pattern: = note: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]` = note: where each `Ti` type implements `SpacetimeType`. = note: -note: required by a bound in `register_reducer` +note: required by a bound in `spacetimedb::rt::register_reducer` --> src/rt.rs | | pub fn register_reducer<'a, A: Args<'a>, I: FnInfo>(_: impl Reducer<'a, A>) { @@ -175,8 +175,8 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext` 23 | fn missing_ctx(_a: u8) {} | ^^ first argument must be `&ReducerContext` | - = help: the trait `ReducerContextArg` is not implemented for `u8` -help: the trait `ReducerContextArg` is implemented for `&ReducerContext` + = help: the trait `spacetimedb::rt::ReducerContextArg` is not implemented for `u8` +help: the trait `spacetimedb::rt::ReducerContextArg` is implemented for `&ReducerContext` --> src/rt.rs | | impl ReducerContextArg for &ReducerContext {} @@ -190,13 +190,13 @@ error[E0277]: invalid reducer signature 23 | fn missing_ctx(_a: u8) {} | ^^^^^^^^^^^ this reducer signature is not valid | - = help: the trait `Reducer<'_, _>` is not implemented for fn item `fn(u8) {missing_ctx}` + = help: the trait `spacetimedb::rt::Reducer<'_, _>` is not implemented for fn item `fn(u8) {missing_ctx}` = note: = note: reducer signatures must match the following pattern: = note: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]` = note: where each `Ti` type implements `SpacetimeType`. = note: -note: required by a bound in `invoke_reducer` +note: required by a bound in `spacetimedb::rt::invoke_reducer` --> src/rt.rs | | pub fn invoke_reducer<'a, A: Args<'a>>( @@ -212,13 +212,13 @@ error[E0277]: invalid reducer signature 26 | fn ctx_by_val(_ctx: ReducerContext, _a: u8) {} | ^^^^^^^^^^ this reducer signature is not valid | - = help: the trait `Reducer<'_, _>` is not implemented for fn item `fn(ReducerContext, u8) {ctx_by_val}` + = help: the trait `spacetimedb::rt::Reducer<'_, _>` is not implemented for fn item `fn(ReducerContext, u8) {ctx_by_val}` = note: = note: reducer signatures must match the following pattern: = note: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]` = note: where each `Ti` type implements `SpacetimeType`. = note: -note: required by a bound in `register_reducer` +note: required by a bound in `spacetimedb::rt::register_reducer` --> src/rt.rs | | pub fn register_reducer<'a, A: Args<'a>, I: FnInfo>(_: impl Reducer<'a, A>) { @@ -230,8 +230,8 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext` 26 | fn ctx_by_val(_ctx: ReducerContext, _a: u8) {} | ^^^^^^^^^^^^^^ first argument must be `&ReducerContext` | - = help: the trait `ReducerContextArg` is not implemented for `ReducerContext` -help: the trait `ReducerContextArg` is implemented for `&ReducerContext` + = help: the trait `spacetimedb::rt::ReducerContextArg` is not implemented for `ReducerContext` +help: the trait `spacetimedb::rt::ReducerContextArg` is implemented for `&ReducerContext` --> src/rt.rs | | impl ReducerContextArg for &ReducerContext {} @@ -245,13 +245,13 @@ error[E0277]: invalid reducer signature 26 | fn ctx_by_val(_ctx: ReducerContext, _a: u8) {} | ^^^^^^^^^^ this reducer signature is not valid | - = help: the trait `Reducer<'_, _>` is not implemented for fn item `fn(ReducerContext, u8) {ctx_by_val}` + = help: the trait `spacetimedb::rt::Reducer<'_, _>` is not implemented for fn item `fn(ReducerContext, u8) {ctx_by_val}` = note: = note: reducer signatures must match the following pattern: = note: `Fn(&ReducerContext, [T1, ...]) [-> Result<(), impl Display>]` = note: where each `Ti` type implements `SpacetimeType`. = note: -note: required by a bound in `invoke_reducer` +note: required by a bound in `spacetimedb::rt::invoke_reducer` --> src/rt.rs | | pub fn invoke_reducer<'a, A: Args<'a>>( @@ -271,9 +271,9 @@ error[E0593]: function is expected to take 2 arguments, but it takes 3 arguments 48 | fn scheduled_table_reducer(_ctx: &ReducerContext, _x: u8, _y: u8) {} | ----------------------------------------------------------------- takes 3 arguments | - = note: required for `for<'a> fn(&'a ReducerContext, u8, u8) {scheduled_table_reducer}` to implement `Reducer<'_, (ScheduledTable,)>` - = note: required for `for<'a> fn(&'a ReducerContext, u8, u8) {scheduled_table_reducer}` to implement `ExportFunctionForScheduledTable<'_, ScheduledTable, FnKindReducer>` -note: required by a bound in `scheduled_typecheck` + = note: required for `for<'a> fn(&'a ReducerContext, u8, u8) {scheduled_table_reducer}` to implement `spacetimedb::rt::Reducer<'_, (ScheduledTable,)>` + = note: required for `for<'a> fn(&'a ReducerContext, u8, u8) {scheduled_table_reducer}` to implement `spacetimedb::rt::ExportFunctionForScheduledTable<'_, ScheduledTable, spacetimedb::rt::FnKindReducer>` +note: required by a bound in `spacetimedb::rt::scheduled_typecheck` --> src/rt.rs | | pub const fn scheduled_typecheck<'de, Row, FnKind>(_x: impl ExportFunctionForScheduledTable<'de, Row, FnKind>) diff --git a/crates/bindings/tests/ui/tables.stderr b/crates/bindings/tests/ui/tables.stderr index 7609d9ba378..9072d344284 100644 --- a/crates/bindings/tests/ui/tables.stderr +++ b/crates/bindings/tests/ui/tables.stderr @@ -197,7 +197,7 @@ help: the trait `SpacetimeType` is not implemented for `Test` ArrayType Box and $N others - = note: required for `Test` to implement `TableColumn` + = note: required for `Test` to implement `spacetimedb::rt::TableColumn` error[E0277]: `&'a Alpha` cannot appear as an argument to an index filtering operation --> tests/ui/tables.rs:32:33 @@ -226,7 +226,7 @@ note: required by a bound in `UniqueColumn:: &'a Col::ColType: FilterableValue, | ^^^^^^^^^^^^^^^ required by this bound in `UniqueColumn::::ColType, Col>::find` -error[E0277]: the trait bound `Alpha: IndexScanRangeBounds<(Alpha,), SingleBound>` is not satisfied +error[E0277]: the trait bound `Alpha: spacetimedb::table::IndexScanRangeBounds<(Alpha,), spacetimedb::table::SingleBound>` is not satisfied --> tests/ui/tables.rs:33:40 | 33 | ctx.db.delta().compound_b().filter(Alpha { beta: 1 }); @@ -249,7 +249,7 @@ help: the trait `FilterableValue` is not implemented for `Alpha` &bool ðnum::int::I256 and $N others - = note: required for `Alpha` to implement `IndexScanRangeBounds<(Alpha,), SingleBound>` + = note: required for `Alpha` to implement `spacetimedb::table::IndexScanRangeBounds<(Alpha,), spacetimedb::table::SingleBound>` note: required by a bound in `RangedIndex::::filter` --> src/table.rs | diff --git a/crates/bindings/tests/ui/views.stderr b/crates/bindings/tests/ui/views.stderr index 2b0c0dd6033..426b623b985 100644 --- a/crates/bindings/tests/ui/views.stderr +++ b/crates/bindings/tests/ui/views.stderr @@ -54,36 +54,13 @@ error: Views do not take parameters other than `&ViewContext` or `&AnonymousView 138 | fn sched_table_view(_: &ViewContext, _args: ScheduledTable) -> Vec { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0425]: cannot find type `ScheduledTable` in this scope - --> tests/ui/views.rs:138:45 - | -138 | fn sched_table_view(_: &ViewContext, _args: ScheduledTable) -> Vec { - | ^^^^^^^^^^^^^^ not found in this scope - -error[E0425]: cannot find type `T` in this scope - --> tests/ui/views.rs:196:60 - | -196 | fn view_nonexistent_table(ctx: &ViewContext) -> impl Query { - | ^ not found in this scope - | -help: you might be missing a type parameter - | -196 | fn view_nonexistent_table(ctx: &ViewContext) -> impl Query { - | +++ - -error[E0425]: cannot find type `T` in this scope - --> tests/ui/views.rs:196:60 - | -196 | fn view_nonexistent_table(ctx: &ViewContext) -> impl Query { - | ^ not found in this scope - -error[E0277]: the trait bound `spacetimedb::rt::ViewKind: ViewKindTrait` is not satisfied +error[E0277]: the trait bound `spacetimedb::rt::ViewKind: spacetimedb::rt::ViewKindTrait` is not satisfied --> tests/ui/views.rs:101:1 | 101 | #[view(accessor = view_def_wrong_context, public)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `ViewKindTrait` is not implemented for `spacetimedb::rt::ViewKind` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `spacetimedb::rt::ViewKindTrait` is not implemented for `spacetimedb::rt::ViewKind` | -help: the following other types implement trait `ViewKindTrait` +help: the following other types implement trait `spacetimedb::rt::ViewKindTrait` --> src/rt.rs | | impl ViewKindTrait for ViewKind { @@ -97,7 +74,7 @@ error[E0276]: impl has stricter requirements than trait --> tests/ui/views.rs:101:1 | 101 | #[view(accessor = view_def_wrong_context, public)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `spacetimedb::rt::ViewKind: ViewKindTrait` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ impl has extra requirement `spacetimedb::rt::ViewKind: spacetimedb::rt::ViewKindTrait` | = note: this error originates in the attribute macro `view` (in Nightly builds, run with -Z macro-backtrace for more info) @@ -123,8 +100,7 @@ error[E0599]: no method named `insert` found for reference `&test__ViewHandle` i candidate #1: `bitflags::traits::Flags` candidate #2: `ppv_lite86::types::Vec2` candidate #3: `ppv_lite86::types::Vec4` - candidate #4: `similar::algorithms::DiffHook` - candidate #5: `spacetimedb::Table` + candidate #4: `spacetimedb::Table` error[E0599]: no method named `try_insert` found for reference `&test__ViewHandle` in the current scope --> tests/ui/views.rs:31:25 @@ -149,9 +125,8 @@ error[E0599]: no method named `delete` found for reference `&test__ViewHandle` i | ^^^^^^ method not found in `&test__ViewHandle` | = help: items from traits can only be used if the trait is implemented and in scope - = note: the following traits define an item `delete`, perhaps you need to implement one of them: - candidate #1: `similar::algorithms::DiffHook` - candidate #2: `spacetimedb::Table` + = note: the following trait defines an item `delete`, perhaps you need to implement it: + candidate #1: `spacetimedb::Table` error[E0599]: no method named `delete` found for struct `UniqueColumnReadOnly` in the current scope --> tests/ui/views.rs:45:30 @@ -171,24 +146,24 @@ error[E0599]: no method named `delete` found for struct `RangedIndexReadOnly` -error[E0599]: no function or associated item named `register` found for struct `ViewRegistrar` in the current scope +error[E0599]: no associated function or constant named `register` found for struct `spacetimedb::rt::ViewRegistrar` in the current scope --> tests/ui/views.rs:101:1 | 101 | #[view(accessor = view_def_wrong_context, public)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `ViewRegistrar` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated function or constant not found in `spacetimedb::rt::ViewRegistrar` | - = note: the function or associated item was found for - - `ViewRegistrar` - - `ViewRegistrar` + = note: the associated function or constant was found for + - `spacetimedb::rt::ViewRegistrar` + - `spacetimedb::rt::ViewRegistrar` = note: this error originates in the attribute macro `view` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: The first parameter of a `#[view]` must be `&ViewContext` or `&AnonymousViewContext` --> tests/ui/views.rs:102:31 | 102 | fn view_def_wrong_context(_: &ReducerContext) -> Vec { - | ^^^^^^^^^^^^^^ the trait `ViewContextArg` is not implemented for `ReducerContext` + | ^^^^^^^^^^^^^^ the trait `spacetimedb::rt::ViewContextArg` is not implemented for `ReducerContext` | -help: the following other types implement trait `ViewContextArg` +help: the following other types implement trait `spacetimedb::rt::ViewContextArg` --> src/rt.rs | | impl ViewContextArg for ViewContext {} @@ -196,15 +171,15 @@ help: the following other types implement trait `ViewContextArg` | impl ViewContextArg for AnonymousViewContext {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `AnonymousViewContext` -error[E0599]: no function or associated item named `invoke` found for struct `ViewDispatcher` in the current scope +error[E0599]: no associated function or constant named `invoke` found for struct `spacetimedb::rt::ViewDispatcher` in the current scope --> tests/ui/views.rs:101:1 | 101 | #[view(accessor = view_def_wrong_context, public)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function or associated item not found in `ViewDispatcher` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated function or constant not found in `spacetimedb::rt::ViewDispatcher` | - = note: the function or associated item was found for - - `ViewDispatcher` - - `ViewDispatcher` + = note: the associated function or constant was found for + - `spacetimedb::rt::ViewDispatcher` + - `spacetimedb::rt::ViewDispatcher` = note: this error originates in the attribute macro `view` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: invalid view signature @@ -219,7 +194,7 @@ error[E0277]: invalid view signature = note: `Fn(&ViewContext, [T1, ...]) -> Vec | Option` = note: where each `Ti` implements `SpacetimeType`. = note: -note: required by a bound in `ViewRegistrar::::register` +note: required by a bound in `spacetimedb::rt::ViewRegistrar::::register` --> src/rt.rs | | pub fn register<'a, A, I, T, V>(view: V) @@ -235,12 +210,12 @@ error[E0277]: Views must return `Vec` or `Option` where `T` is a `Spacetim 124 | fn view_def_wrong_return(_: &ViewContext) -> Player { | ^^^^^^ unsatisfied trait bound | -help: the trait `ViewReturn` is not implemented for `Player` +help: the trait `spacetimedb::rt::ViewReturn` is not implemented for `Player` --> tests/ui/views.rs:63:1 | 63 | struct Player { | ^^^^^^^^^^^^^ - = help: the following other types implement trait `ViewReturn`: + = help: the following other types implement trait `spacetimedb::rt::ViewReturn`: FromWhere LeftSemiJoin Option @@ -261,7 +236,7 @@ error[E0277]: invalid view signature = note: `Fn(&ViewContext, [T1, ...]) -> Vec | Option` = note: where each `Ti` implements `SpacetimeType`. = note: -note: required by a bound in `ViewDispatcher::::invoke` +note: required by a bound in `spacetimedb::rt::ViewDispatcher::::invoke` --> src/rt.rs | | pub fn invoke<'a, A, T, V>(view: V, ctx: ViewContext, args: &'a [u8]) -> Vec @@ -277,13 +252,13 @@ error[E0277]: invalid anonymous view signature 131 | #[view(accessor = view_def_returns_not_a_spacetime_type, public)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this view signature is not valid | - = help: the trait `AnonymousView<'_, _, _>` is not implemented for fn item `for<'a> fn(&'a AnonymousViewContext) -> Option {view_def_returns_not_a_spacetime_type}` + = help: the trait `spacetimedb::rt::AnonymousView<'_, _, _>` is not implemented for fn item `for<'a> fn(&'a AnonymousViewContext) -> Option {view_def_returns_not_a_spacetime_type}` = note: = note: anonymous view signatures must match: = note: `Fn(&AnonymousViewContext, [T1, ...]) -> Vec | Option` = note: where each `Ti` implements `SpacetimeType`. = note: -note: required by a bound in `ViewRegistrar::::register` +note: required by a bound in `spacetimedb::rt::ViewRegistrar::::register` --> src/rt.rs | | pub fn register<'a, A, I, T, V>(view: V) @@ -315,7 +290,7 @@ help: the trait `SpacetimeType` is not implemented for `NotSpacetimeType` Box ColumnAttribute and $N others - = note: required for `Option` to implement `ViewReturn` + = note: required for `Option` to implement `spacetimedb::rt::ViewReturn` error[E0277]: the trait bound `NotSpacetimeType: Serialize` is not satisfied --> tests/ui/views.rs:132:71 @@ -338,7 +313,7 @@ help: the trait `Serialize` is not implemented for `NotSpacetimeType` (T0, T1, T2, T3, T4, T5) (T0, T1, T2, T3, T4, T5, T6) and $N others - = note: required for `Option` to implement `ViewReturn` + = note: required for `Option` to implement `spacetimedb::rt::ViewReturn` error[E0277]: invalid anonymous view signature --> tests/ui/views.rs:131:1 @@ -346,13 +321,13 @@ error[E0277]: invalid anonymous view signature 131 | #[view(accessor = view_def_returns_not_a_spacetime_type, public)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this view signature is not valid | - = help: the trait `AnonymousView<'_, _, _>` is not implemented for fn item `for<'a> fn(&'a AnonymousViewContext) -> Option {view_def_returns_not_a_spacetime_type}` + = help: the trait `spacetimedb::rt::AnonymousView<'_, _, _>` is not implemented for fn item `for<'a> fn(&'a AnonymousViewContext) -> Option {view_def_returns_not_a_spacetime_type}` = note: = note: anonymous view signatures must match: = note: `Fn(&AnonymousViewContext, [T1, ...]) -> Vec | Option` = note: where each `Ti` implements `SpacetimeType`. = note: -note: required by a bound in `ViewDispatcher::::invoke` +note: required by a bound in `spacetimedb::rt::ViewDispatcher::::invoke` --> src/rt.rs | | pub fn invoke<'a, A, T, V>(view: V, ctx: AnonymousViewContext, args: &'a [u8]) -> Vec @@ -422,8 +397,11 @@ help: the trait `RHS` is not implemented for `u32` but trait `RHS` is implemented for it --> $WORKSPACE/crates/query-builder/src/expr.rs | + | impl RHS for $ty { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ +... | impl_rhs!(u32, |v: u32| v.to_string()); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | -------------------------------------- in this macro invocation = help: for that trait implementation, expected `u32`, found `u8` note: required by a bound in `Col::::eq` --> $WORKSPACE/crates/query-builder/src/table.rs @@ -496,7 +474,7 @@ error[E0277]: `&'a NonFilterableViewPrimaryKey` cannot appear as an argument to ðnum::int::I256 ðnum::uint::U256 and $N others - = note: required for `NonFilterableViewPrimaryKey` to implement `ViewPrimaryKeyColumn` + = note: required for `NonFilterableViewPrimaryKey` to implement `spacetimedb::ViewPrimaryKeyColumn` note: required by a bound in `_::_assert_view_primary_key_column::_assert_view_primary_key_column_type` --> tests/ui/views.rs:229:1 |