Skip to content

Commit

Permalink
Bump rust version for macro tests (#965)
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry authored Feb 25, 2020
1 parent 90a7cdb commit 6a75932
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If applicable, add screenshots to help explain your problem.

**Environment:**
- Yew version [e.g. v0.10, `master`]
- Rust version [e.g. 1.40.0]
- Rust version [e.g. 1.41.0]
- Target if relevant [e.g. `wasm32-unknown-emscripten`]
- `stdweb` / `web-sys` version [e.g. web-sys v0.3.33]
- OS: [e.g. macos]
Expand Down
10 changes: 4 additions & 6 deletions tests/derive_props/fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ error[E0599]: no method named `build` found for type `t3::PropsBuilder<t3::Props
--> $DIR/fail.rs:35:26
|
28 | #[derive(Clone, Properties)]
| - method `build` not found for this
| ---------- method `build` not found for this
...
35 | Props::builder().build();
| ^^^^^ method not found in `t3::PropsBuilder<t3::PropsBuilderStep_missing_required_prop_value>`
Expand All @@ -56,7 +56,7 @@ error[E0599]: no method named `b` found for type `t4::PropsBuilder<t4::PropsBuil
--> $DIR/fail.rs:49:26
|
41 | #[derive(Clone, Properties)]
| - method `b` not found for this
| ---------- method `b` not found for this
...
49 | Props::builder().b(1).a(2).build();
| ^ help: there is a method with a similar name: `a`
Expand All @@ -76,9 +76,7 @@ error[E0308]: match arms have incompatible types
112 | #[props(default = "foo")]
| ^^^^^
| |
| expected struct `std::string::String`, found i32
| expected struct `std::string::String`, found `i32`
| `match` arms have incompatible types
| this is found to be of type `std::string::String`
|
= note: expected type `std::string::String`
found type `i32`
| help: try using a conversion method: `"foo".to_string()`
2 changes: 1 addition & 1 deletion tests/derive_props_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[allow(dead_code)]
#[rustversion::attr(stable(1.40.0), cfg_attr(not(feature = "web_test"), test))]
#[rustversion::attr(stable(1.41.0), cfg_attr(not(feature = "web_test"), test))]
fn tests() {
let t = trybuild::TestCases::new();
t.pass("tests/derive_props/pass.rs");
Expand Down
15 changes: 6 additions & 9 deletions tests/macro/html-component-fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ error[E0599]: no method named `unknown` found for type `ChildPropertiesBuilder<C
--> $DIR/html-component-fail.rs:64:20
|
6 | #[derive(Clone, Properties, PartialEq)]
| - method `unknown` not found for this
| ---------- method `unknown` not found for this
...
64 | html! { <Child unknown="unknown" /> };
| ^^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
Expand Down Expand Up @@ -173,10 +173,7 @@ error[E0308]: mismatched types
--> $DIR/html-component-fail.rs:69:30
|
69 | html! { <Child int=1 ref=() /> };
| ^^ expected struct `yew::html::NodeRef`, found ()
|
= note: expected type `yew::html::NodeRef`
found type `()`
| ^^ expected struct `yew::html::NodeRef`, found `()`

error[E0277]: the trait bound `yew::virtual_dom::vcomp::VComp: yew::virtual_dom::Transformer<u32, i32>` is not satisfied
--> $DIR/html-component-fail.rs:71:24
Expand All @@ -196,7 +193,7 @@ error[E0599]: no method named `string` found for type `ChildPropertiesBuilder<Ch
--> $DIR/html-component-fail.rs:72:20
|
6 | #[derive(Clone, Properties, PartialEq)]
| - method `string` not found for this
| ---------- method `string` not found for this
...
72 | html! { <Child string="abc" /> };
| ^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
Expand All @@ -205,7 +202,7 @@ error[E0599]: no method named `children` found for type `ChildPropertiesBuilder<
--> $DIR/html-component-fail.rs:76:5
|
6 | #[derive(Clone, Properties, PartialEq)]
| - method `children` not found for this
| ---------- method `children` not found for this
...
76 | html! { <Child>{ "Not allowed" }</Child> };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `ChildPropertiesBuilder<ChildPropertiesBuilderStep_missing_required_prop_int>`
Expand All @@ -216,7 +213,7 @@ error[E0599]: no method named `build` found for type `ChildContainerPropertiesBu
--> $DIR/html-component-fail.rs:78:5
|
23 | #[derive(Clone, Properties)]
| - method `build` not found for this
| ---------- method `build` not found for this
...
78 | html! { <ChildContainer /> };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `ChildContainerPropertiesBuilder<ChildContainerPropertiesBuilderStep_missing_required_prop_children>`
Expand All @@ -227,7 +224,7 @@ error[E0599]: no method named `build` found for type `ChildContainerPropertiesBu
--> $DIR/html-component-fail.rs:79:5
|
23 | #[derive(Clone, Properties)]
| - method `build` not found for this
| ---------- method `build` not found for this
...
79 | html! { <ChildContainer></ChildContainer> };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method not found in `ChildContainerPropertiesBuilder<ChildContainerPropertiesBuilderStep_missing_required_prop_children>`
Expand Down
28 changes: 8 additions & 20 deletions tests/macro/html-tag-fail.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -110,28 +110,19 @@ error[E0308]: mismatched types
--> $DIR/html-tag-fail.rs:25:28
|
25 | html! { <input checked=1 /> };
| ^ expected bool, found integer
|
= note: expected type `bool`
found type `{integer}`
| ^ expected `bool`, found integer

error[E0308]: mismatched types
--> $DIR/html-tag-fail.rs:26:29
|
26 | html! { <input disabled=1 /> };
| ^ expected bool, found integer
|
= note: expected type `bool`
found type `{integer}`
| ^ expected `bool`, found integer

error[E0308]: mismatched types
--> $DIR/html-tag-fail.rs:27:30
|
27 | html! { <option selected=1 /> };
| ^ expected bool, found integer
|
= note: expected type `bool`
found type `{integer}`
| ^ expected `bool`, found integer

error[E0277]: `()` doesn't implement `std::fmt::Display`
--> $DIR/html-tag-fail.rs:28:25
Expand Down Expand Up @@ -170,17 +161,17 @@ error[E0308]: mismatched types
32 | html! { <input onclick=1 /> };
| ^^^^^^^ expected struct `yew::callback::Callback`, found integer
|
= note: expected type `yew::callback::Callback<stdweb::webapi::events::mouse::ClickEvent>`
found type `{integer}`
= note: expected struct `yew::callback::Callback<stdweb::webapi::events::mouse::ClickEvent>`
found type `{integer}`

error[E0308]: mismatched types
--> $DIR/html-tag-fail.rs:33:20
|
33 | html! { <input onclick=Callback::from(|a: String| ()) /> };
| ^^^^^^^ expected struct `stdweb::webapi::events::mouse::ClickEvent`, found struct `std::string::String`
|
= note: expected type `yew::callback::Callback<stdweb::webapi::events::mouse::ClickEvent>`
found type `yew::callback::Callback<std::string::String>`
= note: expected struct `yew::callback::Callback<stdweb::webapi::events::mouse::ClickEvent>`
found struct `yew::callback::Callback<std::string::String>`

error[E0599]: no method named `to_string` found for type `NotToString` in the current scope
--> $DIR/html-tag-fail.rs:35:27
Expand All @@ -201,7 +192,4 @@ error[E0308]: mismatched types
--> $DIR/html-tag-fail.rs:37:24
|
37 | html! { <input ref=() /> };
| ^^ expected struct `yew::html::NodeRef`, found ()
|
= note: expected type `yew::html::NodeRef`
found type `()`
| ^^ expected struct `yew::html::NodeRef`, found `()`
2 changes: 1 addition & 1 deletion tests/macro_test.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#[allow(dead_code)]
#[rustversion::attr(stable(1.40.0), cfg_attr(not(feature = "web_test"), test))]
#[rustversion::attr(stable(1.41.0), cfg_attr(not(feature = "web_test"), test))]
fn tests() {
let t = trybuild::TestCases::new();

Expand Down

0 comments on commit 6a75932

Please sign in to comment.