Skip to content

Commit a561167

Browse files
committed
Updated derive tests.
1 parent 8fd726d commit a561167

File tree

4 files changed

+13
-27
lines changed

4 files changed

+13
-27
lines changed

api/swimos_form/src/tests/derive/form/generic.stderr

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ error[E0599]: the method `as_value` exists for struct `S<Valid, Invalid>`, but i
22
--> src/tests/derive/form/generic.rs:34:15
33
|
44
24 | struct S<A, B> {
5-
| --------------
6-
| |
7-
| method `as_value` not found for this struct
8-
| doesn't satisfy `S<Valid, Invalid>: Form`
9-
| doesn't satisfy `S<Valid, Invalid>: StructuralReadable`
10-
| doesn't satisfy `S<Valid, Invalid>: StructuralWritable`
5+
| -------------- method `as_value` not found for this struct because it doesn't satisfy `S<Valid, Invalid>: Form`, `S<Valid, Invalid>: StructuralReadable` or `S<Valid, Invalid>: StructuralWritable`
116
...
127
34 | let _ = s.as_value();
138
| ^^^^^^^^ method cannot be called on `S<Valid, Invalid>` due to unsatisfied trait bounds
@@ -27,3 +22,6 @@ note: the traits `StructuralReadable` and `StructuralWritable` must be implement
2722
|
2823
| pub trait StructuralWritable {
2924
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25+
= help: items from traits can only be used if the trait is implemented and in scope
26+
= note: the following trait defines an item `as_value`, perhaps you need to implement it:
27+
candidate #1: `Form`

api/swimos_form/src/tests/derive/form/generic_no_default.stderr

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@ error[E0599]: the method `as_value` exists for struct `S<Valid, Skipped>`, but i
22
--> src/tests/derive/form/generic_no_default.rs:35:15
33
|
44
24 | struct S<A, B> {
5-
| --------------
6-
| |
7-
| method `as_value` not found for this struct
8-
| doesn't satisfy `S<Valid, Skipped>: Form`
9-
| doesn't satisfy `S<Valid, Skipped>: StructuralReadable`
10-
| doesn't satisfy `S<Valid, Skipped>: StructuralWritable`
5+
| -------------- method `as_value` not found for this struct because it doesn't satisfy `S<Valid, Skipped>: Form`, `S<Valid, Skipped>: StructuralReadable` or `S<Valid, Skipped>: StructuralWritable`
116
...
127
35 | let _ = s.as_value();
138
| ^^^^^^^^ method cannot be called on `S<Valid, Skipped>` due to unsatisfied trait bounds
@@ -27,6 +22,9 @@ note: the traits `StructuralReadable` and `StructuralWritable` must be implement
2722
|
2823
| pub trait StructuralWritable {
2924
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25+
= help: items from traits can only be used if the trait is implemented and in scope
26+
= note: the following trait defines an item `as_value`, perhaps you need to implement it:
27+
candidate #1: `Form`
3028

3129
error[E0277]: the trait bound `B: Default` is not satisfied
3230
--> src/tests/derive/form/generic_no_default.rs:23:14

api/swimos_form/src/tests/derive/form/tag_no_to_string.stderr

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ error[E0277]: the trait bound `B: swimos_form::structural::Tag` is not satisfied
1717
--> src/tests/derive/form/tag_no_to_string.rs:21:14
1818
|
1919
21 | #[derive(Form)]
20-
| ^^^^ the trait `swimos_form::structural::Tag` is not implemented for `B`
20+
| ^^^^ the trait `swimos_form::structural::Tag` is not implemented for `B`, which is required by `TagRecognizer<B>: Recognizer`
2121
|
2222
= help: the trait `Recognizer` is implemented for `TagRecognizer<T>`
2323
= note: required for `TagRecognizer<B>` to implement `Recognizer`
@@ -35,7 +35,7 @@ error[E0277]: the trait bound `B: swimos_form::structural::Tag` is not satisfied
3535
--> src/tests/derive/form/tag_no_to_string.rs:21:14
3636
|
3737
21 | #[derive(Form)]
38-
| ^^^^ the trait `swimos_form::structural::Tag` is not implemented for `B`
38+
| ^^^^ the trait `swimos_form::structural::Tag` is not implemented for `B`, which is required by `TagRecognizer<B>: Recognizer`
3939
|
4040
= help: the trait `Recognizer` is implemented for `TagRecognizer<T>`
4141
= note: required for `TagRecognizer<B>` to implement `Recognizer`
@@ -45,7 +45,7 @@ error[E0277]: the trait bound `B: swimos_form::structural::Tag` is not satisfied
4545
--> src/tests/derive/form/tag_no_to_string.rs:21:14
4646
|
4747
21 | #[derive(Form)]
48-
| ^^^^ the trait `swimos_form::structural::Tag` is not implemented for `B`
48+
| ^^^^ the trait `swimos_form::structural::Tag` is not implemented for `B`, which is required by `TagRecognizer<B>: Default`
4949
|
5050
= help: the trait `Default` is implemented for `TagRecognizer<T>`
5151
= note: required for `TagRecognizer<B>` to implement `Default`

api/swimos_schema/src/schema/tests/derive/validated_form/generic_no_default.stderr

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,14 @@ note: required by a bound in `as_value`
2525
| fn as_value(&self) -> Value {
2626
| -------- required by a bound in this associated function
2727

28-
error[E0277]: the trait bound `S<Invalid>: RecognizerReadable` is not satisfied
28+
error[E0277]: the trait bound `S<Invalid>: StructuralReadable` is not satisfied
2929
--> src/schema/tests/derive/validated_form/generic_no_default.rs:30:29
3030
|
3131
30 | let _s = Form::as_value(&S { a: 1, f: Invalid });
32-
| -------------- ^^^^^^^^^^^^^^^^^^^^^^^ the trait `RecognizerReadable` is not implemented for `S<Invalid>`
32+
| -------------- ^^^^^^^^^^^^^^^^^^^^^^^ the trait `RecognizerReadable` is not implemented for `S<Invalid>`, which is required by `S<Invalid>: StructuralReadable`
3333
| |
3434
| required by a bound introduced by this call
3535
|
36-
= help: the following other types implement trait `RecognizerReadable`:
37-
bool
38-
i32
39-
i64
40-
usize
41-
u32
42-
u64
43-
f64
44-
swimos_route::route_uri::RouteUri
45-
and $N others
4636
= note: required for `S<Invalid>` to implement `StructuralReadable`
4737
note: required by a bound in `as_value`
4838
--> $WORKSPACE/api/swimos_form/src/lib.rs

0 commit comments

Comments
 (0)