mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
* yew-macro: optimize VTag construction in html! macro * vtag: remove inlining suggestions * vtag: clean up doc comment
378 lines
14 KiB
Plaintext
378 lines
14 KiB
Plaintext
error: this opening tag has no corresponding closing tag
|
|
--> $DIR/element-fail.rs:6:13
|
|
|
|
|
6 | html! { <div> };
|
|
| ^^^^^
|
|
|
|
error: this opening tag has no corresponding closing tag
|
|
--> $DIR/element-fail.rs:7:18
|
|
|
|
|
7 | html! { <div><div> };
|
|
| ^^^^^
|
|
|
|
error: this closing tag has no corresponding opening tag
|
|
--> $DIR/element-fail.rs:8:13
|
|
|
|
|
8 | html! { </div> };
|
|
| ^^^^^^
|
|
|
|
error: this opening tag has no corresponding closing tag
|
|
--> $DIR/element-fail.rs:9:13
|
|
|
|
|
9 | html! { <div><div></div> };
|
|
| ^^^^^
|
|
|
|
error: only one root html element is allowed (hint: you can wrap multiple html elements in a fragment `<></>`)
|
|
--> $DIR/element-fail.rs:10:24
|
|
|
|
|
10 | html! { <div></div><div></div> };
|
|
| ^^^^^^^^^^^
|
|
|
|
error: this closing tag has no corresponding opening tag
|
|
--> $DIR/element-fail.rs:11:18
|
|
|
|
|
11 | html! { <div></span> };
|
|
| ^^^^^^^
|
|
|
|
error: this closing tag has no corresponding opening tag
|
|
--> $DIR/element-fail.rs:12:20
|
|
|
|
|
12 | html! { <tag-a></tag-b> };
|
|
| ^^^^^^^^
|
|
|
|
error: this closing tag has no corresponding opening tag
|
|
--> $DIR/element-fail.rs:13:18
|
|
|
|
|
13 | html! { <div></span></div> };
|
|
| ^^^^^^^
|
|
|
|
error: only one root html element is allowed (hint: you can wrap multiple html elements in a fragment `<></>`)
|
|
--> $DIR/element-fail.rs:14:20
|
|
|
|
|
14 | html! { <img /></img> };
|
|
| ^^^^^^
|
|
|
|
error: expected a valid html element
|
|
--> $DIR/element-fail.rs:15:18
|
|
|
|
|
15 | html! { <div>Invalid</div> };
|
|
| ^^^^^^^
|
|
|
|
error: `attr` can only be specified once but is given here again
|
|
--> $DIR/element-fail.rs:17:27
|
|
|
|
|
17 | html! { <input attr=1 attr=2 /> };
|
|
| ^^^^
|
|
|
|
error: `value` can only be specified once but is given here again
|
|
--> $DIR/element-fail.rs:18:32
|
|
|
|
|
18 | html! { <input value="123" value="456" /> };
|
|
| ^^^^^
|
|
|
|
error: `kind` can only be specified once but is given here again
|
|
--> $DIR/element-fail.rs:19:36
|
|
|
|
|
19 | html! { <input kind="checkbox" kind="submit" /> };
|
|
| ^^^^
|
|
|
|
error: `checked` can only be specified once but is given here again
|
|
--> $DIR/element-fail.rs:20:33
|
|
|
|
|
20 | html! { <input checked=true checked=false /> };
|
|
| ^^^^^^^
|
|
|
|
error: `disabled` can only be specified once but is given here again
|
|
--> $DIR/element-fail.rs:21:34
|
|
|
|
|
21 | html! { <input disabled=true disabled=false /> };
|
|
| ^^^^^^^^
|
|
|
|
error: `selected` can only be specified once but is given here again
|
|
--> $DIR/element-fail.rs:22:35
|
|
|
|
|
22 | html! { <option selected=true selected=false /> };
|
|
| ^^^^^^^^
|
|
|
|
error: `class` can only be specified once but is given here again
|
|
--> $DIR/element-fail.rs:23:32
|
|
|
|
|
23 | html! { <div class="first" class="second" /> };
|
|
| ^^^^^
|
|
|
|
error: `ref` can only be specified once
|
|
--> $DIR/element-fail.rs:38:20
|
|
|
|
|
38 | html! { <input ref=() ref=() /> };
|
|
| ^^^
|
|
|
|
error: the tag `<input>` is a void element and cannot have children (hint: rewrite this as `<input/>`)
|
|
--> $DIR/element-fail.rs:40:13
|
|
|
|
|
40 | html! { <input type="text"></input> };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: the tag `<iNpUt>` is a void element and cannot have children (hint: rewrite this as `<iNpUt/>`)
|
|
--> $DIR/element-fail.rs:41:13
|
|
|
|
|
41 | html! { <iNpUt type="text"></iNpUt> };
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: this dynamic tag is missing an expression block defining its value
|
|
--> $DIR/element-fail.rs:43:14
|
|
|
|
|
43 | html! { <@></@> };
|
|
| ^
|
|
|
|
error: dynamic closing tags must not have a body (hint: replace it with just `</@>`)
|
|
--> $DIR/element-fail.rs:44:27
|
|
|
|
|
44 | html! { <@{"test"}></@{"test"}> };
|
|
| ^^^^^^^^
|
|
|
|
error: this dynamic tag is missing an expression block defining its value
|
|
--> $DIR/element-fail.rs:46:14
|
|
|
|
|
46 | html! { <@/> };
|
|
| ^
|
|
|
|
error: boolean attributes don't support being used as an optional attribute (hint: a value of false results in the attribute not being set)
|
|
--> $DIR/element-fail.rs:50:20
|
|
|
|
|
50 | html! { <input disabled?=Some(true) /> };
|
|
| ^^^^^^^^
|
|
|
|
error: `checked` does not support being used as an optional attribute
|
|
--> $DIR/element-fail.rs:58:20
|
|
|
|
|
58 | html! { <input checked?=Some(false) /> };
|
|
| ^^^^^^^^^
|
|
|
|
error: `ref` does not support being used as an optional attribute
|
|
--> $DIR/element-fail.rs:59:20
|
|
|
|
|
59 | html! { <input ref?=() /> };
|
|
| ^^^^^
|
|
|
|
warning: use of deprecated function `compile_fail::deprecated_use_of_class`: the use of `(...)` with the attribute `class` is deprecated and will be removed in version 0.19. Use the `classes!` macro instead.
|
|
--> $DIR/element-fail.rs:63:24
|
|
|
|
|
63 | html! { <div class=("deprecated", "warning") /> };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
= note: `#[warn(deprecated)]` on by default
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/element-fail.rs:25:28
|
|
|
|
|
25 | html! { <input checked=1 /> };
|
|
| ^ expected `bool`, found integer
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/element-fail.rs:26:29
|
|
|
|
|
26 | html! { <input disabled=1 /> };
|
|
| ^ expected `bool`, found integer
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/element-fail.rs:27:30
|
|
|
|
|
27 | html! { <option selected=1 /> };
|
|
| ^ expected `bool`, found integer
|
|
|
|
error[E0277]: `()` doesn't implement `std::fmt::Display`
|
|
--> $DIR/element-fail.rs:28:25
|
|
|
|
|
28 | html! { <input type=() /> };
|
|
| ^^ `()` cannot be formatted with the default formatter
|
|
|
|
|
= help: the trait `std::fmt::Display` is not implemented for `()`
|
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
|
= note: required because of the requirements on the impl of `ToString` for `()`
|
|
= note: required by `to_string`
|
|
|
|
error[E0277]: `()` doesn't implement `std::fmt::Display`
|
|
--> $DIR/element-fail.rs:29:26
|
|
|
|
|
29 | html! { <input value=() /> };
|
|
| ^^ `()` cannot be formatted with the default formatter
|
|
|
|
|
= help: the trait `std::fmt::Display` is not implemented for `()`
|
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
|
= note: required because of the requirements on the impl of `ToString` for `()`
|
|
= note: required by `to_string`
|
|
|
|
error[E0277]: `()` doesn't implement `std::fmt::Display`
|
|
--> $DIR/element-fail.rs:30:21
|
|
|
|
|
30 | html! { <a href=() /> };
|
|
| ^^ `()` cannot be formatted with the default formatter
|
|
|
|
|
= help: the trait `std::fmt::Display` is not implemented for `()`
|
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
|
= note: required because of the requirements on the impl of `ToString` for `()`
|
|
= note: required by `to_string`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/element-fail.rs:32:28
|
|
|
|
|
32 | html! { <input onclick=1 /> };
|
|
| ^ expected enum `yew::Callback`, found integer
|
|
|
|
|
= note: expected enum `yew::Callback<MouseEvent>`
|
|
found type `{integer}`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/element-fail.rs:33:28
|
|
|
|
|
33 | html! { <input onclick=Callback::from(|a: String| ()) /> };
|
|
| ^^^^^^^^ expected struct `MouseEvent`, found struct `String`
|
|
|
|
|
= note: expected enum `yew::Callback<MouseEvent>`
|
|
found enum `yew::Callback<String>`
|
|
|
|
error[E0277]: `NotToString` doesn't implement `std::fmt::Display`
|
|
--> $DIR/element-fail.rs:35:27
|
|
|
|
|
35 | html! { <input string=NotToString /> };
|
|
| ^^^^^^^^^^^ `NotToString` cannot be formatted with the default formatter
|
|
|
|
|
= help: the trait `std::fmt::Display` is not implemented for `NotToString`
|
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
|
= note: required because of the requirements on the impl of `ToString` for `NotToString`
|
|
= note: required by `to_string`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/element-fail.rs:37:24
|
|
|
|
|
37 | html! { <input ref=() /> };
|
|
| ^^ expected struct `NodeRef`, found `()`
|
|
|
|
error[E0277]: the trait bound `Cow<'static, str>: From<{integer}>` is not satisfied
|
|
--> $DIR/element-fail.rs:45:15
|
|
|
|
|
45 | html! { <@{55}></@> };
|
|
| ^^^^ the trait `From<{integer}>` is not implemented for `Cow<'static, str>`
|
|
|
|
|
= help: the following implementations were found:
|
|
<Cow<'a, CStr> as From<&'a CStr>>
|
|
<Cow<'a, CStr> as From<&'a CString>>
|
|
<Cow<'a, CStr> as From<CString>>
|
|
<Cow<'a, OsStr> as From<&'a OsStr>>
|
|
and 11 others
|
|
= note: required because of the requirements on the impl of `Into<Cow<'static, str>>` for `{integer}`
|
|
= note: required by `into`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/element-fail.rs:48:23
|
|
|
|
|
48 | html! { <a media?="media" /> };
|
|
| ^^^^^^^
|
|
| |
|
|
| expected enum `Option`, found `&str`
|
|
| help: try using a variant of the expected enum: `Some("media")`
|
|
|
|
|
= note: expected enum `Option<_>`
|
|
found reference `&'static str`
|
|
|
|
error[E0277]: `NotToString` doesn't implement `std::fmt::Display`
|
|
--> $DIR/element-fail.rs:49:23
|
|
|
|
|
49 | html! { <a media?=Some(NotToString) /> };
|
|
| ^^^^ `NotToString` cannot be formatted with the default formatter
|
|
|
|
|
= help: the trait `std::fmt::Display` is not implemented for `NotToString`
|
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
|
= note: required because of the requirements on the impl of `ToString` for `NotToString`
|
|
= note: required by `to_string`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/element-fail.rs:51:26
|
|
|
|
|
51 | html! { <input type?="kind" /> };
|
|
| ^^^^^^
|
|
| |
|
|
| expected enum `Option`, found `&str`
|
|
| help: try using a variant of the expected enum: `Some("kind")`
|
|
|
|
|
= note: expected enum `Option<_>`
|
|
found reference `&'static str`
|
|
|
|
error[E0277]: `NotToString` doesn't implement `std::fmt::Display`
|
|
--> $DIR/element-fail.rs:52:26
|
|
|
|
|
52 | html! { <input type?=Some(NotToString) /> };
|
|
| ^^^^ `NotToString` cannot be formatted with the default formatter
|
|
|
|
|
= help: the trait `std::fmt::Display` is not implemented for `NotToString`
|
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
|
= note: required because of the requirements on the impl of `ToString` for `NotToString`
|
|
= note: required by `to_string`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/element-fail.rs:53:24
|
|
|
|
|
53 | html! { <li value?="value" /> };
|
|
| ^^^^^^^
|
|
| |
|
|
| expected enum `Option`, found `&str`
|
|
| help: try using a variant of the expected enum: `Some("value")`
|
|
|
|
|
= note: expected enum `Option<_>`
|
|
found reference `&'static str`
|
|
|
|
error[E0277]: `NotToString` doesn't implement `std::fmt::Display`
|
|
--> $DIR/element-fail.rs:54:24
|
|
|
|
|
54 | html! { <li value?=Some(NotToString) /> };
|
|
| ^^^^ `NotToString` cannot be formatted with the default formatter
|
|
|
|
|
= help: the trait `std::fmt::Display` is not implemented for `NotToString`
|
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
|
= note: required because of the requirements on the impl of `ToString` for `NotToString`
|
|
= note: required by `to_string`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/element-fail.rs:56:22
|
|
|
|
|
56 | html! { <a href?="href" /> };
|
|
| ^^^^^^
|
|
| |
|
|
| expected enum `Option`, found `&str`
|
|
| help: try using a variant of the expected enum: `Some("href")`
|
|
|
|
|
= note: expected enum `Option<_>`
|
|
found reference `&'static str`
|
|
|
|
error[E0277]: `NotToString` doesn't implement `std::fmt::Display`
|
|
--> $DIR/element-fail.rs:57:22
|
|
|
|
|
57 | html! { <a href?=Some(NotToString) /> };
|
|
| ^^^^ `NotToString` cannot be formatted with the default formatter
|
|
|
|
|
= help: the trait `std::fmt::Display` is not implemented for `NotToString`
|
|
= note: in format strings you may be able to use `{:?}` (or {:#?} for pretty-print) instead
|
|
= note: required because of the requirements on the impl of `ToString` for `NotToString`
|
|
= note: required by `to_string`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/element-fail.rs:60:20
|
|
|
|
|
60 | html! { <input onfocus?=Some(5) /> };
|
|
| ^^^^^^^ expected enum `yew::Callback`, found integer
|
|
|
|
|
= note: expected enum `yew::Callback<FocusEvent>`
|
|
found type `{integer}`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/element-fail.rs:61:29
|
|
|
|
|
61 | html! { <input onfocus?=Callback::from(|_| ()) /> };
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
| |
|
|
| expected enum `Option`, found enum `yew::Callback`
|
|
| help: try using a variant of the expected enum: `Some(Callback::from(|_| ()))`
|
|
|
|
|
= note: expected enum `Option<_>`
|
|
found enum `yew::Callback<_>`
|