Skip to content

Commit b9409f2

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 22c5b78 + 4c809b6 commit b9409f2

File tree

39 files changed

+512
-337
lines changed

39 files changed

+512
-337
lines changed

api/swimos_form/src/structural/tests/mod.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -204,36 +204,6 @@ impl<S: StructuralWritable, T: StructuralWritable> StructuralWritable for Genera
204204

205205
pub struct HeaderView<T>(pub T);
206206

207-
struct WithHeaderBody<T> {
208-
header: T,
209-
attr: T,
210-
slot: T,
211-
}
212-
213-
impl<T: StructuralWritable> StructuralWritable for WithHeaderBody<T> {
214-
fn num_attributes(&self) -> usize {
215-
2
216-
}
217-
218-
fn write_with<W: StructuralWriter>(&self, writer: W) -> Result<W::Repr, W::Error> {
219-
let mut rec_writer = writer.record(self.num_attributes())?;
220-
rec_writer = rec_writer.write_attr(Cow::Borrowed("StructuralWritable"), &self.header)?;
221-
rec_writer = rec_writer.write_attr(Cow::Borrowed("attr"), &self.attr)?;
222-
let mut body_writer = rec_writer.complete_header(RecordBodyKind::MapLike, 1)?;
223-
body_writer = body_writer.write_slot(&"slot", &self.slot)?;
224-
body_writer.done()
225-
}
226-
227-
fn write_into<W: StructuralWriter>(self, writer: W) -> Result<W::Repr, W::Error> {
228-
let mut rec_writer = writer.record(self.num_attributes())?;
229-
rec_writer = rec_writer.write_attr_into("StructuralWritable", self.header)?;
230-
rec_writer = rec_writer.write_attr_into("attr", self.attr)?;
231-
let mut body_writer = rec_writer.complete_header(RecordBodyKind::MapLike, 1)?;
232-
body_writer = body_writer.write_slot_into("slot", self.slot)?;
233-
body_writer.done()
234-
}
235-
}
236-
237207
struct WithHeaderField<T> {
238208
header: T,
239209
attr: T,

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_form/tests/structure.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ fn test_enum_tag() {
530530

531531
#[derive(Form, Debug, PartialEq, Clone)]
532532

533-
struct LogEntry<F: Form> {
533+
struct LogEntry<F> {
534534
#[form(tag)]
535535
level: Level,
536536
#[form(header)]
@@ -559,6 +559,7 @@ fn test_enum_tag() {
559559
}
560560

561561
#[test]
562+
#[allow(clippy::multiple_bound_locations)]
562563
fn generic_duplicated_bound() {
563564
#[derive(Form)]
564565

api/swimos_model/src/text/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ fn extend_text_with_strings() {
661661

662662
#[test]
663663
fn extend_text_with_strings_by_ref() {
664-
let strs = vec![
664+
let strs = [
665665
"the ".to_string(),
666666
"cat ".to_string(),
667667
"sat ".to_string(),

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

api/swimos_schema/src/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,7 @@ fn form_enum_variants() {
15971597
},
15981598
]);
15991599

1600-
let enums = vec![
1600+
let enums = [
16011601
E::Unit,
16021602
E::NewType(i32::max_value()),
16031603
E::Tuple(i32::max_value(), i64::max_value(), String::from("swimos")),

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pr: ["main", "byte-routing"]
33

44
variables:
55
RUSTFLAGS: -Dwarnings
6-
RUST_VERSION: 1.76.0
6+
RUST_VERSION: 1.78.0
77

88
stages:
99
- stage: Lint

ci/azure-code-coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
steps:
2424
- template: azure-install-rust.yml
2525
parameters:
26-
rust_version: 1.76.0
26+
rust_version: 1.78.0
2727
- template: azure-install-sccache.yml
2828

2929
- script: cargo install cargo-tarpaulin

0 commit comments

Comments
 (0)