yew/packages/yew-macro/tests/html_macro/element-fail.stderr
Jens Reimann b03f02f624
Bring back &str assignment to optional properties (#1895)
This drops the "optional" conversion concept in favor of directly
converting to `Option<T>`.

fixes #1888
2021-06-07 17:15:59 +02:00

341 lines
14 KiB
Plaintext

error: this opening tag has no corresponding closing tag
--> $DIR/element-fail.rs:7:13
|
7 | html! { <div> };
| ^^^^^
error: this opening tag has no corresponding closing tag
--> $DIR/element-fail.rs:8:18
|
8 | html! { <div><div> };
| ^^^^^
error: this opening tag has no corresponding closing tag
--> $DIR/element-fail.rs:9:13
|
9 | html! { <div><div></div> };
| ^^^^^
error: this closing tag has no corresponding opening tag
--> $DIR/element-fail.rs:12:13
|
12 | html! { </div> };
| ^^^^^^
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: this closing tag has no corresponding opening tag
--> $DIR/element-fail.rs:17:18
|
17 | html! { <div></span> };
| ^^^^^^^
error: this closing tag has no corresponding opening tag
--> $DIR/element-fail.rs:18:20
|
18 | html! { <tag-a></tag-b> };
| ^^^^^^^^
error: only one root html element is allowed (hint: you can wrap multiple html elements in a fragment `<></>`)
--> $DIR/element-fail.rs:21:24
|
21 | html! { <div></div><div></div> };
| ^^^^^^^^^^^
error: expected a valid html element
--> $DIR/element-fail.rs:23:18
|
23 | html! { <div>Invalid</div> };
| ^^^^^^^
error: `attr` can only be specified once but is given here again
--> $DIR/element-fail.rs:26:27
|
26 | html! { <input attr=1 attr=2 /> };
| ^^^^
error: `value` can only be specified once but is given here again
--> $DIR/element-fail.rs:27:32
|
27 | html! { <input value="123" value="456" /> };
| ^^^^^
error: `kind` can only be specified once but is given here again
--> $DIR/element-fail.rs:28:36
|
28 | html! { <input kind="checkbox" kind="submit" /> };
| ^^^^
error: `checked` can only be specified once but is given here again
--> $DIR/element-fail.rs:29:33
|
29 | html! { <input checked=true checked=false /> };
| ^^^^^^^
error: `disabled` can only be specified once but is given here again
--> $DIR/element-fail.rs:30:34
|
30 | html! { <input disabled=true disabled=false /> };
| ^^^^^^^^
error: `selected` can only be specified once but is given here again
--> $DIR/element-fail.rs:31:35
|
31 | html! { <option selected=true selected=false /> };
| ^^^^^^^^
error: `class` can only be specified once but is given here again
--> $DIR/element-fail.rs:32:32
|
32 | html! { <div class="first" class="second" /> };
| ^^^^^
error: `ref` can only be specified once
--> $DIR/element-fail.rs:33:20
|
33 | 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:60:13
|
60 | 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:62:13
|
62 | html! { <iNpUt type="text"></iNpUt> };
| ^^^^^^^^^^^^^^^^^^^
error: this dynamic tag is missing an expression block defining its value
--> $DIR/element-fail.rs:65:14
|
65 | html! { <@></@> };
| ^
error: this dynamic tag is missing an expression block defining its value
--> $DIR/element-fail.rs:66:14
|
66 | html! { <@/> };
| ^
error: dynamic closing tags must not have a body (hint: replace it with just `</@>`)
--> $DIR/element-fail.rs:69:27
|
69 | html! { <@{"test"}></@{"test"}> };
| ^^^^^^^^
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:74:24
|
74 | html! { <div class=("deprecated", "warning") /> };
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[warn(deprecated)]` on by default
error[E0308]: mismatched types
--> $DIR/element-fail.rs:36:28
|
36 | html! { <input checked=1 /> };
| ^ expected `bool`, found integer
error[E0308]: mismatched types
--> $DIR/element-fail.rs:37:28
|
37 | html! { <input checked=Some(false) /> };
| ^^^^^^^^^^^ expected `bool`, found enum `Option`
|
= note: expected type `bool`
found enum `Option<bool>`
error[E0308]: mismatched types
--> $DIR/element-fail.rs:38:29
|
38 | html! { <input disabled=1 /> };
| ^ expected `bool`, found integer
error[E0308]: mismatched types
--> $DIR/element-fail.rs:39:29
|
39 | html! { <input disabled=Some(true) /> };
| ^^^^^^^^^^ expected `bool`, found enum `Option`
|
= note: expected type `bool`
found enum `Option<bool>`
error[E0308]: mismatched types
--> $DIR/element-fail.rs:40:30
|
40 | html! { <option selected=1 /> };
| ^ expected `bool`, found integer
error[E0277]: the trait bound `(): IntoPropValue<Option<Cow<'static, str>>>` is not satisfied
--> $DIR/element-fail.rs:43:25
|
43 | html! { <input type=() /> };
| ^^ the trait `IntoPropValue<Option<Cow<'static, str>>>` is not implemented for `()`
error[E0277]: the trait bound `(): IntoPropValue<Option<Cow<'static, str>>>` is not satisfied
--> $DIR/element-fail.rs:44:26
|
44 | html! { <input value=() /> };
| ^^ the trait `IntoPropValue<Option<Cow<'static, str>>>` is not implemented for `()`
error[E0277]: the trait bound `(): IntoPropValue<Option<Cow<'static, str>>>` is not satisfied
--> $DIR/element-fail.rs:45:21
|
45 | html! { <a href=() /> };
| ^^ the trait `IntoPropValue<Option<Cow<'static, str>>>` is not implemented for `()`
|
::: $WORKSPACE/packages/yew/src/virtual_dom/mod.rs:61:47
|
61 | pub fn new(key: &'static str, value: impl IntoPropValue<Option<AttrValue>>) -> Self {
| -------------------------------- required by this bound in `PositionalAttr::new`
error[E0277]: the trait bound `NotToString: IntoPropValue<Option<Cow<'static, str>>>` is not satisfied
--> $DIR/element-fail.rs:46:27
|
46 | html! { <input string=NotToString /> };
| ^^^^^^^^^^^ the trait `IntoPropValue<Option<Cow<'static, str>>>` is not implemented for `NotToString`
|
::: $WORKSPACE/packages/yew/src/virtual_dom/mod.rs:61:47
|
61 | pub fn new(key: &'static str, value: impl IntoPropValue<Option<AttrValue>>) -> Self {
| -------------------------------- required by this bound in `PositionalAttr::new`
error[E0277]: the trait bound `Option<NotToString>: IntoPropValue<Option<Cow<'static, str>>>` is not satisfied
--> $DIR/element-fail.rs:47:22
|
47 | html! { <a media=Some(NotToString) /> };
| ^^^^^^^^^^^^^^^^^ the trait `IntoPropValue<Option<Cow<'static, str>>>` is not implemented for `Option<NotToString>`
|
::: $WORKSPACE/packages/yew/src/virtual_dom/mod.rs:61:47
|
61 | pub fn new(key: &'static str, value: impl IntoPropValue<Option<AttrValue>>) -> Self {
| -------------------------------- required by this bound in `PositionalAttr::new`
|
= help: the following implementations were found:
<Option<&'static str> as IntoPropValue<Option<Cow<'static, str>>>>
<Option<&'static str> as IntoPropValue<Option<String>>>
<Option<String> as IntoPropValue<Option<Cow<'static, str>>>>
error[E0277]: the trait bound `Option<{integer}>: IntoPropValue<Option<Cow<'static, str>>>` is not satisfied
--> $DIR/element-fail.rs:48:21
|
48 | html! { <a href=Some(5) /> };
| ^^^^^^^ the trait `IntoPropValue<Option<Cow<'static, str>>>` is not implemented for `Option<{integer}>`
|
::: $WORKSPACE/packages/yew/src/virtual_dom/mod.rs:61:47
|
61 | pub fn new(key: &'static str, value: impl IntoPropValue<Option<AttrValue>>) -> Self {
| -------------------------------- required by this bound in `PositionalAttr::new`
|
= help: the following implementations were found:
<Option<&'static str> as IntoPropValue<Option<Cow<'static, str>>>>
<Option<&'static str> as IntoPropValue<Option<String>>>
<Option<String> as IntoPropValue<Option<Cow<'static, str>>>>
error[E0277]: the trait bound `{integer}: IntoPropValue<Option<yew::Callback<MouseEvent>>>` is not satisfied
--> $DIR/element-fail.rs:51:28
|
51 | html! { <input onclick=1 /> };
| ^ the trait `IntoPropValue<Option<yew::Callback<MouseEvent>>>` is not implemented for `{integer}`
|
::: $WORKSPACE/packages/yew/src/html/listener/events.rs:2:1
|
2 | / impl_action! {
3 | | onabort(name: "abort", event: Event) -> web_sys::Event => |_, event| { event }
4 | | onauxclick(name: "auxclick", event: MouseEvent) -> web_sys::MouseEvent => |_, event| { event }
5 | | onblur(name: "blur", event: FocusEvent) -> web_sys::FocusEvent => |_, event| { event }
... |
99 | | ontransitionstart(name: "transitionstart", event: TransitionEvent) -> web_sys::TransitionEvent => |_, event| { event }
100 | | }
| |_- required by this bound in `yew::html::onclick::Wrapper::__macro_new`
|
= help: the following implementations were found:
<&'static str as IntoPropValue<Cow<'static, str>>>
<&'static str as IntoPropValue<Option<Cow<'static, str>>>>
<&'static str as IntoPropValue<Option<String>>>
<&'static str as IntoPropValue<String>>
and 11 others
error[E0277]: the trait bound `yew::Callback<String>: IntoPropValue<Option<yew::Callback<MouseEvent>>>` is not satisfied
--> $DIR/element-fail.rs:52:28
|
52 | html! { <input onclick=Callback::from(|a: String| ()) /> };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `IntoPropValue<Option<yew::Callback<MouseEvent>>>` is not implemented for `yew::Callback<String>`
|
::: $WORKSPACE/packages/yew/src/html/listener/events.rs:2:1
|
2 | / impl_action! {
3 | | onabort(name: "abort", event: Event) -> web_sys::Event => |_, event| { event }
4 | | onauxclick(name: "auxclick", event: MouseEvent) -> web_sys::MouseEvent => |_, event| { event }
5 | | onblur(name: "blur", event: FocusEvent) -> web_sys::FocusEvent => |_, event| { event }
... |
99 | | ontransitionstart(name: "transitionstart", event: TransitionEvent) -> web_sys::TransitionEvent => |_, event| { event }
100 | | }
| |_- required by this bound in `yew::html::onclick::Wrapper::__macro_new`
error[E0277]: the trait bound `Option<{integer}>: IntoPropValue<Option<yew::Callback<FocusEvent>>>` is not satisfied
--> $DIR/element-fail.rs:53:28
|
53 | html! { <input onfocus=Some(5) /> };
| ^^^^^^^ the trait `IntoPropValue<Option<yew::Callback<FocusEvent>>>` is not implemented for `Option<{integer}>`
|
::: $WORKSPACE/packages/yew/src/html/listener/events.rs:2:1
|
2 | / impl_action! {
3 | | onabort(name: "abort", event: Event) -> web_sys::Event => |_, event| { event }
4 | | onauxclick(name: "auxclick", event: MouseEvent) -> web_sys::MouseEvent => |_, event| { event }
5 | | onblur(name: "blur", event: FocusEvent) -> web_sys::FocusEvent => |_, event| { event }
... |
99 | | ontransitionstart(name: "transitionstart", event: TransitionEvent) -> web_sys::TransitionEvent => |_, event| { event }
100 | | }
| |_- required by this bound in `yew::html::onfocus::Wrapper::__macro_new`
|
= help: the following implementations were found:
<Option<&'static str> as IntoPropValue<Option<Cow<'static, str>>>>
<Option<&'static str> as IntoPropValue<Option<String>>>
<Option<String> as IntoPropValue<Option<Cow<'static, str>>>>
error[E0308]: mismatched types
--> $DIR/element-fail.rs:56:24
|
56 | html! { <input ref=() /> };
| ^^ expected struct `yew::NodeRef`, found `()`
error[E0308]: mismatched types
--> $DIR/element-fail.rs:57:24
|
57 | html! { <input ref=Some(NodeRef::default()) /> };
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `yew::NodeRef`, found enum `Option`
|
= note: expected struct `yew::NodeRef`
found enum `Option<yew::NodeRef>`
error[E0277]: the trait bound `Cow<'static, str>: From<{integer}>` is not satisfied
--> $DIR/element-fail.rs:71:15
|
71 | 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`