Skip to content

Commit b4d083e

Browse files
concise diagnostics for missing props (#3873)
1 parent 4d08a03 commit b4d083e

File tree

55 files changed

+337
-189
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+337
-189
lines changed

.github/workflows/main-checks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
fail-fast: false
7070
matrix:
7171
toolchain:
72-
- 1.76.0
72+
- 1.78.0
7373
- stable
7474

7575
steps:
@@ -120,7 +120,7 @@ jobs:
120120
fail-fast: false
121121
matrix:
122122
toolchain:
123-
- 1.76.0
123+
- 1.78.0
124124
- stable
125125
- nightly
126126

examples/wasi_ssr_module/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub async fn render() -> Result<String> {
5454
#[tokio::main(flavor = "current_thread")]
5555
async fn main() -> Result<()> {
5656
let ret = render().await?;
57-
println!("{}", ret);
57+
println!("{ret}");
5858

5959
Ok(())
6060
}

examples/web_worker_fib/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn Main() -> Html {
2929
// start the worker
3030
let output_value = fib_agent.run(input_value).await;
3131

32-
output.set(format!("Fibonacci value: {}", output_value));
32+
output.set(format!("Fibonacci value: {output_value}"));
3333
});
3434
}
3535
};

packages/yew-agent-macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "yew-agent-macro"
33
version = "0.2.0"
44
edition = "2021"
5-
rust-version = "1.76.0"
5+
rust-version = "1.78.0"
66
authors = ["Kaede Hoshikawa <[email protected]>"]
77
repository = "https://github.com/yewstack/yew"
88
homepage = "https://yew.rs"

packages/yew-agent/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ edition = "2021"
99
readme = "../../README.md"
1010
description = "Agents for Yew"
1111
license = "MIT OR Apache-2.0"
12-
rust-version = "1.76.0"
12+
rust-version = "1.78.0"
1313

1414
[dependencies]
1515
yew = { version = "0.21.0", path = "../yew" }

packages/yew-macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ license = "MIT OR Apache-2.0"
1010
keywords = ["web", "wasm", "frontend", "webasm", "webassembly"]
1111
categories = ["gui", "web-programming", "wasm"]
1212
description = "A framework for making client-side single-page apps"
13-
rust-version = "1.76.0"
13+
rust-version = "1.78.0"
1414

1515
[lib]
1616
proc-macro = true

packages/yew-macro/Makefile.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tasks.test]
22
clear = true
3-
toolchain = "1.76.0"
3+
toolchain = "1.78.0"
44
command = "cargo"
55
# test target can be optionally specified like `cargo make test html_macro`,
66
args = ["test", "${@}"]

packages/yew-macro/src/derive_props/builder.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,13 @@ impl PropsBuilder<'_> {
142142
#vis struct #check_all_props_name<How>(::std::marker::PhantomData<How>);
143143

144144
#[automatically_derived]
145+
#[diagnostic::do_not_recommend]
145146
impl<B, P, How> ::yew::html::HasProp<P, &dyn ::yew::html::HasProp<P, How>>
146147
for #check_all_props_name<B>
147148
where B: ::yew::html::HasProp<P, How> {}
148149

149150
#[automatically_derived]
151+
#[diagnostic::do_not_recommend]
150152
impl #check_impl_generics ::yew::html::HasAllProps<
151153
#props_name #ty_generics ,
152154
( #( #check_args , )* ),

packages/yew-macro/src/derive_props/field.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,12 @@ impl PropFieldCheck<'_> {
245245
#vis struct #check_struct<How>(::std::marker::PhantomData<How>);
246246

247247
#[automatically_derived]
248+
#[diagnostic::do_not_recommend]
248249
impl<B> ::yew::html::HasProp< #prop_name_mod :: #prop_check_name, #check_struct<B>>
249250
for #check_struct<B> {}
251+
250252
#[automatically_derived]
253+
#[diagnostic::do_not_recommend]
251254
impl<B, P, How> ::yew::html::HasProp<P, &dyn ::yew::html::HasProp<P, How>>
252255
for #check_struct<B>
253256
where B: ::yew::html::HasProp<P, How> {}

packages/yew-macro/tests/classes_macro/classes-fail.stderr

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ error[E0277]: the trait bound `Classes: From<{integer}>` is not satisfied
1414
--> tests/classes_macro/classes-fail.rs:4:14
1515
|
1616
4 | classes!(42);
17-
| ^^ the trait `From<{integer}>` is not implemented for `Classes`
17+
| ^^ the trait `From<{integer}>` is not implemented for `Classes`, which is required by `{integer}: Into<Classes>`
1818
|
1919
= help: the following other types implement trait `From<T>`:
20-
<Classes as From<Cow<'static, str>>>
2120
<Classes as From<implicit_clone::unsync::string::IString>>
21+
<Classes as From<Cow<'static, str>>>
2222
<Classes as From<Vec<T>>>
2323
<Classes as From<String>>
2424
<Classes as From<Option<T>>>
@@ -37,11 +37,11 @@ error[E0277]: the trait bound `Classes: From<{float}>` is not satisfied
3737
--> tests/classes_macro/classes-fail.rs:5:14
3838
|
3939
5 | classes!(42.0);
40-
| ^^^^ the trait `From<{float}>` is not implemented for `Classes`
40+
| ^^^^ the trait `From<{float}>` is not implemented for `Classes`, which is required by `{float}: Into<Classes>`
4141
|
4242
= help: the following other types implement trait `From<T>`:
43-
<Classes as From<Cow<'static, str>>>
4443
<Classes as From<implicit_clone::unsync::string::IString>>
44+
<Classes as From<Cow<'static, str>>>
4545
<Classes as From<Vec<T>>>
4646
<Classes as From<String>>
4747
<Classes as From<Option<T>>>
@@ -62,12 +62,12 @@ error[E0277]: the trait bound `Classes: From<{integer}>` is not satisfied
6262
9 | classes!(vec![42]);
6363
| ---^^^^^
6464
| |
65-
| the trait `From<{integer}>` is not implemented for `Classes`
65+
| the trait `From<{integer}>` is not implemented for `Classes`, which is required by `Vec<{integer}>: Into<Classes>`
6666
| required by a bound introduced by this call
6767
|
6868
= help: the following other types implement trait `From<T>`:
69-
<Classes as From<Cow<'static, str>>>
7069
<Classes as From<implicit_clone::unsync::string::IString>>
70+
<Classes as From<Cow<'static, str>>>
7171
<Classes as From<Vec<T>>>
7272
<Classes as From<String>>
7373
<Classes as From<Option<T>>>
@@ -89,11 +89,11 @@ error[E0277]: the trait bound `Classes: From<{integer}>` is not satisfied
8989
--> tests/classes_macro/classes-fail.rs:13:14
9090
|
9191
13 | classes!(some);
92-
| ^^^^ the trait `From<{integer}>` is not implemented for `Classes`
92+
| ^^^^ the trait `From<{integer}>` is not implemented for `Classes`, which is required by `Option<{integer}>: Into<Classes>`
9393
|
9494
= help: the following other types implement trait `From<T>`:
95-
<Classes as From<Cow<'static, str>>>
9695
<Classes as From<implicit_clone::unsync::string::IString>>
96+
<Classes as From<Cow<'static, str>>>
9797
<Classes as From<Vec<T>>>
9898
<Classes as From<String>>
9999
<Classes as From<Option<T>>>
@@ -115,11 +115,11 @@ error[E0277]: the trait bound `Classes: From<u32>` is not satisfied
115115
--> tests/classes_macro/classes-fail.rs:14:14
116116
|
117117
14 | classes!(none);
118-
| ^^^^ the trait `From<u32>` is not implemented for `Classes`
118+
| ^^^^ the trait `From<u32>` is not implemented for `Classes`, which is required by `Option<u32>: Into<Classes>`
119119
|
120120
= help: the following other types implement trait `From<T>`:
121-
<Classes as From<Cow<'static, str>>>
122121
<Classes as From<implicit_clone::unsync::string::IString>>
122+
<Classes as From<Cow<'static, str>>>
123123
<Classes as From<Vec<T>>>
124124
<Classes as From<String>>
125125
<Classes as From<Option<T>>>
@@ -141,11 +141,11 @@ error[E0277]: the trait bound `Classes: From<{integer}>` is not satisfied
141141
--> tests/classes_macro/classes-fail.rs:16:21
142142
|
143143
16 | classes!("one", 42);
144-
| ^^ the trait `From<{integer}>` is not implemented for `Classes`
144+
| ^^ the trait `From<{integer}>` is not implemented for `Classes`, which is required by `{integer}: Into<Classes>`
145145
|
146146
= help: the following other types implement trait `From<T>`:
147-
<Classes as From<Cow<'static, str>>>
148147
<Classes as From<implicit_clone::unsync::string::IString>>
148+
<Classes as From<Cow<'static, str>>>
149149
<Classes as From<Vec<T>>>
150150
<Classes as From<String>>
151151
<Classes as From<Option<T>>>

0 commit comments

Comments
 (0)