Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UI tests for 1.73.0 #530

Merged
merged 3 commits into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions derive/src/trait_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,8 @@ pub fn add<N>(

let ty_params = generics
.type_params()
.filter_map(|tp| {
skip_type_params.iter().all(|skip| skip != &tp.ident).then(|| tp.ident.clone())
})
.filter(|tp| skip_type_params.iter().all(|skip| skip != &tp.ident))
.map(|tp| tp.ident.clone())
.collect::<Vec<_>>();
if ty_params.is_empty() {
return Ok(())
Expand Down
3 changes: 0 additions & 3 deletions tests/max_encoded_len_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
#[test]
#[cfg(feature = "derive")]
fn derive_no_bound_ui() {
// As trybuild is using `cargo check`, we don't need the real WASM binaries.
std::env::set_var("SKIP_WASM_BUILD", "1");

let t = trybuild::TestCases::new();
t.compile_fail("tests/max_encoded_len_ui/*.rs");
t.pass("tests/max_encoded_len_ui/pass/*.rs");
Expand Down
40 changes: 20 additions & 20 deletions tests/max_encoded_len_ui/crate_str.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ error: Invalid attribute: only `#[codec(dumb_trait_bound)]`, `#[codec(crate = pa
| ^^^^^

error[E0277]: the trait bound `Example: WrapperTypeEncode` is not satisfied
--> tests/max_encoded_len_ui/crate_str.rs:5:8
|
5 | struct Example;
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`
|
= help: the following other types implement trait `WrapperTypeEncode`:
&T
&mut T
Arc<T>
Box<T>
Cow<'a, T>
Rc<T>
String
Vec<T>
parity_scale_codec::Ref<'a, T, U>
= note: required for `Example` to implement `Encode`
--> tests/max_encoded_len_ui/crate_str.rs:5:8
|
5 | struct Example;
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`
|
= 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
= 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`
--> src/max_encoded_len.rs
|
| pub trait MaxEncodedLen: Encode {
| ^^^^^^ required by this bound in `MaxEncodedLen`
40 changes: 20 additions & 20 deletions tests/max_encoded_len_ui/incomplete_attr.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ error: Invalid attribute: only `#[codec(dumb_trait_bound)]`, `#[codec(crate = pa
| ^^^^^

error[E0277]: the trait bound `Example: WrapperTypeEncode` is not satisfied
--> tests/max_encoded_len_ui/incomplete_attr.rs:5:8
|
5 | struct Example;
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`
|
= help: the following other types implement trait `WrapperTypeEncode`:
&T
&mut T
Arc<T>
Box<T>
Cow<'a, T>
Rc<T>
String
Vec<T>
parity_scale_codec::Ref<'a, T, U>
= note: required for `Example` to implement `Encode`
--> tests/max_encoded_len_ui/incomplete_attr.rs:5:8
|
5 | struct Example;
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`
|
= 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
= 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`
--> src/max_encoded_len.rs
|
| pub trait MaxEncodedLen: Encode {
| ^^^^^^ required by this bound in `MaxEncodedLen`
40 changes: 20 additions & 20 deletions tests/max_encoded_len_ui/missing_crate_specifier.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,24 @@ error: Invalid attribute: only `#[codec(dumb_trait_bound)]`, `#[codec(crate = pa
| ^^^^^^^^^^^^^^^^^^

error[E0277]: the trait bound `Example: WrapperTypeEncode` 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`
|
= help: the following other types implement trait `WrapperTypeEncode`:
&T
&mut T
Arc<T>
Box<T>
Cow<'a, T>
Rc<T>
String
Vec<T>
parity_scale_codec::Ref<'a, T, U>
= note: required for `Example` to implement `Encode`
--> tests/max_encoded_len_ui/missing_crate_specifier.rs:5:8
|
5 | struct Example;
| ^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `Example`
|
= 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
= 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`
--> src/max_encoded_len.rs
|
| pub trait MaxEncodedLen: Encode {
| ^^^^^^ required by this bound in `MaxEncodedLen`
40 changes: 20 additions & 20 deletions tests/max_encoded_len_ui/not_encode.stderr
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
error[E0277]: the trait bound `NotEncode: WrapperTypeEncode` is not satisfied
--> tests/max_encoded_len_ui/not_encode.rs:4:8
|
4 | struct NotEncode;
| ^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `NotEncode`
|
= help: the following other types implement trait `WrapperTypeEncode`:
&T
&mut T
Arc<T>
Box<T>
Cow<'a, T>
Rc<T>
String
Vec<T>
parity_scale_codec::Ref<'a, T, U>
= note: required for `NotEncode` to implement `Encode`
--> tests/max_encoded_len_ui/not_encode.rs:4:8
|
4 | struct NotEncode;
| ^^^^^^^^^ the trait `WrapperTypeEncode` is not implemented for `NotEncode`
|
= 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
= note: required for `NotEncode` 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`
--> src/max_encoded_len.rs
|
| pub trait MaxEncodedLen: Encode {
| ^^^^^^ required by this bound in `MaxEncodedLen`
2 changes: 1 addition & 1 deletion tests/max_encoded_len_ui/union.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: Union types are not supported.
--> $DIR/union.rs:4:1
--> tests/max_encoded_len_ui/union.rs:4:1
|
4 | union Union {
| ^^^^^
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`:
()
(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)
bool
i8
i16
i32
i64
i128
u8
u16
and $N others