From 22e70b0c1756ea1a5a3fca89e32431b54ba42c86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Jul 2023 07:16:15 +0000 Subject: [PATCH 01/12] Bump indexmap from 1.9.3 to 2.0.0 Bumps [indexmap](https://github.com/bluss/indexmap) from 1.9.3 to 2.0.0. - [Changelog](https://github.com/bluss/indexmap/blob/master/RELEASES.md) - [Commits](https://github.com/bluss/indexmap/compare/1.9.3...2.0.0) --- updated-dependencies: - dependency-name: indexmap dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- Cargo.lock | 30 ++++++++++++++++++++++++++---- packages/yew/Cargo.toml | 2 +- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9d72b73f9e2..458fc49fa57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -685,6 +685,12 @@ dependencies = [ "termcolor", ] +[[package]] +name = "equivalent" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" + [[package]] name = "errno" version = "0.3.1" @@ -1187,7 +1193,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -1200,6 +1206,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "headers" version = "0.3.8" @@ -1393,7 +1405,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40fc102e70475c320b185cd18c1e48bba2d7210b63970a4d581ef903e4368ef7" dependencies = [ - "indexmap", + "indexmap 1.9.3", ] [[package]] @@ -1403,7 +1415,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", ] [[package]] @@ -3395,7 +3417,7 @@ dependencies = [ "gloo", "html-escape", "implicit-clone", - "indexmap", + "indexmap 2.0.0", "js-sys", "prokio", "rustversion", diff --git a/packages/yew/Cargo.toml b/packages/yew/Cargo.toml index 0069b28b039..aa3595b87e1 100644 --- a/packages/yew/Cargo.toml +++ b/packages/yew/Cargo.toml @@ -19,7 +19,7 @@ rust-version = "1.60.0" [dependencies] console_error_panic_hook = "0.1" gloo = "0.8" -indexmap = { version = "1", features = ["std"] } +indexmap = { version = "2", features = ["std"] } js-sys = "0.3" slab = "0.4" wasm-bindgen = "0.2" From d16690c423c1501f48ed00d5c51c8ccc35ebcf58 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sat, 29 Jul 2023 09:58:19 +0200 Subject: [PATCH 02/12] Update dependency minimum version --- Cargo.lock | 6 +++--- examples/immutable/Cargo.toml | 2 +- packages/yew/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 458fc49fa57..8e83030a8a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1401,11 +1401,11 @@ dependencies = [ [[package]] name = "implicit-clone" -version = "0.3.5" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40fc102e70475c320b185cd18c1e48bba2d7210b63970a4d581ef903e4368ef7" +checksum = "8c190fdb6f549c4202e4629c8a5cea3a7fc4d2c77083015281efbef7a2d38f02" dependencies = [ - "indexmap 1.9.3", + "indexmap 2.0.0", ] [[package]] diff --git a/examples/immutable/Cargo.toml b/examples/immutable/Cargo.toml index c0a549e3ab4..bc9bc7e7cb2 100644 --- a/examples/immutable/Cargo.toml +++ b/examples/immutable/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -implicit-clone = { version = "0.3", features = ["map"] } +implicit-clone = { version = "0.3.7", features = ["map"] } wasm-bindgen = "0.2" web-sys = "0.3" yew = { path = "../../packages/yew", features = ["csr"] } diff --git a/packages/yew/Cargo.toml b/packages/yew/Cargo.toml index aa3595b87e1..d1acce1f630 100644 --- a/packages/yew/Cargo.toml +++ b/packages/yew/Cargo.toml @@ -27,7 +27,7 @@ yew-macro = { version = "^0.20.0", path = "../yew-macro" } thiserror = "1.0" futures = { version = "0.3", default-features = false, features = ["std"] } html-escape = { version = "0.2.13", optional = true } -implicit-clone = { version = "0.3", features = ["map"] } +implicit-clone = { version = "0.3.7", features = ["map"] } base64ct = { version = "1.6.0", features = ["std"], optional = true } bincode = { version = "1.3.3", optional = true } serde = { version = "1", features = ["derive"] } From 6ce5afa3458ae2487ab9209f734d194a548a85df Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sat, 29 Jul 2023 10:01:07 +0200 Subject: [PATCH 03/12] clippy --- packages/yew/src/functional/mod.rs | 2 +- packages/yew/src/utils/mod.rs | 17 ++++------------- 2 files changed, 5 insertions(+), 14 deletions(-) diff --git a/packages/yew/src/functional/mod.rs b/packages/yew/src/functional/mod.rs index 1f3ce01317a..6ba9f601f91 100644 --- a/packages/yew/src/functional/mod.rs +++ b/packages/yew/src/functional/mod.rs @@ -337,7 +337,7 @@ where }; Self { - _never: std::marker::PhantomData::default(), + _never: std::marker::PhantomData, hook_ctx: HookContext::new( scope, re_render, diff --git a/packages/yew/src/utils/mod.rs b/packages/yew/src/utils/mod.rs index 6cdb047685a..98934ed054b 100644 --- a/packages/yew/src/utils/mod.rs +++ b/packages/yew/src/utils/mod.rs @@ -19,34 +19,25 @@ pub struct NodeSeq(Vec, PhantomData); impl, OUT> From for NodeSeq { fn from(val: IN) -> Self { - Self(vec![val.into()], PhantomData::default()) + Self(vec![val.into()], PhantomData) } } impl, OUT> From> for NodeSeq { fn from(val: Option) -> Self { - Self( - val.map(|s| vec![s.into()]).unwrap_or_default(), - PhantomData::default(), - ) + Self(val.map(|s| vec![s.into()]).unwrap_or_default(), PhantomData) } } impl, OUT> From> for NodeSeq { fn from(val: Vec) -> Self { - Self( - val.into_iter().map(|x| x.into()).collect(), - PhantomData::default(), - ) + Self(val.into_iter().map(|x| x.into()).collect(), PhantomData) } } impl + Clone, OUT> From<&ChildrenRenderer> for NodeSeq { fn from(val: &ChildrenRenderer) -> Self { - Self( - val.iter().map(|x| x.into()).collect(), - PhantomData::default(), - ) + Self(val.iter().map(|x| x.into()).collect(), PhantomData) } } From c651d7549d314c7f1c9ffb5aeb0a860c4a6a0e2c Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sat, 29 Jul 2023 10:03:31 +0200 Subject: [PATCH 04/12] Bump MSRV to 1.64 --- packages/yew-macro/Cargo.toml | 2 +- packages/yew-macro/Makefile.toml | 2 +- packages/yew-macro/tests/classes_macro_test.rs | 2 +- packages/yew-macro/tests/derive_props_test.rs | 2 +- packages/yew-macro/tests/function_attr_test.rs | 2 +- packages/yew-macro/tests/hook_attr_test.rs | 2 +- packages/yew-macro/tests/hook_macro_test.rs | 2 +- packages/yew-macro/tests/html_macro_test.rs | 2 +- packages/yew-macro/tests/props_macro_test.rs | 2 +- packages/yew-router-macro/Cargo.toml | 2 +- packages/yew-router-macro/Makefile.toml | 2 +- packages/yew-router-macro/tests/routable_derive_test.rs | 2 +- packages/yew-router/Cargo.toml | 2 +- packages/yew/Cargo.toml | 2 +- website/docs/getting-started/introduction.mdx | 2 +- 15 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/yew-macro/Cargo.toml b/packages/yew-macro/Cargo.toml index 93995281f55..7de16286e07 100644 --- a/packages/yew-macro/Cargo.toml +++ b/packages/yew-macro/Cargo.toml @@ -10,7 +10,7 @@ license = "MIT OR Apache-2.0" keywords = ["web", "wasm", "frontend", "webasm", "webassembly"] categories = ["gui", "web-programming", "wasm"] description = "A framework for making client-side single-page apps" -rust-version = "1.60.0" +rust-version = "1.64.0" [lib] proc-macro = true diff --git a/packages/yew-macro/Makefile.toml b/packages/yew-macro/Makefile.toml index 999a235920b..b679fa4fa51 100644 --- a/packages/yew-macro/Makefile.toml +++ b/packages/yew-macro/Makefile.toml @@ -1,6 +1,6 @@ [tasks.test] clear = true -toolchain = "1.60.0" +toolchain = "1.64.0" command = "cargo" # test target can be optionally specified like `cargo make test html_macro`, args = ["test", "${@}"] diff --git a/packages/yew-macro/tests/classes_macro_test.rs b/packages/yew-macro/tests/classes_macro_test.rs index 84b1b5fda48..e2cadf8cf39 100644 --- a/packages/yew-macro/tests/classes_macro_test.rs +++ b/packages/yew-macro/tests/classes_macro_test.rs @@ -1,5 +1,5 @@ #[allow(dead_code)] -#[rustversion::attr(stable(1.60), test)] +#[rustversion::attr(stable(1.64), test)] fn classes_macro() { let t = trybuild::TestCases::new(); t.pass("tests/classes_macro/*-pass.rs"); diff --git a/packages/yew-macro/tests/derive_props_test.rs b/packages/yew-macro/tests/derive_props_test.rs index c4d8892e03c..c98e8feb953 100644 --- a/packages/yew-macro/tests/derive_props_test.rs +++ b/packages/yew-macro/tests/derive_props_test.rs @@ -1,5 +1,5 @@ #[allow(dead_code)] -#[rustversion::attr(stable(1.60), test)] +#[rustversion::attr(stable(1.64), test)] fn derive_props() { let t = trybuild::TestCases::new(); t.pass("tests/derive_props/pass.rs"); diff --git a/packages/yew-macro/tests/function_attr_test.rs b/packages/yew-macro/tests/function_attr_test.rs index d9409490389..ed3cf9d044a 100644 --- a/packages/yew-macro/tests/function_attr_test.rs +++ b/packages/yew-macro/tests/function_attr_test.rs @@ -1,5 +1,5 @@ #[allow(dead_code)] -#[rustversion::attr(stable(1.60), test)] +#[rustversion::attr(stable(1.64), test)] fn tests() { let t = trybuild::TestCases::new(); t.pass("tests/function_component_attr/*-pass.rs"); diff --git a/packages/yew-macro/tests/hook_attr_test.rs b/packages/yew-macro/tests/hook_attr_test.rs index dae90940ee7..bd0a3b28812 100644 --- a/packages/yew-macro/tests/hook_attr_test.rs +++ b/packages/yew-macro/tests/hook_attr_test.rs @@ -1,5 +1,5 @@ #[allow(dead_code)] -#[rustversion::attr(stable(1.60), test)] +#[rustversion::attr(stable(1.64), test)] fn tests() { let t = trybuild::TestCases::new(); t.pass("tests/hook_attr/*-pass.rs"); diff --git a/packages/yew-macro/tests/hook_macro_test.rs b/packages/yew-macro/tests/hook_macro_test.rs index cb79efc253b..01e81a41345 100644 --- a/packages/yew-macro/tests/hook_macro_test.rs +++ b/packages/yew-macro/tests/hook_macro_test.rs @@ -1,5 +1,5 @@ #[allow(dead_code)] -#[rustversion::attr(stable(1.60), test)] +#[rustversion::attr(stable(1.64), test)] fn tests() { let t = trybuild::TestCases::new(); t.pass("tests/hook_macro/*-pass.rs"); diff --git a/packages/yew-macro/tests/html_macro_test.rs b/packages/yew-macro/tests/html_macro_test.rs index b802002897c..9ccd4ec41ac 100644 --- a/packages/yew-macro/tests/html_macro_test.rs +++ b/packages/yew-macro/tests/html_macro_test.rs @@ -1,7 +1,7 @@ use yew::{html, html_nested}; #[allow(dead_code)] -#[rustversion::attr(stable(1.60), test)] +#[rustversion::attr(stable(1.64), test)] fn html_macro() { let t = trybuild::TestCases::new(); diff --git a/packages/yew-macro/tests/props_macro_test.rs b/packages/yew-macro/tests/props_macro_test.rs index 47b96990d19..b82adc18486 100644 --- a/packages/yew-macro/tests/props_macro_test.rs +++ b/packages/yew-macro/tests/props_macro_test.rs @@ -1,5 +1,5 @@ #[allow(dead_code)] -#[rustversion::attr(stable(1.60), test)] +#[rustversion::attr(stable(1.64), test)] fn props_macro() { let t = trybuild::TestCases::new(); t.pass("tests/props_macro/*-pass.rs"); diff --git a/packages/yew-router-macro/Cargo.toml b/packages/yew-router-macro/Cargo.toml index f03bd5b1099..d2fc60697a4 100644 --- a/packages/yew-router-macro/Cargo.toml +++ b/packages/yew-router-macro/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" license = "MIT OR Apache-2.0" description = "Contains macros used with yew-router" repository = "https://github.com/yewstack/yew" -rust-version = "1.60.0" +rust-version = "1.64.0" [lib] proc-macro = true diff --git a/packages/yew-router-macro/Makefile.toml b/packages/yew-router-macro/Makefile.toml index 7b2d8fcba8a..1eae4efc7c4 100644 --- a/packages/yew-router-macro/Makefile.toml +++ b/packages/yew-router-macro/Makefile.toml @@ -1,6 +1,6 @@ [tasks.test] clear = true -toolchain = "1.60.0" +toolchain = "1.64.0" command = "cargo" args = ["test"] diff --git a/packages/yew-router-macro/tests/routable_derive_test.rs b/packages/yew-router-macro/tests/routable_derive_test.rs index 5c2ef260863..59dbd5e0104 100644 --- a/packages/yew-router-macro/tests/routable_derive_test.rs +++ b/packages/yew-router-macro/tests/routable_derive_test.rs @@ -1,5 +1,5 @@ #[allow(dead_code)] -#[rustversion::attr(stable(1.60), test)] +#[rustversion::attr(stable(1.64), test)] fn tests() { let t = trybuild::TestCases::new(); t.pass("tests/routable_derive/*-pass.rs"); diff --git a/packages/yew-router/Cargo.toml b/packages/yew-router/Cargo.toml index b7d278dc242..f867ff0ae77 100644 --- a/packages/yew-router/Cargo.toml +++ b/packages/yew-router/Cargo.toml @@ -9,7 +9,7 @@ keywords = ["web", "yew", "router"] categories = ["gui", "web-programming"] description = "A router implementation for the Yew framework" repository = "https://github.com/yewstack/yew" -rust-version = "1.60.0" +rust-version = "1.64.0" [dependencies] yew = { version = "0.20.0", path = "../yew", default-features= false } diff --git a/packages/yew/Cargo.toml b/packages/yew/Cargo.toml index d1acce1f630..69baca5ed85 100644 --- a/packages/yew/Cargo.toml +++ b/packages/yew/Cargo.toml @@ -14,7 +14,7 @@ keywords = ["web", "webasm", "javascript"] categories = ["gui", "wasm", "web-programming"] description = "A framework for creating reliable and efficient web applications" readme = "../../README.md" -rust-version = "1.60.0" +rust-version = "1.64.0" [dependencies] console_error_panic_hook = "0.1" diff --git a/website/docs/getting-started/introduction.mdx b/website/docs/getting-started/introduction.mdx index 79c60e3c8b8..fedde6320c4 100644 --- a/website/docs/getting-started/introduction.mdx +++ b/website/docs/getting-started/introduction.mdx @@ -11,7 +11,7 @@ bundler for Rust. To install Rust, follow the [official instructions](https://www.rust-lang.org/tools/install). :::important -The minimum supported Rust version (MSRV) for Yew is `1.60.0`. Older versions will not compile. +The minimum supported Rust version (MSRV) for Yew is `1.64.0`. Older versions will not compile. You can check your toolchain version using `rustup show` (under "active toolchain") or `rustc --version`. To update your toolchain, run `rustup update`. From 3e90bac5f226a793952891a85eafea051d14612b Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sat, 29 Jul 2023 10:07:06 +0200 Subject: [PATCH 05/12] more clippy --- packages/yew-macro/src/hook/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/yew-macro/src/hook/mod.rs b/packages/yew-macro/src/hook/mod.rs index ba186d323b2..f22fd4f722e 100644 --- a/packages/yew-macro/src/hook/mod.rs +++ b/packages/yew-macro/src/hook/mod.rs @@ -133,8 +133,8 @@ pub fn hook_impl(hook: HookFn) -> syn::Result { let inner_type_impl = if hook_sig.needs_boxing { let with_output = !matches!(hook_sig.output_type, Type::ImplTrait(_),); - let inner_fn_rt = with_output.then(|| &inner_fn_rt); - let output_type = with_output.then(|| &output_type); + let inner_fn_rt = with_output.then_some(&inner_fn_rt); + let output_type = with_output.then_some(&output_type); let hook_lifetime = &hook_sig.hook_lifetime; let hook_lifetime_plus = quote! { #hook_lifetime + }; From 0a1f41995e3048b7a51468ad0d86562771ee225e Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sat, 29 Jul 2023 10:23:49 +0200 Subject: [PATCH 06/12] Update action that fails (probably outdated) --- .github/workflows/main-checks.yml | 2 +- .github/workflows/test-website.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main-checks.yml b/.github/workflows/main-checks.yml index eca5852062d..8477d2753d5 100644 --- a/.github/workflows/main-checks.yml +++ b/.github/workflows/main-checks.yml @@ -48,7 +48,7 @@ jobs: - uses: browser-actions/setup-geckodriver@latest with: token: ${{ secrets.GITHUB_TOKEN }} - - uses: nanasess/setup-chromedriver@v1 + - uses: nanasess/setup-chromedriver@v2 - name: Run doctest run: | diff --git a/.github/workflows/test-website.yml b/.github/workflows/test-website.yml index 456add40d5c..8f1c753b359 100644 --- a/.github/workflows/test-website.yml +++ b/.github/workflows/test-website.yml @@ -44,7 +44,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - - uses: nanasess/setup-chromedriver@v1 + - uses: nanasess/setup-chromedriver@v2 - name: Run website code snippet tests run: cargo test -p website-test --target wasm32-unknown-unknown From 34a0f5c2de11d242a375cf844842f97a37dc157f Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sat, 29 Jul 2023 10:31:33 +0200 Subject: [PATCH 07/12] Bump implicit-clone to 0.3.8 --- Cargo.lock | 4 ++-- examples/immutable/Cargo.toml | 2 +- packages/yew/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e83030a8a3..f27a9a1a0ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1401,9 +1401,9 @@ dependencies = [ [[package]] name = "implicit-clone" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c190fdb6f549c4202e4629c8a5cea3a7fc4d2c77083015281efbef7a2d38f02" +checksum = "5490dd8826da3a5bd230c17cce8a94a6db1e35a48783816e0b3807e1399f93ca" dependencies = [ "indexmap 2.0.0", ] diff --git a/examples/immutable/Cargo.toml b/examples/immutable/Cargo.toml index bc9bc7e7cb2..c0a549e3ab4 100644 --- a/examples/immutable/Cargo.toml +++ b/examples/immutable/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -implicit-clone = { version = "0.3.7", features = ["map"] } +implicit-clone = { version = "0.3", features = ["map"] } wasm-bindgen = "0.2" web-sys = "0.3" yew = { path = "../../packages/yew", features = ["csr"] } diff --git a/packages/yew/Cargo.toml b/packages/yew/Cargo.toml index 69baca5ed85..df1f4f024e7 100644 --- a/packages/yew/Cargo.toml +++ b/packages/yew/Cargo.toml @@ -27,7 +27,7 @@ yew-macro = { version = "^0.20.0", path = "../yew-macro" } thiserror = "1.0" futures = { version = "0.3", default-features = false, features = ["std"] } html-escape = { version = "0.2.13", optional = true } -implicit-clone = { version = "0.3.7", features = ["map"] } +implicit-clone = { version = "0.3.8", features = ["map"] } base64ct = { version = "1.6.0", features = ["std"], optional = true } bincode = { version = "1.3.3", optional = true } serde = { version = "1", features = ["derive"] } From 293233edfedb83f25f7f5b18955f7fcc4a7e9f35 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sat, 29 Jul 2023 10:32:20 +0200 Subject: [PATCH 08/12] Forgot to bump MSRV in some places --- .github/workflows/main-checks.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main-checks.yml b/.github/workflows/main-checks.yml index 8477d2753d5..4d802b1dce4 100644 --- a/.github/workflows/main-checks.yml +++ b/.github/workflows/main-checks.yml @@ -67,7 +67,7 @@ jobs: fail-fast: false matrix: toolchain: - - 1.60.0 + - 1.64.0 - stable steps: @@ -116,7 +116,7 @@ jobs: fail-fast: false matrix: toolchain: - - 1.60.0 + - 1.64.0 - stable - nightly From efd5efd48b95a832e140532bfd4a5572a17c3874 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sat, 29 Jul 2023 10:35:28 +0200 Subject: [PATCH 09/12] Forgot to update setup-chromedriver in one place --- .github/workflows/main-checks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main-checks.yml b/.github/workflows/main-checks.yml index 4d802b1dce4..6e0aa009a1c 100644 --- a/.github/workflows/main-checks.yml +++ b/.github/workflows/main-checks.yml @@ -95,7 +95,7 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} - - uses: nanasess/setup-chromedriver@v1 + - uses: nanasess/setup-chromedriver@v2 - name: Run tests - yew run: | From e1f3e425cc07350470caa6a7418fadbf5f4f5735 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sat, 29 Jul 2023 14:00:14 +0200 Subject: [PATCH 10/12] Bump implicit-clone to 0.4.0 --- Cargo.lock | 4 ++-- examples/immutable/Cargo.toml | 2 +- packages/yew/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f27a9a1a0ef..7ea36b2bc5b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1401,9 +1401,9 @@ dependencies = [ [[package]] name = "implicit-clone" -version = "0.3.8" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5490dd8826da3a5bd230c17cce8a94a6db1e35a48783816e0b3807e1399f93ca" +checksum = "73c84c395327945e71c6604eff15061c67849b9081318b4334b719bb2c11415f" dependencies = [ "indexmap 2.0.0", ] diff --git a/examples/immutable/Cargo.toml b/examples/immutable/Cargo.toml index c0a549e3ab4..df3a2b41b0f 100644 --- a/examples/immutable/Cargo.toml +++ b/examples/immutable/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -implicit-clone = { version = "0.3", features = ["map"] } +implicit-clone = { version = "0.4", features = ["map"] } wasm-bindgen = "0.2" web-sys = "0.3" yew = { path = "../../packages/yew", features = ["csr"] } diff --git a/packages/yew/Cargo.toml b/packages/yew/Cargo.toml index df1f4f024e7..f84c3d8279e 100644 --- a/packages/yew/Cargo.toml +++ b/packages/yew/Cargo.toml @@ -27,7 +27,7 @@ yew-macro = { version = "^0.20.0", path = "../yew-macro" } thiserror = "1.0" futures = { version = "0.3", default-features = false, features = ["std"] } html-escape = { version = "0.2.13", optional = true } -implicit-clone = { version = "0.3.8", features = ["map"] } +implicit-clone = { version = "0.4.0", features = ["map"] } base64ct = { version = "1.6.0", features = ["std"], optional = true } bincode = { version = "1.3.3", optional = true } serde = { version = "1", features = ["derive"] } From 7f0288dc760bf3be00fae43b4e2baefac01625b0 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sat, 29 Jul 2023 14:05:55 +0200 Subject: [PATCH 11/12] Update stderr files --- .../tests/classes_macro/classes-fail.stderr | 138 +++++++------ .../yew-macro/tests/derive_props/fail.stderr | 112 +++++----- .../bad-return-type-fail.stderr | 3 + .../generic-props-fail.stderr | 55 ++--- .../tests/html_macro/component-fail.stderr | 118 +++++++---- .../component-unimplemented-fail.stderr | 35 ++-- .../tests/html_macro/element-fail.stderr | 191 ++++++++++++++---- .../tests/html_macro/iterable-fail.stderr | 76 +++---- .../tests/html_macro/node-fail.stderr | 27 +++ .../tests/props_macro/props-fail.stderr | 4 +- .../props_macro/resolve-prop-fail.stderr | 4 + 11 files changed, 498 insertions(+), 265 deletions(-) diff --git a/packages/yew-macro/tests/classes_macro/classes-fail.stderr b/packages/yew-macro/tests/classes_macro/classes-fail.stderr index becd5587283..57cf0f21fb7 100644 --- a/packages/yew-macro/tests/classes_macro/classes-fail.stderr +++ b/packages/yew-macro/tests/classes_macro/classes-fail.stderr @@ -11,64 +11,76 @@ error: string literals must not contain more than one class (hint: use `"two", " | ^^^^^^^^^^^ error[E0277]: the trait bound `Classes: From<{integer}>` is not satisfied - --> tests/classes_macro/classes-fail.rs:4:14 - | -4 | classes!(42); - | ^^ the trait `From<{integer}>` is not implemented for `Classes` - | - = help: the following implementations were found: - > - >> - > - > - and 6 others - = note: required because of the requirements on the impl of `Into` for `{integer}` + --> tests/classes_macro/classes-fail.rs:4:14 + | +4 | classes!(42); + | ^^ the trait `From<{integer}>` is not implemented for `Classes` + | + = help: the following other types implement trait `From`: + > + >> + > + > + > + >> + >> + > + and $N others + = note: required because of the requirements on the impl of `Into` for `{integer}` note: required by a bound in `Classes::push` - --> $WORKSPACE/packages/yew/src/html/classes.rs - | - | pub fn push>(&mut self, class: T) { - | ^^^^^^^^^^ required by this bound in `Classes::push` + --> $WORKSPACE/packages/yew/src/html/classes.rs + | + | pub fn push>(&mut self, class: T) { + | ^^^^^^^^^^ required by this bound in `Classes::push` error[E0277]: the trait bound `Classes: From<{float}>` is not satisfied - --> tests/classes_macro/classes-fail.rs:5:14 - | -5 | classes!(42.0); - | ^^^^ the trait `From<{float}>` is not implemented for `Classes` - | - = help: the following implementations were found: - > - >> - > - > - and 6 others - = note: required because of the requirements on the impl of `Into` for `{float}` + --> tests/classes_macro/classes-fail.rs:5:14 + | +5 | classes!(42.0); + | ^^^^ the trait `From<{float}>` is not implemented for `Classes` + | + = help: the following other types implement trait `From`: + > + >> + > + > + > + >> + >> + > + and $N others + = note: required because of the requirements on the impl of `Into` for `{float}` note: required by a bound in `Classes::push` - --> $WORKSPACE/packages/yew/src/html/classes.rs - | - | pub fn push>(&mut self, class: T) { - | ^^^^^^^^^^ required by this bound in `Classes::push` + --> $WORKSPACE/packages/yew/src/html/classes.rs + | + | pub fn push>(&mut self, class: T) { + | ^^^^^^^^^^ required by this bound in `Classes::push` error[E0277]: the trait bound `Classes: From<{integer}>` is not satisfied - --> tests/classes_macro/classes-fail.rs:9:14 - | -9 | classes!(vec![42]); - | ^^^ the trait `From<{integer}>` is not implemented for `Classes` - | - = help: the following implementations were found: - > - >> - > - > - and 6 others - = note: required because of the requirements on the impl of `Into` for `{integer}` - = note: required because of the requirements on the impl of `From>` for `Classes` - = note: 1 redundant requirement hidden - = note: required because of the requirements on the impl of `Into` for `Vec<{integer}>` + --> tests/classes_macro/classes-fail.rs:9:14 + | +9 | classes!(vec![42]); + | ^^^ the trait `From<{integer}>` is not implemented for `Classes` + | + = help: the following other types implement trait `From`: + > + >> + > + > + > + >> + >> + > + and $N others + = note: required because of the requirements on the impl of `Into` for `{integer}` + = note: required because of the requirements on the impl of `From>` for `Classes` + = note: 1 redundant requirement hidden + = note: required because of the requirements on the impl of `Into` for `Vec<{integer}>` note: required by a bound in `Classes::push` - --> $WORKSPACE/packages/yew/src/html/classes.rs - | - | pub fn push>(&mut self, class: T) { - | ^^^^^^^^^^ required by this bound in `Classes::push` + --> $WORKSPACE/packages/yew/src/html/classes.rs + | + | pub fn push>(&mut self, class: T) { + | ^^^^^^^^^^ required by this bound in `Classes::push` error[E0277]: the trait bound `Classes: From<{integer}>` is not satisfied --> tests/classes_macro/classes-fail.rs:13:14 @@ -76,12 +88,16 @@ error[E0277]: the trait bound `Classes: From<{integer}>` is not satisfied 13 | classes!(some); | ^^^^ the trait `From<{integer}>` is not implemented for `Classes` | - = help: the following implementations were found: + = help: the following other types implement trait `From`: > >> > > - and 6 others + > + >> + >> + > + and $N others = note: required because of the requirements on the impl of `Into` for `{integer}` = note: required because of the requirements on the impl of `From>` for `Classes` = note: 1 redundant requirement hidden @@ -98,12 +114,16 @@ error[E0277]: the trait bound `Classes: From` is not satisfied 14 | classes!(none); | ^^^^ the trait `From` is not implemented for `Classes` | - = help: the following implementations were found: + = help: the following other types implement trait `From`: > >> > > - and 6 others + > + >> + >> + > + and $N others = note: required because of the requirements on the impl of `Into` for `u32` = note: required because of the requirements on the impl of `From>` for `Classes` = note: 1 redundant requirement hidden @@ -120,12 +140,16 @@ error[E0277]: the trait bound `Classes: From<{integer}>` is not satisfied 16 | classes!("one", 42); | ^^ the trait `From<{integer}>` is not implemented for `Classes` | - = help: the following implementations were found: + = help: the following other types implement trait `From`: > >> > > - and 6 others + > + >> + >> + > + and $N others = note: required because of the requirements on the impl of `Into` for `{integer}` note: required by a bound in `Classes::push` --> $WORKSPACE/packages/yew/src/html/classes.rs diff --git a/packages/yew-macro/tests/derive_props/fail.stderr b/packages/yew-macro/tests/derive_props/fail.stderr index 35c88342d29..441b184c78d 100644 --- a/packages/yew-macro/tests/derive_props/fail.stderr +++ b/packages/yew-macro/tests/derive_props/fail.stderr @@ -25,33 +25,18 @@ note: these functions exist but are inaccessible 102 | fn foo() -> i32 { | ^^^^^^^^^^^^^^^ `crate::t10::foo`: not accessible -error[E0277]: the trait bound `AssertAllProps: HasProp` is not satisfied - --> tests/derive_props/fail.rs:35:24 - | -35 | ::yew::props!{ Props { } }; - | ^^^^^ the trait `HasProp` is not implemented for `AssertAllProps` - | -note: required because of the requirements on the impl of `HasAllProps` for `t3::CheckPropsAll` - --> tests/derive_props/fail.rs:29:21 - | -29 | #[derive(Clone, Properties, PartialEq)] - | ^^^^^^^^^^ - = note: required because of the requirements on the impl of `AllPropsFor` for `AssertAllProps` -note: required by a bound in `html::component::properties::__macro::PreBuild::::build` - --> $WORKSPACE/packages/yew/src/html/component/properties.rs - | - | Token: AllPropsFor, - | ^^^^^^^^^^^^^^^^^^^ required by this bound in `html::component::properties::__macro::PreBuild::::build` - = note: this error originates in the derive macro `Properties` (in Nightly builds, run with -Z macro-backtrace for more info) - error[E0277]: the trait bound `Value: Default` is not satisfied - --> tests/derive_props/fail.rs:9:21 - | -9 | #[derive(Clone, Properties, PartialEq)] - | ^^^^^^^^^^ the trait `Default` is not implemented for `Value` - | + --> tests/derive_props/fail.rs:9:21 + | +9 | #[derive(Clone, Properties, PartialEq)] + | ^^^^^^^^^^ the trait `Default` is not implemented for `Value` + | note: required by a bound in `Option::::unwrap_or_default` - = note: this error originates in the derive macro `Properties` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the derive macro `Properties` (in Nightly builds, run with -Z macro-backtrace for more info) +help: consider annotating `Value` with `#[derive(Default)]` + | +8 | #[derive(Default)] + | error[E0369]: binary operation `==` cannot be applied to type `Value` --> tests/derive_props/fail.rs:13:9 @@ -66,7 +51,7 @@ note: an implementation of `PartialEq<_>` might be missing for `Value` --> tests/derive_props/fail.rs:8:5 | 8 | struct Value; - | ^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^^ must implement `PartialEq<_>` = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Value` with `#[derive(PartialEq)]` | @@ -86,19 +71,52 @@ note: an implementation of `PartialEq<_>` might be missing for `Value` --> tests/derive_props/fail.rs:8:5 | 8 | struct Value; - | ^^^^^^^^^^^^^ must implement `PartialEq<_>` + | ^^^^^^^^^^^^ must implement `PartialEq<_>` = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Value` with `#[derive(PartialEq)]` | 8 | #[derive(PartialEq)] | +error[E0277]: the trait bound `AssertAllProps: HasProp` is not satisfied + --> tests/derive_props/fail.rs:35:24 + | +35 | ::yew::props!{ Props { } }; + | ^^^^^ the trait `HasProp` is not implemented for `AssertAllProps` + | + = help: the following other types implement trait `HasProp`: + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + and $N others +note: required because of the requirements on the impl of `HasAllProps` for `t3::CheckPropsAll` + --> tests/derive_props/fail.rs:29:21 + | +29 | #[derive(Clone, Properties, PartialEq)] + | ^^^^^^^^^^ + = note: required because of the requirements on the impl of `AllPropsFor` for `AssertAllProps` +note: required by a bound in `html::component::properties::__macro::PreBuild::::build` + --> $WORKSPACE/packages/yew/src/html/component/properties.rs + | + | Token: AllPropsFor, + | ^^^^^^^^^^^^^^^^^^^ required by this bound in `html::component::properties::__macro::PreBuild::::build` + = note: this error originates in the derive macro `Properties` (in Nightly builds, run with -Z macro-backtrace for more info) + error[E0308]: mismatched types --> tests/derive_props/fail.rs:54:19 | 54 | #[prop_or(123)] - | ^^^ expected struct `String`, found integer + | ^^^ + | | + | expected struct `String`, found integer + | arguments to this function are incorrect | +note: associated function defined here help: try using a conversion method | 54 | #[prop_or(123.to_string())] @@ -107,30 +125,30 @@ help: try using a conversion method | ++++++++++++ error[E0277]: expected a `FnOnce<()>` closure, found `{integer}` - --> tests/derive_props/fail.rs:64:24 - | -64 | #[prop_or_else(123)] - | ^^^ expected an `FnOnce<()>` closure, found `{integer}` - | - = help: the trait `FnOnce<()>` is not implemented for `{integer}` - = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }` + --> tests/derive_props/fail.rs:64:24 + | +64 | #[prop_or_else(123)] + | ^^^ expected an `FnOnce<()>` closure, found `{integer}` + | + = help: the trait `FnOnce<()>` is not implemented for `{integer}` + = note: wrap the `{integer}` in a closure with no arguments: `|| { /* code */ }` note: required by a bound in `Option::::unwrap_or_else` error[E0593]: function is expected to take 0 arguments, but it takes 1 argument - --> tests/derive_props/fail.rs:84:24 - | -84 | #[prop_or_else(foo)] - | ^^^ expected function that takes 0 arguments + --> tests/derive_props/fail.rs:84:24 + | +84 | #[prop_or_else(foo)] + | ^^^ expected function that takes 0 arguments ... -88 | fn foo(bar: i32) -> String { - | -------------------------- takes 1 argument - | +88 | fn foo(bar: i32) -> String { + | -------------------------- takes 1 argument + | note: required by a bound in `Option::::unwrap_or_else` error[E0271]: type mismatch resolving ` i32 {t10::foo} as FnOnce<()>>::Output == String` - --> tests/derive_props/fail.rs:98:24 - | -98 | #[prop_or_else(foo)] - | ^^^ expected struct `String`, found `i32` - | + --> tests/derive_props/fail.rs:98:24 + | +98 | #[prop_or_else(foo)] + | ^^^ expected struct `String`, found `i32` + | note: required by a bound in `Option::::unwrap_or_else` diff --git a/packages/yew-macro/tests/function_component_attr/bad-return-type-fail.stderr b/packages/yew-macro/tests/function_component_attr/bad-return-type-fail.stderr index 6e99e7d6473..9b8e8a2ab5d 100644 --- a/packages/yew-macro/tests/function_component_attr/bad-return-type-fail.stderr +++ b/packages/yew-macro/tests/function_component_attr/bad-return-type-fail.stderr @@ -10,4 +10,7 @@ error[E0277]: the trait bound `u32: IntoHtmlResult` is not satisfied 11 | #[function_component(Comp)] | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoHtmlResult` is not implemented for `u32` | + = help: the following other types implement trait `IntoHtmlResult`: + Result + VNode = note: this error originates in the attribute macro `function_component` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/packages/yew-macro/tests/function_component_attr/generic-props-fail.stderr b/packages/yew-macro/tests/function_component_attr/generic-props-fail.stderr index e298c0cc8ac..e60f09af641 100644 --- a/packages/yew-macro/tests/function_component_attr/generic-props-fail.stderr +++ b/packages/yew-macro/tests/function_component_attr/generic-props-fail.stderr @@ -13,6 +13,16 @@ error[E0277]: the trait bound `AssertAllProps: HasProp` is not satisfied 22 | html! { /> }; | ^^^^ the trait `HasProp` is not implemented for `AssertAllProps` | + = help: the following other types implement trait `HasProp`: + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + and $N others note: required because of the requirements on the impl of `HasAllProps` for `CheckPropsAll` --> tests/function_component_attr/generic-props-fail.rs:3:17 | @@ -24,7 +34,7 @@ note: required by a bound in `yew::html::component::properties::__macro::PreBuil | | Token: AllPropsFor, | ^^^^^^^^^^^^^^^^^^^ required by this bound in `yew::html::component::properties::__macro::PreBuild::::build` - = note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `html` which comes from the expansion of the derive macro `Properties` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `Comp: yew::BaseComponent` is not satisfied --> tests/function_component_attr/generic-props-fail.rs:27:14 @@ -32,33 +42,26 @@ error[E0277]: the trait bound `Comp: yew::BaseComponent` is n 27 | html! { /> }; | ^^^^ the trait `yew::BaseComponent` is not implemented for `Comp` | - = help: the following implementations were found: - as yew::BaseComponent> + = help: the trait `yew::BaseComponent` is implemented for `Comp

` = note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: the function or associated item `new` exists for struct `VChild>`, but its trait bounds were not satisfied - --> tests/function_component_attr/generic-props-fail.rs:27:14 - | -8 | #[function_component(Comp)] - | --------------------------- doesn't satisfy `Comp: yew::BaseComponent` + --> tests/function_component_attr/generic-props-fail.rs:27:14 + | +8 | #[function_component(Comp)] + | ------------------------- doesn't satisfy `Comp: yew::BaseComponent` ... -27 | html! { /> }; - | ^^^^ function or associated item cannot be called on `VChild>` due to unsatisfied trait bounds - | - = note: the following trait bounds were not satisfied: - `Comp: yew::BaseComponent` +27 | html! { /> }; + | ^^^^ function or associated item cannot be called on `VChild>` due to unsatisfied trait bounds + | + = note: the following trait bounds were not satisfied: + `Comp: yew::BaseComponent` note: the following trait must be implemented - --> $WORKSPACE/packages/yew/src/html/component/mod.rs - | - | / pub trait BaseComponent: Sized + 'static { - | | /// The Component's Message. - | | type Message: 'static; - | | -... | - | | fn prepare_state(&self) -> Option; - | | } - | |_^ - = note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/packages/yew/src/html/component/mod.rs + | + | pub trait BaseComponent: Sized + 'static { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `MissingTypeBounds: yew::Properties` is not satisfied --> tests/function_component_attr/generic-props-fail.rs:27:14 @@ -66,6 +69,12 @@ error[E0277]: the trait bound `MissingTypeBounds: yew::Properties` is not satisf 27 | html! { /> }; | ^^^^ the trait `yew::Properties` is not implemented for `MissingTypeBounds` | + = help: the following other types implement trait `yew::Properties`: + () + ChildrenProps + ContextProviderProps + Props + SuspenseProps note: required by a bound in `Comp` --> tests/function_component_attr/generic-props-fail.rs:11:8 | diff --git a/packages/yew-macro/tests/html_macro/component-fail.stderr b/packages/yew-macro/tests/html_macro/component-fail.stderr index 40917e85ac7..371362c18bc 100644 --- a/packages/yew-macro/tests/html_macro/component-fail.stderr +++ b/packages/yew-macro/tests/html_macro/component-fail.stderr @@ -433,7 +433,7 @@ error[E0599]: no method named `r#type` found for struct `ChildPropertiesBuilder` --> tests/html_macro/component-fail.rs:85:20 | 4 | #[derive(Clone, Properties, PartialEq)] - | ---------- method `r#type` not found for this + | ---------- method `r#type` not found for this struct ... 85 | html! { }; | ^^^^ method not found in `ChildPropertiesBuilder` @@ -450,7 +450,7 @@ error[E0599]: no method named `unknown` found for struct `ChildPropertiesBuilder --> tests/html_macro/component-fail.rs:88:20 | 4 | #[derive(Clone, Properties, PartialEq)] - | ---------- method `unknown` not found for this + | ---------- method `unknown` not found for this struct ... 88 | html! { }; | ^^^^^^^ method not found in `ChildPropertiesBuilder` @@ -463,6 +463,16 @@ error[E0277]: the trait bound `(): IntoPropValue` is not satisfied | | | required by a bound introduced by this call | + = help: the following other types implement trait `IntoPropValue`: + <&'static [(K, V)] as IntoPropValue>> + <&'static [T] as IntoPropValue>> + <&'static str as IntoPropValue> + <&'static str as IntoPropValue>> + <&'static str as IntoPropValue>> + <&'static str as IntoPropValue> + <&'static str as IntoPropValue> + <&T as IntoPropValue>> + and $N others note: required by a bound in `ChildPropertiesBuilder::string` --> tests/html_macro/component-fail.rs:4:17 | @@ -481,11 +491,15 @@ error[E0277]: the trait bound `{integer}: IntoPropValue` is not satisfie | | | required by a bound introduced by this call | - = help: the following implementations were found: - >> - >> - >> - >> + = help: the following other types implement trait `IntoPropValue`: + f32 + f64 + i128 + i16 + i32 + i64 + i8 + isize and $N others note: required by a bound in `ChildPropertiesBuilder::string` --> tests/html_macro/component-fail.rs:4:17 @@ -505,11 +519,15 @@ error[E0277]: the trait bound `{integer}: IntoPropValue` is not satisfie | | | required by a bound introduced by this call | - = help: the following implementations were found: - >> - >> - >> - >> + = help: the following other types implement trait `IntoPropValue`: + f32 + f64 + i128 + i16 + i32 + i64 + i8 + isize and $N others note: required by a bound in `ChildPropertiesBuilder::string` --> tests/html_macro/component-fail.rs:4:17 @@ -533,7 +551,7 @@ error[E0599]: no method named `r#ref` found for struct `ChildPropertiesBuilder` --> tests/html_macro/component-fail.rs:96:26 | 4 | #[derive(Clone, Properties, PartialEq)] - | ---------- method `r#ref` not found for this + | ---------- method `r#ref` not found for this struct ... 96 | html! { }; | ^^^^^ method not found in `ChildPropertiesBuilder` @@ -546,11 +564,15 @@ error[E0277]: the trait bound `u32: IntoPropValue` is not satisfied | | | required by a bound introduced by this call | - = help: the following implementations were found: - >> - >> - >> - >> + = help: the following other types implement trait `IntoPropValue`: + f32 + f64 + i128 + i16 + i32 + i64 + i8 + isize and $N others note: required by a bound in `ChildPropertiesBuilder::int` --> tests/html_macro/component-fail.rs:4:17 @@ -568,6 +590,16 @@ error[E0277]: the trait bound `AssertAllProps: HasProp` is not satisfied 99 | html! { }; | ^^^^^ the trait `HasProp` is not implemented for `AssertAllProps` | + = help: the following other types implement trait `HasProp`: + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp<_ChildContainerProperties::children, HasChildContainerPropertieschildren>> + as HasProp>> + and $N others note: required because of the requirements on the impl of `HasAllProps` for `CheckChildPropertiesAll` --> tests/html_macro/component-fail.rs:4:17 | @@ -579,7 +611,7 @@ note: required by a bound in `yew::html::component::properties::__macro::PreBuil | | Token: AllPropsFor, | ^^^^^^^^^^^^^^^^^^^ required by this bound in `yew::html::component::properties::__macro::PreBuild::::build` - = note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `html` which comes from the expansion of the derive macro `Properties` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0609]: no field `children` on type `ChildProperties` --> tests/html_macro/component-fail.rs:103:14 @@ -594,7 +626,7 @@ error[E0599]: no method named `children` found for struct `ChildPropertiesBuilde --> tests/html_macro/component-fail.rs:103:14 | 4 | #[derive(Clone, Properties, PartialEq)] - | ---------- method `children` not found for this + | ---------- method `children` not found for this struct ... 103 | html! { { "Not allowed" } }; | ^^^^^ method not found in `ChildPropertiesBuilder` @@ -616,6 +648,16 @@ error[E0277]: the trait bound `AssertAllProps: HasProp<_ChildContainerProperties 115 | html! { }; | ^^^^^^^^^^^^^^ the trait `HasProp<_ChildContainerProperties::children, _>` is not implemented for `AssertAllProps` | + = help: the following other types implement trait `HasProp`: + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp<_ChildContainerProperties::children, HasChildContainerPropertieschildren>> + as HasProp>> + and $N others note: required because of the requirements on the impl of `HasAllProps` for `CheckChildContainerPropertiesAll` --> tests/html_macro/component-fail.rs:24:17 | @@ -627,7 +669,7 @@ note: required by a bound in `yew::html::component::properties::__macro::PreBuil | | Token: AllPropsFor, | ^^^^^^^^^^^^^^^^^^^ required by this bound in `yew::html::component::properties::__macro::PreBuild::::build` - = note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `html` which comes from the expansion of the derive macro `Properties` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `AssertAllProps: HasProp<_ChildContainerProperties::children, _>` is not satisfied --> tests/html_macro/component-fail.rs:116:14 @@ -635,6 +677,16 @@ error[E0277]: the trait bound `AssertAllProps: HasProp<_ChildContainerProperties 116 | html! { }; | ^^^^^^^^^^^^^^ the trait `HasProp<_ChildContainerProperties::children, _>` is not implemented for `AssertAllProps` | + = help: the following other types implement trait `HasProp`: + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp>> + as HasProp<_ChildContainerProperties::children, HasChildContainerPropertieschildren>> + as HasProp>> + and $N others note: required because of the requirements on the impl of `HasAllProps` for `CheckChildContainerPropertiesAll` --> tests/html_macro/component-fail.rs:24:17 | @@ -646,18 +698,15 @@ note: required by a bound in `yew::html::component::properties::__macro::PreBuil | | Token: AllPropsFor, | ^^^^^^^^^^^^^^^^^^^ required by this bound in `yew::html::component::properties::__macro::PreBuild::::build` - = note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `html` which comes from the expansion of the derive macro `Properties` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `yew::virtual_dom::VText: IntoPropValue>>` is not satisfied - --> tests/html_macro/component-fail.rs:117:31 + --> tests/html_macro/component-fail.rs:117:14 | 117 | html! { { "Not allowed" } }; - | -------------- ^^^^^^^^^^^^^ the trait `IntoPropValue>>` is not implemented for `yew::virtual_dom::VText` - | | - | required by a bound introduced by this call + | ^^^^^^^^^^^^^^ the trait `IntoPropValue>>` is not implemented for `yew::virtual_dom::VText` | - = help: the following implementations were found: - >> + = help: the trait `IntoPropValue>` is implemented for `yew::virtual_dom::VText` note: required by a bound in `ChildContainerPropertiesBuilder::children` --> tests/html_macro/component-fail.rs:24:17 | @@ -666,7 +715,7 @@ note: required by a bound in `ChildContainerPropertiesBuilder::children` 25 | pub struct ChildContainerProperties { 26 | pub children: ChildrenWithProps, | -------- required by a bound in this - = note: this error originates in the derive macro `Properties` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `html` which comes from the expansion of the derive macro `Properties` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `VChild: From` is not satisfied --> tests/html_macro/component-fail.rs:118:29 @@ -677,15 +726,12 @@ error[E0277]: the trait bound `VChild: From` is not satisfied = note: required because of the requirements on the impl of `Into>` for `VNode` error[E0277]: the trait bound `VNode: IntoPropValue>>` is not satisfied - --> tests/html_macro/component-fail.rs:119:30 + --> tests/html_macro/component-fail.rs:119:14 | 119 | html! { }; - | -------------- ^^^^^ the trait `IntoPropValue>>` is not implemented for `VNode` - | | - | required by a bound introduced by this call + | ^^^^^^^^^^^^^^ the trait `IntoPropValue>>` is not implemented for `VNode` | - = help: the following implementations were found: - >> + = help: the trait `IntoPropValue>` is implemented for `VNode` note: required by a bound in `ChildContainerPropertiesBuilder::children` --> tests/html_macro/component-fail.rs:24:17 | @@ -694,4 +740,4 @@ note: required by a bound in `ChildContainerPropertiesBuilder::children` 25 | pub struct ChildContainerProperties { 26 | pub children: ChildrenWithProps, | -------- required by a bound in this - = note: this error originates in the derive macro `Properties` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `html` which comes from the expansion of the derive macro `Properties` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/packages/yew-macro/tests/html_macro/component-unimplemented-fail.stderr b/packages/yew-macro/tests/html_macro/component-unimplemented-fail.stderr index 480c0693b39..b229ced60b6 100644 --- a/packages/yew-macro/tests/html_macro/component-unimplemented-fail.stderr +++ b/packages/yew-macro/tests/html_macro/component-unimplemented-fail.stderr @@ -4,29 +4,24 @@ error[E0277]: the trait bound `Unimplemented: yew::Component` is not satisfied 6 | html! { }; | ^^^^^^^^^^^^^ the trait `yew::Component` is not implemented for `Unimplemented` | + = help: the trait `yew::Component` is implemented for `ContextProvider` = note: required because of the requirements on the impl of `BaseComponent` for `Unimplemented` = note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0599]: the function or associated item `new` exists for struct `VChild`, but its trait bounds were not satisfied - --> tests/html_macro/component-unimplemented-fail.rs:6:14 - | -3 | struct Unimplemented; - | --------------------- doesn't satisfy `Unimplemented: BaseComponent` + --> tests/html_macro/component-unimplemented-fail.rs:6:14 + | +3 | struct Unimplemented; + | -------------------- doesn't satisfy `Unimplemented: BaseComponent` ... -6 | html! { }; - | ^^^^^^^^^^^^^ function or associated item cannot be called on `VChild` due to unsatisfied trait bounds - | - = note: the following trait bounds were not satisfied: - `Unimplemented: BaseComponent` +6 | html! { }; + | ^^^^^^^^^^^^^ function or associated item cannot be called on `VChild` due to unsatisfied trait bounds + | + = note: the following trait bounds were not satisfied: + `Unimplemented: BaseComponent` note: the following trait must be implemented - --> $WORKSPACE/packages/yew/src/html/component/mod.rs - | - | / pub trait BaseComponent: Sized + 'static { - | | /// The Component's Message. - | | type Message: 'static; - | | -... | - | | fn prepare_state(&self) -> Option; - | | } - | |_^ - = note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $WORKSPACE/packages/yew/src/html/component/mod.rs + | + | pub trait BaseComponent: Sized + 'static { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/packages/yew-macro/tests/html_macro/element-fail.stderr b/packages/yew-macro/tests/html_macro/element-fail.stderr index ecb38f61c01..1946d88f0f1 100644 --- a/packages/yew-macro/tests/html_macro/element-fail.stderr +++ b/packages/yew-macro/tests/html_macro/element-fail.stderr @@ -369,22 +369,40 @@ error[E0308]: mismatched types --> tests/html_macro/element-fail.rs:36:28 | 36 | html! { }; - | ^ expected `bool`, found integer + | -----------------------^----- + | | | + | | expected `bool`, found integer + | arguments to this enum variant are incorrect + | +note: tuple variant defined here error[E0308]: mismatched types --> tests/html_macro/element-fail.rs:37:29 | 37 | html! { }; - | ^^^^^^^^^^^ expected `bool`, found enum `Option` + | ------------------------^^^^^^^^^^^------ + | | | + | | expected `bool`, found enum `Option` + | arguments to this enum variant are incorrect | = note: expected type `bool` found enum `Option` +note: tuple variant defined here error[E0308]: mismatched types --> tests/html_macro/element-fail.rs:38:29 | 38 | html! { }; - | ^ expected `bool`, found integer + | ^ + | | + | expected `bool`, found integer + | arguments to this function are incorrect + | +note: function defined here + --> $WORKSPACE/packages/yew/src/utils/mod.rs + | + | pub fn __ensure_type(_: T) {} + | ^^^^^^^^^^^^^ error[E0308]: mismatched types --> tests/html_macro/element-fail.rs:39:30 @@ -399,63 +417,112 @@ error[E0308]: mismatched types --> tests/html_macro/element-fail.rs:40:30 | 40 | html! {