Skip to content

Commit ca19947

Browse files
committed
Update ui tests
1 parent c31103e commit ca19947

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
@@ -68,6 +68,16 @@ error[E0277]: the reducer argument `Test` does not implement `SpacetimeType`
6868
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`, which is required by `Test: ReducerArg`
6969
|
7070
= note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition
71+
= help: the following other types implement trait `SpacetimeType`:
72+
&T
73+
()
74+
Address
75+
AddressForUrl
76+
AlgebraicTypeRef
77+
Arc<T>
78+
ArrayType
79+
Box<T>
80+
and $N others
7181
= note: required for `Test` to implement `ReducerArg`
7282

7383
error[E0277]: invalid reducer signature
@@ -120,8 +130,8 @@ error[E0277]: `Test` is not a valid reducer return type
120130
|
121131
= note: reducers cannot return values -- you can only return `()` or `Result<(), impl Display>`
122132
= help: the following other types implement trait `IntoReducerResult`:
123-
Result<(), E>
124133
()
134+
Result<(), E>
125135

126136
error[E0277]: invalid reducer signature
127137
--> tests/ui/reducers.rs:9:4
@@ -169,9 +179,9 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext`
169179
--> tests/ui/reducers.rs:23:20
170180
|
171181
23 | fn missing_ctx(_a: u8) {}
172-
| ^^ the trait `ReducerContextArg` is not implemented for `u8`
182+
| ^^ first argument must be `&ReducerContext`
173183
|
174-
= note: all reducers must take `&ReducerContext` as their first argument
184+
= help: the trait `ReducerContextArg` is not implemented for `u8`
175185
= help: the trait `ReducerContextArg` is implemented for `&ReducerContext`
176186

177187
error[E0277]: invalid reducer signature
@@ -220,13 +230,9 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext`
220230
--> tests/ui/reducers.rs:26:21
221231
|
222232
26 | fn ctx_by_val(_ctx: ReducerContext, _a: u8) {}
223-
| ^^^^^^^^^^^^^^
224-
| |
225-
| the trait `ReducerContextArg` is not implemented for `ReducerContext`
226-
| the trait `ReducerContextArg` is not implemented for `ReducerContext`
233+
| ^^^^^^^^^^^^^^ first argument must be `&ReducerContext`
227234
|
228-
= note: the trait bound `ReducerContext: ReducerContextArg` is not satisfied
229-
= note: all reducers must take `&ReducerContext` as their first argument
235+
= help: the trait `ReducerContextArg` is not implemented for `ReducerContext`
230236
= help: the trait `ReducerContextArg` is implemented for `&ReducerContext`
231237

232238
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)