Avoid platform dependent errors in UI tests.

This commit is contained in:
Sergio Benitez 2022-05-03 13:53:43 -07:00
parent 07460df279
commit 55ea5dfb35
3 changed files with 11 additions and 11 deletions

View File

@ -477,11 +477,11 @@ note: function defined here
| pub fn ext<'v>(file: &TempFile<'_>, r#type: ContentType) -> Result<'v, ()> { | pub fn ext<'v>(file: &TempFile<'_>, r#type: ContentType) -> Result<'v, ()> {
| ^^^ | ^^^
error[E0277]: the trait bound `i32: From<&str>` is not satisfied error[E0277]: the trait bound `usize: From<&str>` is not satisfied
--> tests/ui-fail-nightly/from_form.rs:171:23 --> tests/ui-fail-nightly/from_form.rs:171:23
| |
171 | #[field(default = "no conversion")] 171 | #[field(default = "no conversion")]
| ^^^^^^^^^^^^^^^ the trait `From<&str>` is not implemented for `i32` | ^^^^^^^^^^^^^^^ the trait `From<&str>` is not implemented for `usize`
| |
= help: the following other types implement trait `From<T>`: = help: the following other types implement trait `From<T>`:
<f32 as From<i16>> <f32 as From<i16>>
@ -493,7 +493,7 @@ error[E0277]: the trait bound `i32: From<&str>` is not satisfied
<f64 as From<i32>> <f64 as From<i32>>
<f64 as From<i8>> <f64 as From<i8>>
and 85 others and 85 others
= note: required because of the requirements on the impl of `Into<i32>` for `&str` = note: required because of the requirements on the impl of `Into<usize>` for `&str`
error[E0308]: mismatched types error[E0308]: mismatched types
--> tests/ui-fail-nightly/from_form.rs:203:33 --> tests/ui-fail-nightly/from_form.rs:203:33

View File

@ -501,19 +501,19 @@ error[E0308]: mismatched types
165 | #[field(validate = ext("hello"))] 165 | #[field(validate = ext("hello"))]
| ^^^^^^^ expected struct `ContentType`, found `&str` | ^^^^^^^ expected struct `ContentType`, found `&str`
error[E0277]: the trait bound `i32: From<&str>` is not satisfied error[E0277]: the trait bound `usize: From<&str>` is not satisfied
--> tests/ui-fail-stable/from_form.rs:171:23 --> tests/ui-fail-stable/from_form.rs:171:23
| |
171 | #[field(default = "no conversion")] 171 | #[field(default = "no conversion")]
| ^^^^^^^^^^^^^^^ the trait `From<&str>` is not implemented for `i32` | ^^^^^^^^^^^^^^^ the trait `From<&str>` is not implemented for `usize`
| |
= help: the following implementations were found: = help: the following implementations were found:
<i32 as From<NonZeroI32>> <usize as From<NonZeroUsize>>
<i32 as From<SignalKind>> <usize as From<bool>>
<i32 as From<bool>> <usize as From<mio::token::Token>>
<i32 as From<i16>> <usize as From<runtime::thread_pool::idle::State>>
and 89 others and 89 others
= note: required because of the requirements on the impl of `Into<i32>` for `&str` = note: required because of the requirements on the impl of `Into<usize>` for `&str`
error[E0308]: mismatched types error[E0308]: mismatched types
--> tests/ui-fail-stable/from_form.rs:203:33 --> tests/ui-fail-stable/from_form.rs:203:33

View File

@ -169,7 +169,7 @@ struct Validate3 {
#[derive(FromForm)] #[derive(FromForm)]
struct Default0 { struct Default0 {
#[field(default = "no conversion")] #[field(default = "no conversion")]
first: i32, first: usize,
} }
#[derive(FromForm)] #[derive(FromForm)]