Skip to content

Commit f2a4169

Browse files
committed
Update ui tests
1 parent 68d3760 commit f2a4169

File tree

3 files changed

+58
-42
lines changed

3 files changed

+58
-42
lines changed

crates/bindings/src/rt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl<E: fmt::Display> IntoReducerResult for Result<(), E> {
100100

101101
#[diagnostic::on_unimplemented(
102102
message = "the first argument of a reducer must be `&ReducerContext`",
103-
note = "all reducers must take `&ReducerContext` as their first argument"
103+
label = "first argument must be `&ReducerContext`"
104104
)]
105105
pub trait ReducerContextArg {
106106
// a little hack used in the macro to make error messages nicer. it generates <T as ReducerContextArg>::_ITEM

crates/bindings/tests/ui/reducers.stderr

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ error[E0277]: the reducer argument `Test` does not implement `SpacetimeType`
5757
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`, which is required by `Test: ReducerArg`
5858
|
5959
= note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition
60+
= help: the following other types implement trait `SpacetimeType`:
61+
&T
62+
()
63+
Address
64+
AddressForUrl
65+
AlgebraicTypeRef
66+
Arc<T>
67+
ArrayType
68+
Box<T>
69+
and $N others
6070
= note: required for `Test` to implement `ReducerArg`
6171

6272
error[E0277]: invalid reducer signature
@@ -109,8 +119,8 @@ error[E0277]: `Test` is not a valid reducer return type
109119
|
110120
= note: reducers cannot return values -- you can only return `()` or `Result<(), impl Display>`
111121
= help: the following other types implement trait `IntoReducerResult`:
112-
Result<(), E>
113122
()
123+
Result<(), E>
114124

115125
error[E0277]: invalid reducer signature
116126
--> tests/ui/reducers.rs:9:4
@@ -158,9 +168,9 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext`
158168
--> tests/ui/reducers.rs:23:20
159169
|
160170
23 | fn missing_ctx(_a: u8) {}
161-
| ^^ the trait `ReducerContextArg` is not implemented for `u8`
171+
| ^^ first argument must be `&ReducerContext`
162172
|
163-
= note: all reducers must take `&ReducerContext` as their first argument
173+
= help: the trait `ReducerContextArg` is not implemented for `u8`
164174
= help: the trait `ReducerContextArg` is implemented for `&ReducerContext`
165175

166176
error[E0277]: invalid reducer signature
@@ -209,13 +219,9 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext`
209219
--> tests/ui/reducers.rs:26:21
210220
|
211221
26 | fn ctx_by_val(_ctx: ReducerContext, _a: u8) {}
212-
| ^^^^^^^^^^^^^^
213-
| |
214-
| the trait `ReducerContextArg` is not implemented for `ReducerContext`
215-
| the trait `ReducerContextArg` is not implemented for `ReducerContext`
222+
| ^^^^^^^^^^^^^^ first argument must be `&ReducerContext`
216223
|
217-
= note: the trait bound `ReducerContext: ReducerContextArg` is not satisfied
218-
= note: all reducers must take `&ReducerContext` as their first argument
224+
= help: the trait `ReducerContextArg` is not implemented for `ReducerContext`
219225
= help: the trait `ReducerContextArg` is implemented for `&ReducerContext`
220226

221227
error[E0277]: invalid reducer signature

crates/bindings/tests/ui/tables.stderr

Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ error[E0277]: the column type `Test` does not implement `SpacetimeType`
1818
|
1919
= note: table column types all must implement `SpacetimeType`
2020
= note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition
21+
= help: the following other types implement trait `SpacetimeType`:
22+
&T
23+
()
24+
Address
25+
AddressForUrl
26+
AlgebraicTypeRef
27+
Arc<T>
28+
ArrayType
29+
Box<T>
30+
and $N others
2131
= note: required for `Test` to implement `TableColumn`
2232

2333
error[E0277]: the trait bound `Test: SpacetimeType` is not satisfied
@@ -28,14 +38,14 @@ error[E0277]: the trait bound `Test: SpacetimeType` is not satisfied
2838
|
2939
= note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition
3040
= help: the following other types implement trait `SpacetimeType`:
31-
bool
32-
i8
33-
i16
34-
i32
35-
i64
36-
i128
37-
u8
38-
u16
41+
&T
42+
()
43+
Address
44+
AddressForUrl
45+
AlgebraicTypeRef
46+
Arc<T>
47+
ArrayType
48+
Box<T>
3949
and $N others
4050

4151
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
4858
| ^^^^ the trait `Deserialize<'de>` is not implemented for `Test`
4959
|
5060
= help: the following other types implement trait `Deserialize<'de>`:
51-
bool
52-
i8
53-
i16
54-
i32
55-
i64
56-
i128
57-
u8
58-
u16
61+
&'de [u8]
62+
&'de str
63+
()
64+
Address
65+
AddressForUrl
66+
AlgebraicTypeRef
67+
Arc<[T]>
68+
ArrayType
5969
and $N others
6070
note: required by a bound in `spacetimedb::spacetimedb_lib::de::SeqProductAccess::next_element`
6171
--> $WORKSPACE/crates/sats/src/de.rs
@@ -70,14 +80,14 @@ error[E0277]: the trait bound `Test: Deserialize<'_>` is not satisfied
7080
| ^^^^ the trait `Deserialize<'_>` is not implemented for `Test`
7181
|
7282
= help: the following other types implement trait `Deserialize<'de>`:
73-
bool
74-
i8
75-
i16
76-
i32
77-
i64
78-
i128
79-
u8
80-
u16
83+
&'de [u8]
84+
&'de str
85+
()
86+
Address
87+
AddressForUrl
88+
AlgebraicTypeRef
89+
Arc<[T]>
90+
ArrayType
8191
and $N others
8292
note: required by a bound in `get_field_value`
8393
--> $WORKSPACE/crates/sats/src/de.rs
@@ -92,14 +102,14 @@ error[E0277]: the trait bound `Test: Serialize` is not satisfied
92102
| ^^^^ the trait `Serialize` is not implemented for `Test`
93103
|
94104
= help: the following other types implement trait `Serialize`:
95-
bool
96-
i8
97-
i16
98-
i32
99-
i64
100-
i128
101-
u8
102-
u16
105+
&T
106+
()
107+
Address
108+
AddressForUrl
109+
AlgebraicTypeRef
110+
Arc<T>
111+
ArrayType
112+
ArrayValue
103113
and $N others
104114
note: required by a bound in `spacetimedb::spacetimedb_lib::ser::SerializeNamedProduct::serialize_element`
105115
--> $WORKSPACE/crates/sats/src/ser.rs

0 commit comments

Comments
 (0)