Skip to content

Commit

Permalink
More fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
serban300 committed Jul 22, 2024
1 parent fd13da3 commit 7772177
Show file tree
Hide file tree
Showing 7 changed files with 136 additions and 61 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
publish-crate:
runs-on: ubuntu-latest
environment: release
container: paritytech/ci-unified:bullseye-1.73.0
container: paritytech/ci-unified:bullseye-1.79.0
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
50 changes: 38 additions & 12 deletions tests/max_encoded_len_ui/crate_str.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,51 @@ error: Invalid attribute: only `#[codec(dumb_trait_bound)]`, `#[codec(crate = pa
4 | #[codec(crate = "parity_scale_codec")]
| ^^^^^

error[E0277]: the trait bound `Example: WrapperTypeEncode` is not satisfied
error[E0277]: the trait bound `Example: Encode` is not satisfied
--> tests/max_encoded_len_ui/crate_str.rs:5:8
|
5 | struct Example;
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`, which is required by `Example: Encode`
|
= help: the following other types implement trait `WrapperTypeEncode`:
Box<T>
Cow<'a, T>
parity_scale_codec::Ref<'a, T, U>
Rc<T>
Arc<T>
Vec<T>
String
&T
&mut T
= help: the following other types implement trait `Encode`:
()
(A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
and $N others
= note: required for `Example` to implement `Encode`
note: required by a bound in `MaxEncodedLen`
--> src/max_encoded_len.rs
|
| pub trait MaxEncodedLen: Encode {
| ^^^^^^ required by this bound in `MaxEncodedLen`

error[E0277]: the trait bound `Example: Encode` is not satisfied
--> tests/max_encoded_len_ui/crate_str.rs:8:10
|
8 | let _ = Example::max_encoded_len();
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`, which is required by `Example: Encode`
|
= help: the following other types implement trait `Encode`:
()
(A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
and $N others
= note: required for `Example` to implement `Encode`
note: required by a bound in `max_encoded_len`
--> src/max_encoded_len.rs
|
| pub trait MaxEncodedLen: Encode {
| ^^^^^^ required by this bound in `MaxEncodedLen::max_encoded_len`
| /// Upper bound, in bytes, of the maximum encoded size of this item.
| fn max_encoded_len() -> usize;
| --------------- required by a bound in this associated function
50 changes: 38 additions & 12 deletions tests/max_encoded_len_ui/incomplete_attr.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,51 @@ error: Invalid attribute: only `#[codec(dumb_trait_bound)]`, `#[codec(crate = pa
4 | #[codec(crate)]
| ^^^^^

error[E0277]: the trait bound `Example: WrapperTypeEncode` is not satisfied
error[E0277]: the trait bound `Example: Encode` is not satisfied
--> tests/max_encoded_len_ui/incomplete_attr.rs:5:8
|
5 | struct Example;
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`, which is required by `Example: Encode`
|
= help: the following other types implement trait `WrapperTypeEncode`:
Box<T>
Cow<'a, T>
parity_scale_codec::Ref<'a, T, U>
Rc<T>
Arc<T>
Vec<T>
String
&T
&mut T
= help: the following other types implement trait `Encode`:
()
(A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
and $N others
= note: required for `Example` to implement `Encode`
note: required by a bound in `MaxEncodedLen`
--> src/max_encoded_len.rs
|
| pub trait MaxEncodedLen: Encode {
| ^^^^^^ required by this bound in `MaxEncodedLen`

error[E0277]: the trait bound `Example: Encode` is not satisfied
--> tests/max_encoded_len_ui/incomplete_attr.rs:8:10
|
8 | let _ = Example::max_encoded_len();
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`, which is required by `Example: Encode`
|
= help: the following other types implement trait `Encode`:
()
(A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
and $N others
= note: required for `Example` to implement `Encode`
note: required by a bound in `max_encoded_len`
--> src/max_encoded_len.rs
|
| pub trait MaxEncodedLen: Encode {
| ^^^^^^ required by this bound in `MaxEncodedLen::max_encoded_len`
| /// Upper bound, in bytes, of the maximum encoded size of this item.
| fn max_encoded_len() -> usize;
| --------------- required by a bound in this associated function
50 changes: 38 additions & 12 deletions tests/max_encoded_len_ui/missing_crate_specifier.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,51 @@ error: Invalid attribute: only `#[codec(dumb_trait_bound)]`, `#[codec(crate = pa
4 | #[codec(parity_scale_codec)]
| ^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `Example: WrapperTypeEncode` is not satisfied
error[E0277]: the trait bound `Example: Encode` is not satisfied
--> tests/max_encoded_len_ui/missing_crate_specifier.rs:5:8
|
5 | struct Example;
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`, which is required by `Example: Encode`
|
= help: the following other types implement trait `WrapperTypeEncode`:
Box<T>
Cow<'a, T>
parity_scale_codec::Ref<'a, T, U>
Rc<T>
Arc<T>
Vec<T>
String
&T
&mut T
= help: the following other types implement trait `Encode`:
()
(A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
and $N others
= note: required for `Example` to implement `Encode`
note: required by a bound in `MaxEncodedLen`
--> src/max_encoded_len.rs
|
| pub trait MaxEncodedLen: Encode {
| ^^^^^^ required by this bound in `MaxEncodedLen`

error[E0277]: the trait bound `Example: Encode` is not satisfied
--> tests/max_encoded_len_ui/missing_crate_specifier.rs:8:10
|
8 | let _ = Example::max_encoded_len();
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`, which is required by `Example: Encode`
|
= help: the following other types implement trait `Encode`:
()
(A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
and $N others
= note: required for `Example` to implement `Encode`
note: required by a bound in `max_encoded_len`
--> src/max_encoded_len.rs
|
| pub trait MaxEncodedLen: Encode {
| ^^^^^^ required by this bound in `MaxEncodedLen::max_encoded_len`
| /// Upper bound, in bytes, of the maximum encoded size of this item.
| fn max_encoded_len() -> usize;
| --------------- required by a bound in this associated function
24 changes: 12 additions & 12 deletions tests/max_encoded_len_ui/not_encode.stderr
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
error[E0277]: the trait bound `NotEncode: WrapperTypeEncode` is not satisfied
error[E0277]: the trait bound `NotEncode: Encode` is not satisfied
--> tests/max_encoded_len_ui/not_encode.rs:4:8
|
4 | struct NotEncode;
| ^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `NotEncode`
| ^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `NotEncode`, which is required by `NotEncode: Encode`
|
= help: the following other types implement trait `WrapperTypeEncode`:
Box<T>
Cow<'a, T>
parity_scale_codec::Ref<'a, T, U>
Rc<T>
Arc<T>
Vec<T>
String
&T
&mut T
= help: the following other types implement trait `Encode`:
()
(A0, B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(B0, C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(C0, D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(D0, E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(E0, F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(F0, G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
(G0, H0, I0, J0, K0, L0, M0, N0, O0, P0, Q0, R0)
and $N others
= note: required for `NotEncode` to implement `Encode`
note: required by a bound in `MaxEncodedLen`
--> src/max_encoded_len.rs
Expand Down
5 changes: 1 addition & 4 deletions tests/max_encoded_len_ui/not_mel.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@ error[E0599]: the function or associated item `max_encoded_len` exists for struc
| ------------- doesn't satisfy `NotMel: MaxEncodedLen`
...
7 | struct Generic<T> {
| -----------------
| |
| function or associated item `max_encoded_len` not found for this struct
| doesn't satisfy `Generic<NotMel>: MaxEncodedLen`
| ----------------- function or associated item `max_encoded_len` not found for this struct because it doesn't satisfy `Generic<NotMel>: MaxEncodedLen`
...
12 | let _ = Generic::<NotMel>::max_encoded_len();
| ^^^^^^^^^^^^^^^ function or associated item cannot be called on `Generic<NotMel>` due to unsatisfied trait bounds
Expand Down
16 changes: 8 additions & 8 deletions tests/max_encoded_len_ui/unsupported_variant.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ error[E0277]: the trait bound `NotMel: MaxEncodedLen` is not satisfied
| ^^^^^^ the trait `MaxEncodedLen` is not implemented for `NotMel`
|
= help: the following other types implement trait `MaxEncodedLen`:
bool
i8
i16
i32
i64
i128
u8
u16
()
(TupleElement0, TupleElement1)
(TupleElement0, TupleElement1, TupleElement2)
(TupleElement0, TupleElement1, TupleElement2, TupleElement3)
(TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)
(TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5)
(TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6)
(TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4, TupleElement5, TupleElement6, TupleElement7)
and $N others

0 comments on commit 7772177

Please sign in to comment.