mirror of
https://github.com/clockworklabs/SpacetimeDB.git
synced 2026-05-11 02:00:04 -04:00
bless ui tests
This commit is contained in:
@@ -44,8 +44,13 @@ error[E0277]: the reducer argument `Test` does not implement `SpacetimeType`
|
||||
--> tests/ui/reducers.rs:6:40
|
||||
|
|
||||
6 | fn bad_type(_ctx: &ReducerContext, _a: Test) {}
|
||||
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`
|
||||
| ^^^^ unsatisfied trait bound
|
||||
|
|
||||
help: the trait `SpacetimeType` is not implemented for `Test`
|
||||
--> tests/ui/reducers.rs:3:1
|
||||
|
|
||||
3 | struct Test;
|
||||
| ^^^^^^^^^^^
|
||||
= note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition
|
||||
= help: the following other types implement trait `SpacetimeType`:
|
||||
&T
|
||||
@@ -55,7 +60,7 @@ error[E0277]: the reducer argument `Test` does not implement `SpacetimeType`
|
||||
Arc<T>
|
||||
ArrayType
|
||||
Box<T>
|
||||
ColId
|
||||
ColumnAttribute
|
||||
and $N others
|
||||
= note: required for `Test` to implement `ReducerArg`
|
||||
|
||||
@@ -105,12 +110,22 @@ error[E0277]: `Test` is not a valid reducer return type
|
||||
--> tests/ui/reducers.rs:9:46
|
||||
|
|
||||
9 | fn bad_return_type(_ctx: &ReducerContext) -> Test {
|
||||
| ^^^^ the trait `IntoReducerResult` is not implemented for `Test`
|
||||
| ^^^^ unsatisfied trait bound
|
||||
|
|
||||
help: the trait `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`:
|
||||
()
|
||||
Result<(), E>
|
||||
help: the following other types implement trait `IntoReducerResult`
|
||||
--> src/rt.rs
|
||||
|
|
||||
| impl IntoReducerResult for () {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `()`
|
||||
...
|
||||
| impl<E: fmt::Display> IntoReducerResult for Result<(), E> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Result<(), E>`
|
||||
|
||||
error[E0277]: invalid reducer signature
|
||||
--> tests/ui/reducers.rs:9:4
|
||||
@@ -161,7 +176,11 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext`
|
||||
| ^^ 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 `ReducerContextArg` is implemented for `&ReducerContext`
|
||||
--> src/rt.rs
|
||||
|
|
||||
| impl ReducerContextArg for &ReducerContext {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: invalid reducer signature
|
||||
--> tests/ui/reducers.rs:23:4
|
||||
@@ -212,7 +231,11 @@ error[E0277]: the first argument of a reducer must be `&ReducerContext`
|
||||
| ^^^^^^^^^^^^^^ 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 `ReducerContextArg` is implemented for `&ReducerContext`
|
||||
--> src/rt.rs
|
||||
|
|
||||
| impl ReducerContextArg for &ReducerContext {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0277]: invalid reducer signature
|
||||
--> tests/ui/reducers.rs:26:4
|
||||
|
||||
@@ -14,8 +14,13 @@ error[E0277]: the trait bound `Test: SpacetimeType` is not satisfied
|
||||
--> tests/ui/tables.rs:5:8
|
||||
|
|
||||
5 | x: Test,
|
||||
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`
|
||||
| ^^^^ unsatisfied trait bound
|
||||
|
|
||||
help: the trait `SpacetimeType` is not implemented for `Test`
|
||||
--> tests/ui/tables.rs:1:1
|
||||
|
|
||||
1 | struct Test;
|
||||
| ^^^^^^^^^^^
|
||||
= note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition
|
||||
= help: the following other types implement trait `SpacetimeType`:
|
||||
&T
|
||||
@@ -35,8 +40,13 @@ error[E0277]: the trait bound `Test: Deserialize<'de>` is not satisfied
|
||||
| ----------------------------------- required by a bound introduced by this call
|
||||
4 | struct Table {
|
||||
5 | x: Test,
|
||||
| ^^^^ the trait `Deserialize<'de>` is not implemented for `Test`
|
||||
| ^^^^ unsatisfied trait bound
|
||||
|
|
||||
help: the trait `Deserialize<'de>` is not implemented for `Test`
|
||||
--> tests/ui/tables.rs:1:1
|
||||
|
|
||||
1 | struct Test;
|
||||
| ^^^^^^^^^^^
|
||||
= help: the following other types implement trait `Deserialize<'de>`:
|
||||
&'de [u8]
|
||||
&'de str
|
||||
@@ -57,8 +67,13 @@ error[E0277]: the trait bound `Test: Deserialize<'_>` is not satisfied
|
||||
--> tests/ui/tables.rs:5:8
|
||||
|
|
||||
5 | x: Test,
|
||||
| ^^^^ the trait `Deserialize<'_>` is not implemented for `Test`
|
||||
| ^^^^ unsatisfied trait bound
|
||||
|
|
||||
help: the trait `Deserialize<'_>` is not implemented for `Test`
|
||||
--> tests/ui/tables.rs:1:1
|
||||
|
|
||||
1 | struct Test;
|
||||
| ^^^^^^^^^^^
|
||||
= help: the following other types implement trait `Deserialize<'de>`:
|
||||
&'de [u8]
|
||||
&'de str
|
||||
@@ -79,8 +94,13 @@ error[E0277]: the trait bound `Test: Serialize` is not satisfied
|
||||
--> tests/ui/tables.rs:5:8
|
||||
|
|
||||
5 | x: Test,
|
||||
| ^^^^ the trait `Serialize` is not implemented for `Test`
|
||||
| ^^^^ unsatisfied trait bound
|
||||
|
|
||||
help: the trait `Serialize` is not implemented for `Test`
|
||||
--> tests/ui/tables.rs:1:1
|
||||
|
|
||||
1 | struct Test;
|
||||
| ^^^^^^^^^^^
|
||||
= help: the following other types implement trait `Serialize`:
|
||||
&T
|
||||
()
|
||||
@@ -101,8 +121,13 @@ error[E0277]: the column type `Test` does not implement `SpacetimeType`
|
||||
--> tests/ui/tables.rs:5:8
|
||||
|
|
||||
5 | x: Test,
|
||||
| ^^^^ the trait `SpacetimeType` is not implemented for `Test`
|
||||
| ^^^^ unsatisfied trait bound
|
||||
|
|
||||
help: the trait `SpacetimeType` is not implemented for `Test`
|
||||
--> tests/ui/tables.rs:1:1
|
||||
|
|
||||
1 | struct Test;
|
||||
| ^^^^^^^^^^^
|
||||
= 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`:
|
||||
@@ -148,10 +173,15 @@ error[E0277]: the trait bound `Alpha: IndexScanRangeBounds<(Alpha,), SingleBound
|
||||
--> tests/ui/tables.rs:33:40
|
||||
|
|
||||
33 | ctx.db.delta().compound_b().filter(Alpha { beta: 1 });
|
||||
| ------ ^^^^^^^^^^^^^^^^^ the trait `FilterableValue` is not implemented for `Alpha`
|
||||
| ------ ^^^^^^^^^^^^^^^^^ unsatisfied trait bound
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
help: the trait `FilterableValue` is not implemented for `Alpha`
|
||||
--> tests/ui/tables.rs:17:1
|
||||
|
|
||||
17 | struct Alpha {
|
||||
| ^^^^^^^^^^^^
|
||||
= help: the following other types implement trait `FilterableValue`:
|
||||
&ConnectionId
|
||||
&FunctionVisibility
|
||||
|
||||
@@ -54,13 +54,13 @@ error: Views do not take parameters other than `&ViewContext` or `&AnonymousView
|
||||
143 | fn sched_table_view(_: &ViewContext, _args: ScheduledTable) -> Vec<PlayerInfo> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error[E0412]: cannot find type `ScheduledTable` in this scope
|
||||
error[E0425]: cannot find type `ScheduledTable` in this scope
|
||||
--> tests/ui/views.rs:143:45
|
||||
|
|
||||
143 | fn sched_table_view(_: &ViewContext, _args: ScheduledTable) -> Vec<PlayerInfo> {
|
||||
| ^^^^^^^^^^^^^^ not found in this scope
|
||||
|
||||
error[E0412]: cannot find type `T` in this scope
|
||||
error[E0425]: cannot find type `T` in this scope
|
||||
--> tests/ui/views.rs:202:55
|
||||
|
|
||||
202 | fn view_nonexistent_table(ctx: &ViewContext) -> Query<T> {
|
||||
@@ -71,7 +71,7 @@ help: you might be missing a type parameter
|
||||
202 | fn view_nonexistent_table<T>(ctx: &ViewContext) -> Query<T> {
|
||||
| +++
|
||||
|
||||
error[E0412]: cannot find type `T` in this scope
|
||||
error[E0425]: cannot find type `T` in this scope
|
||||
--> tests/ui/views.rs:202:55
|
||||
|
|
||||
202 | fn view_nonexistent_table(ctx: &ViewContext) -> Query<T> {
|
||||
@@ -83,9 +83,14 @@ error[E0277]: the trait bound `ViewKind<ReducerContext>: ViewKindTrait` is not s
|
||||
106 | #[view(name = view_def_wrong_context, public)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `ViewKindTrait` is not implemented for `ViewKind<ReducerContext>`
|
||||
|
|
||||
= help: the following other types implement trait `ViewKindTrait`:
|
||||
ViewKind<AnonymousViewContext>
|
||||
ViewKind<ViewContext>
|
||||
help: the following other types implement trait `ViewKindTrait`
|
||||
--> src/rt.rs
|
||||
|
|
||||
| impl ViewKindTrait for ViewKind<ViewContext> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ViewKind<ViewContext>`
|
||||
...
|
||||
| impl ViewKindTrait for ViewKind<AnonymousViewContext> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ViewKind<AnonymousViewContext>`
|
||||
= note: this error originates in the attribute macro `view` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0276]: impl has stricter requirements than trait
|
||||
@@ -172,19 +177,19 @@ error[E0599]: no method named `delete` found for reference `&test__ViewHandle` i
|
||||
candidate #1: `similar::algorithms::DiffHook`
|
||||
candidate #2: `spacetimedb::Table`
|
||||
|
||||
error[E0599]: no method named `delete` found for struct `UniqueColumnReadOnly` in the current scope
|
||||
error[E0599]: no method named `delete` found for struct `UniqueColumnReadOnly<Tbl, ColType, Col>` in the current scope
|
||||
--> tests/ui/views.rs:50:30
|
||||
|
|
||||
50 | read_only.db.test().id().delete(&0);
|
||||
| ^^^^^^ method not found in `UniqueColumnReadOnly<test__TableHandle, u32, id>`
|
||||
|
||||
error[E0599]: no method named `update` found for struct `UniqueColumnReadOnly` in the current scope
|
||||
error[E0599]: no method named `update` found for struct `UniqueColumnReadOnly<Tbl, ColType, Col>` in the current scope
|
||||
--> tests/ui/views.rs:57:30
|
||||
|
|
||||
57 | read_only.db.test().id().update(Test { id: 0, x: 0 });
|
||||
| ^^^^^^ method not found in `UniqueColumnReadOnly<test__TableHandle, u32, id>`
|
||||
|
||||
error[E0599]: no method named `delete` found for struct `RangedIndexReadOnly` in the current scope
|
||||
error[E0599]: no method named `delete` found for struct `RangedIndexReadOnly<Tbl, IndexType, Idx>` in the current scope
|
||||
--> tests/ui/views.rs:64:29
|
||||
|
|
||||
64 | read_only.db.test().x().delete(0u32..);
|
||||
@@ -207,9 +212,13 @@ error[E0277]: The first parameter of a `#[view]` must be `&ViewContext` or `&Ano
|
||||
107 | fn view_def_wrong_context(_: &ReducerContext) -> Vec<Player> {
|
||||
| ^^^^^^^^^^^^^^ the trait `ViewContextArg` is not implemented for `ReducerContext`
|
||||
|
|
||||
= help: the following other types implement trait `ViewContextArg`:
|
||||
AnonymousViewContext
|
||||
ViewContext
|
||||
help: the following other types implement trait `ViewContextArg`
|
||||
--> src/rt.rs
|
||||
|
|
||||
| impl ViewContextArg for ViewContext {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `ViewContext`
|
||||
| impl ViewContextArg for AnonymousViewContext {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `AnonymousViewContext`
|
||||
|
||||
error[E0599]: no function or associated item named `invoke` found for struct `ViewDispatcher<ReducerContext>` in the current scope
|
||||
--> tests/ui/views.rs:106:1
|
||||
@@ -248,12 +257,24 @@ error[E0277]: Views must return `Vec<T>` or `Option<T>` where `T` is a `Spacetim
|
||||
--> tests/ui/views.rs:129:46
|
||||
|
|
||||
129 | fn view_def_wrong_return(_: &ViewContext) -> Player {
|
||||
| ^^^^^^ the trait `ViewReturn` is not implemented for `Player`
|
||||
| ^^^^^^ unsatisfied trait bound
|
||||
|
|
||||
= help: the following other types implement trait `ViewReturn`:
|
||||
Option<T>
|
||||
Query<T>
|
||||
Vec<T>
|
||||
help: the trait `ViewReturn` is not implemented for `Player`
|
||||
--> tests/ui/views.rs:68:1
|
||||
|
|
||||
68 | struct Player {
|
||||
| ^^^^^^^^^^^^^
|
||||
help: the following other types implement trait `ViewReturn`
|
||||
--> src/rt.rs
|
||||
|
|
||||
| impl<T: SpacetimeType + Serialize> ViewReturn for Vec<T> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Vec<T>`
|
||||
...
|
||||
| impl<T: SpacetimeType + Serialize> ViewReturn for Option<T> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Option<T>`
|
||||
...
|
||||
| impl<T: SpacetimeType + Serialize> ViewReturn for Query<T> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `Query<T>`
|
||||
|
||||
error[E0277]: invalid view signature
|
||||
--> tests/ui/views.rs:128:1
|
||||
@@ -303,8 +324,13 @@ error[E0277]: the trait bound `NotSpacetimeType: SpacetimeType` is not satisfied
|
||||
--> tests/ui/views.rs:137:71
|
||||
|
|
||||
137 | fn view_def_returns_not_a_spacetime_type(_: &AnonymousViewContext) -> Option<NotSpacetimeType> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SpacetimeType` is not implemented for `NotSpacetimeType`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
|
||||
|
|
||||
help: the trait `SpacetimeType` is not implemented for `NotSpacetimeType`
|
||||
--> tests/ui/views.rs:73:1
|
||||
|
|
||||
73 | struct NotSpacetimeType {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition
|
||||
= help: the following other types implement trait `SpacetimeType`:
|
||||
&T
|
||||
@@ -314,7 +340,7 @@ error[E0277]: the trait bound `NotSpacetimeType: SpacetimeType` is not satisfied
|
||||
Arc<T>
|
||||
ArrayType
|
||||
Box<T>
|
||||
ColId
|
||||
ColumnAttribute
|
||||
and $N others
|
||||
= note: required for `Option<NotSpacetimeType>` to implement `ViewReturn`
|
||||
|
||||
@@ -322,8 +348,13 @@ error[E0277]: the trait bound `NotSpacetimeType: Serialize` is not satisfied
|
||||
--> tests/ui/views.rs:137:71
|
||||
|
|
||||
137 | fn view_def_returns_not_a_spacetime_type(_: &AnonymousViewContext) -> Option<NotSpacetimeType> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Serialize` is not implemented for `NotSpacetimeType`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
|
||||
|
|
||||
help: the trait `Serialize` is not implemented for `NotSpacetimeType`
|
||||
--> tests/ui/views.rs:73:1
|
||||
|
|
||||
73 | struct NotSpacetimeType {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= help: the following other types implement trait `Serialize`:
|
||||
&T
|
||||
()
|
||||
@@ -362,8 +393,13 @@ error[E0277]: the trait bound `NotSpacetimeType: SpacetimeType` is not satisfied
|
||||
--> tests/ui/views.rs:137:71
|
||||
|
|
||||
137 | fn view_def_returns_not_a_spacetime_type(_: &AnonymousViewContext) -> Option<NotSpacetimeType> {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `SpacetimeType` is not implemented for `NotSpacetimeType`
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied trait bound
|
||||
|
|
||||
help: the trait `SpacetimeType` is not implemented for `NotSpacetimeType`
|
||||
--> tests/ui/views.rs:73:1
|
||||
|
|
||||
73 | struct NotSpacetimeType {}
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: if you own the type, try adding `#[derive(SpacetimeType)]` to its definition
|
||||
= help: the following other types implement trait `SpacetimeType`:
|
||||
&T
|
||||
@@ -373,7 +409,7 @@ error[E0277]: the trait bound `NotSpacetimeType: SpacetimeType` is not satisfied
|
||||
Arc<T>
|
||||
ArrayType
|
||||
Box<T>
|
||||
ColId
|
||||
ColumnAttribute
|
||||
and $N others
|
||||
= note: required for `Option<NotSpacetimeType>` to implement `SpacetimeType`
|
||||
|
||||
@@ -409,14 +445,19 @@ error[E0277]: the trait bound `u32: RHS<PlayerInfo, u8>` is not satisfied
|
||||
| |
|
||||
| required by a bound introduced by this call
|
||||
|
|
||||
= help: the trait `RHS<PlayerInfo, u8>` is not implemented for `u32`
|
||||
but trait `RHS<PlayerInfo, u32>` is implemented for it
|
||||
help: the trait `RHS<PlayerInfo, u8>` is not implemented for `u32`
|
||||
but trait `RHS<PlayerInfo, u32>` is implemented for it
|
||||
--> $WORKSPACE/crates/query-builder/src/expr.rs
|
||||
|
|
||||
| impl_rhs!(u32, |v: u32| v.to_string());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= help: for that trait implementation, expected `u32`, found `u8`
|
||||
note: required by a bound in `Col::<T, V>::eq`
|
||||
--> $WORKSPACE/crates/query-builder/src/table.rs
|
||||
|
|
||||
| pub fn eq<R: RHS<T, V>>(self, rhs: R) -> BoolExpr<T> {
|
||||
| ^^^^^^^^^ required by this bound in `Col::<T, V>::eq`
|
||||
= note: this error originates in the macro `impl_rhs` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error[E0308]: mismatched types
|
||||
--> tests/ui/views.rs:175:62
|
||||
|
||||
Reference in New Issue
Block a user