Skip to content

Commit 0bef5d7

Browse files
committed
Update ui tests
1 parent f13bee1 commit 0bef5d7

File tree

3 files changed

+60
-44
lines changed

3 files changed

+60
-44
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: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,19 @@ error[E0277]: the reducer argument `Test` does not implement `SpacetimeType`
6464
--> tests/ui/reducers.rs:6:40
6565
|
6666
6 | fn bad_type(_ctx: &ReducerContext, _a: Test) {}
67-
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`, which is required by `Test: ReducerArg`
67+
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`
6868
|
6969
= note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition
70+
= help: the following other types implement trait `SpacetimeType`:
71+
&T
72+
()
73+
Address
74+
AddressForUrl
75+
AlgebraicTypeRef
76+
Arc<T>
77+
ArrayType
78+
Box<T>
79+
and $N others
7080
= note: required for `Test` to implement `ReducerArg`
7181

7282
error[E0277]: invalid reducer signature
@@ -119,8 +129,8 @@ error[E0277]: `Test` is not a valid reducer return type
119129
|
120130
= note: reducers cannot return values -- you can only return `()` or `Result<(), impl Display>`
121131
= help: the following other types implement trait `IntoReducerResult`:
122-
Result<(), E>
123132
()
133+
Result<(), E>
124134

125135
error[E0277]: invalid reducer signature
126136
--> tests/ui/reducers.rs:9:4
@@ -168,9 +178,9 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext`
168178
--> tests/ui/reducers.rs:23:20
169179
|
170180
23 | fn missing_ctx(_a: u8) {}
171-
| ^^ the trait `ReducerContextArg` is not implemented for `u8`
181+
| ^^ first argument must be `&ReducerContext`
172182
|
173-
= note: all reducers must take `&ReducerContext` as their first argument
183+
= help: the trait `ReducerContextArg` is not implemented for `u8`
174184
= help: the trait `ReducerContextArg` is implemented for `&ReducerContext`
175185

176186
error[E0277]: invalid reducer signature
@@ -219,13 +229,9 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext`
219229
--> tests/ui/reducers.rs:26:21
220230
|
221231
26 | fn ctx_by_val(_ctx: ReducerContext, _a: u8) {}
222-
| ^^^^^^^^^^^^^^
223-
| |
224-
| the trait `ReducerContextArg` is not implemented for `ReducerContext`
225-
| the trait `ReducerContextArg` is not implemented for `ReducerContext`
232+
| ^^^^^^^^^^^^^^ first argument must be `&ReducerContext`
226233
|
227-
= note: the trait bound `ReducerContext: ReducerContextArg` is not satisfied
228-
= note: all reducers must take `&ReducerContext` as their first argument
234+
= help: the trait `ReducerContextArg` is not implemented for `ReducerContext`
229235
= help: the trait `ReducerContextArg` is implemented for `&ReducerContext`
230236

231237
error[E0277]: invalid reducer signature

crates/bindings/tests/ui/tables.stderr

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,20 @@ error[E0277]: the column type `Test` does not implement `SpacetimeType`
1414
--> tests/ui/tables.rs:5:8
1515
|
1616
5 | x: Test,
17-
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`, which is required by `Test: TableColumn`
17+
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`
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)