diff --git a/crates/bindings/src/rt.rs b/crates/bindings/src/rt.rs index 5618823accd..05990c1ef1b 100644 --- a/crates/bindings/src/rt.rs +++ b/crates/bindings/src/rt.rs @@ -100,7 +100,7 @@ impl IntoReducerResult for Result<(), E> { #[diagnostic::on_unimplemented( message = "the first argument of a reducer must be `&ReducerContext`", - note = "all reducers must take `&ReducerContext` as their first argument" + label = "first argument must be `&ReducerContext`" )] pub trait ReducerContextArg { // a little hack used in the macro to make error messages nicer. it generates ::_ITEM diff --git a/crates/bindings/tests/ui/reducers.stderr b/crates/bindings/tests/ui/reducers.stderr index bb48b5a371b..8615082bec0 100644 --- a/crates/bindings/tests/ui/reducers.stderr +++ b/crates/bindings/tests/ui/reducers.stderr @@ -57,6 +57,16 @@ error[E0277]: the reducer argument `Test` does not implement `SpacetimeType` | ^^^^ the trait `SpacetimeType` is not implemented for `Test`, which is required by `Test: ReducerArg` | = note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition + = help: the following other types implement trait `SpacetimeType`: + &T + () + Address + AddressForUrl + AlgebraicTypeRef + Arc + ArrayType + Box + and $N others = note: required for `Test` to implement `ReducerArg` error[E0277]: invalid reducer signature @@ -109,8 +119,8 @@ error[E0277]: `Test` is not a valid reducer return type | = note: reducers cannot return values -- you can only return `()` or `Result<(), impl Display>` = help: the following other types implement trait `IntoReducerResult`: - Result<(), E> () + Result<(), E> error[E0277]: invalid reducer signature --> tests/ui/reducers.rs:9:4 @@ -158,9 +168,9 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext` --> tests/ui/reducers.rs:23:20 | 23 | fn missing_ctx(_a: u8) {} - | ^^ the trait `ReducerContextArg` is not implemented for `u8` + | ^^ first argument must be `&ReducerContext` | - = note: all reducers must take `&ReducerContext` as their first argument + = help: the trait `ReducerContextArg` is not implemented for `u8` = help: the trait `ReducerContextArg` is implemented for `&ReducerContext` error[E0277]: invalid reducer signature @@ -209,13 +219,9 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext` --> tests/ui/reducers.rs:26:21 | 26 | fn ctx_by_val(_ctx: ReducerContext, _a: u8) {} - | ^^^^^^^^^^^^^^ - | | - | the trait `ReducerContextArg` is not implemented for `ReducerContext` - | the trait `ReducerContextArg` is not implemented for `ReducerContext` + | ^^^^^^^^^^^^^^ first argument must be `&ReducerContext` | - = note: the trait bound `ReducerContext: ReducerContextArg` is not satisfied - = note: all reducers must take `&ReducerContext` as their first argument + = help: the trait `ReducerContextArg` is not implemented for `ReducerContext` = help: the trait `ReducerContextArg` is implemented for `&ReducerContext` error[E0277]: invalid reducer signature diff --git a/crates/bindings/tests/ui/tables.stderr b/crates/bindings/tests/ui/tables.stderr index 0c4876c2306..361e0c76712 100644 --- a/crates/bindings/tests/ui/tables.stderr +++ b/crates/bindings/tests/ui/tables.stderr @@ -18,6 +18,16 @@ error[E0277]: the column type `Test` does not implement `SpacetimeType` | = note: table column types all must implement `SpacetimeType` = note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition + = help: the following other types implement trait `SpacetimeType`: + &T + () + Address + AddressForUrl + AlgebraicTypeRef + Arc + ArrayType + Box + and $N others = note: required for `Test` to implement `TableColumn` error[E0277]: the trait bound `Test: SpacetimeType` is not satisfied @@ -28,14 +38,14 @@ error[E0277]: the trait bound `Test: SpacetimeType` is not satisfied | = note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition = help: the following other types implement trait `SpacetimeType`: - bool - i8 - i16 - i32 - i64 - i128 - u8 - u16 + &T + () + Address + AddressForUrl + AlgebraicTypeRef + Arc + ArrayType + Box and $N others error[E0277]: the trait bound `Test: Deserialize<'de>` is not satisfied @@ -48,14 +58,14 @@ error[E0277]: the trait bound `Test: Deserialize<'de>` is not satisfied | ^^^^ the trait `Deserialize<'de>` is not implemented for `Test` | = help: the following other types implement trait `Deserialize<'de>`: - bool - i8 - i16 - i32 - i64 - i128 - u8 - u16 + &'de [u8] + &'de str + () + Address + AddressForUrl + AlgebraicTypeRef + Arc<[T]> + ArrayType and $N others note: required by a bound in `spacetimedb::spacetimedb_lib::de::SeqProductAccess::next_element` --> $WORKSPACE/crates/sats/src/de.rs @@ -70,14 +80,14 @@ error[E0277]: the trait bound `Test: Deserialize<'_>` is not satisfied | ^^^^ the trait `Deserialize<'_>` is not implemented for `Test` | = help: the following other types implement trait `Deserialize<'de>`: - bool - i8 - i16 - i32 - i64 - i128 - u8 - u16 + &'de [u8] + &'de str + () + Address + AddressForUrl + AlgebraicTypeRef + Arc<[T]> + ArrayType and $N others note: required by a bound in `get_field_value` --> $WORKSPACE/crates/sats/src/de.rs @@ -92,14 +102,14 @@ error[E0277]: the trait bound `Test: Serialize` is not satisfied | ^^^^ the trait `Serialize` is not implemented for `Test` | = help: the following other types implement trait `Serialize`: - bool - i8 - i16 - i32 - i64 - i128 - u8 - u16 + &T + () + Address + AddressForUrl + AlgebraicTypeRef + Arc + ArrayType + ArrayValue and $N others note: required by a bound in `spacetimedb::spacetimedb_lib::ser::SerializeNamedProduct::serialize_element` --> $WORKSPACE/crates/sats/src/ser.rs