mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 14:54:16 +00:00
CI: fix unused variables breaking tests (#950)
This commit is contained in:
parent
a1144a5b6b
commit
78d6d312f8
4 changed files with 63 additions and 32 deletions
|
@ -4,16 +4,23 @@ use leptos::*;
|
|||
fn missing_scope() {}
|
||||
|
||||
#[component]
|
||||
fn missing_return_type(cx: Scope) {}
|
||||
fn missing_return_type(cx: Scope) {
|
||||
_ = cx;
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn unknown_prop_option(cx: Scope, #[prop(hello)] test: bool) -> impl IntoView {}
|
||||
fn unknown_prop_option(cx: Scope, #[prop(hello)] test: bool) -> impl IntoView {
|
||||
_ = cx;
|
||||
_ = test;
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn optional_and_optional_no_strip(
|
||||
cx: Scope,
|
||||
#[prop(optional, optional_no_strip)] conflicting: bool,
|
||||
) -> impl IntoView {
|
||||
_ = cx;
|
||||
_ = conflicting;
|
||||
}
|
||||
|
||||
#[component]
|
||||
|
@ -21,6 +28,8 @@ fn optional_and_strip_option(
|
|||
cx: Scope,
|
||||
#[prop(optional, strip_option)] conflicting: bool,
|
||||
) -> impl IntoView {
|
||||
_ = cx;
|
||||
_ = conflicting;
|
||||
}
|
||||
|
||||
#[component]
|
||||
|
@ -28,6 +37,8 @@ fn optional_no_strip_and_strip_option(
|
|||
cx: Scope,
|
||||
#[prop(optional_no_strip, strip_option)] conflicting: bool,
|
||||
) -> impl IntoView {
|
||||
_ = cx;
|
||||
_ = conflicting;
|
||||
}
|
||||
|
||||
#[component]
|
||||
|
@ -35,6 +46,8 @@ fn default_without_value(
|
|||
cx: Scope,
|
||||
#[prop(default)] default: bool,
|
||||
) -> impl IntoView {
|
||||
_ = cx;
|
||||
_ = default;
|
||||
}
|
||||
|
||||
#[component]
|
||||
|
@ -42,6 +55,8 @@ fn default_with_invalid_value(
|
|||
cx: Scope,
|
||||
#[prop(default= |)] default: bool,
|
||||
) -> impl IntoView {
|
||||
_ = cx;
|
||||
_ = default;
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -9,45 +9,45 @@ error: this method requires a `Scope` parameter
|
|||
error: return type is incorrect
|
||||
--> tests/ui/component.rs:7:1
|
||||
|
|
||||
7 | fn missing_return_type(cx: Scope) {}
|
||||
7 | fn missing_return_type(cx: Scope) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: return signature must be `-> impl IntoView`
|
||||
|
||||
error: supported fields are `optional`, `optional_no_strip`, `strip_option`, `default` and `into`
|
||||
--> tests/ui/component.rs:10:42
|
||||
--> tests/ui/component.rs:12:42
|
||||
|
|
||||
10 | fn unknown_prop_option(cx: Scope, #[prop(hello)] test: bool) -> impl IntoView {}
|
||||
12 | fn unknown_prop_option(cx: Scope, #[prop(hello)] test: bool) -> impl IntoView {
|
||||
| ^^^^^
|
||||
|
||||
error: `optional` conflicts with mutually exclusive `optional_no_strip`
|
||||
--> tests/ui/component.rs:15:12
|
||||
--> tests/ui/component.rs:20:12
|
||||
|
|
||||
15 | #[prop(optional, optional_no_strip)] conflicting: bool,
|
||||
20 | #[prop(optional, optional_no_strip)] conflicting: bool,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `optional` conflicts with mutually exclusive `strip_option`
|
||||
--> tests/ui/component.rs:22:12
|
||||
--> tests/ui/component.rs:29:12
|
||||
|
|
||||
22 | #[prop(optional, strip_option)] conflicting: bool,
|
||||
29 | #[prop(optional, strip_option)] conflicting: bool,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `optional_no_strip` conflicts with mutually exclusive `strip_option`
|
||||
--> tests/ui/component.rs:29:12
|
||||
--> tests/ui/component.rs:38:12
|
||||
|
|
||||
29 | #[prop(optional_no_strip, strip_option)] conflicting: bool,
|
||||
38 | #[prop(optional_no_strip, strip_option)] conflicting: bool,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unexpected end of input, expected assignment `=`
|
||||
--> tests/ui/component.rs:36:19
|
||||
--> tests/ui/component.rs:47:19
|
||||
|
|
||||
36 | #[prop(default)] default: bool,
|
||||
47 | #[prop(default)] default: bool,
|
||||
| ^
|
||||
|
||||
error: unexpected end of input, expected one of: `::`, `<`, `_`, literal, `const`, `ref`, `mut`, `&`, parentheses, square brackets, `..`, `const`
|
||||
|
||||
= help: try `#[prop(default=5 * 10)]`
|
||||
--> tests/ui/component.rs:43:22
|
||||
--> tests/ui/component.rs:56:22
|
||||
|
|
||||
43 | #[prop(default= |)] default: bool,
|
||||
56 | #[prop(default= |)] default: bool,
|
||||
| ^
|
||||
|
|
|
@ -2,16 +2,23 @@
|
|||
fn missing_scope() {}
|
||||
|
||||
#[::leptos::component]
|
||||
fn missing_return_type(cx: ::leptos::Scope) {}
|
||||
fn missing_return_type(cx: ::leptos::Scope) {
|
||||
_ = cx;
|
||||
}
|
||||
|
||||
#[::leptos::component]
|
||||
fn unknown_prop_option(cx: ::leptos::Scope, #[prop(hello)] test: bool) -> impl ::leptos::IntoView {}
|
||||
fn unknown_prop_option(cx: ::leptos::Scope, #[prop(hello)] test: bool) -> impl ::leptos::IntoView {
|
||||
_ = cx;
|
||||
_ = test;
|
||||
}
|
||||
|
||||
#[::leptos::component]
|
||||
fn optional_and_optional_no_strip(
|
||||
cx: Scope,
|
||||
#[prop(optional, optional_no_strip)] conflicting: bool,
|
||||
) -> impl IntoView {
|
||||
_ = cx;
|
||||
_ = conflicting;
|
||||
}
|
||||
|
||||
#[::leptos::component]
|
||||
|
@ -19,6 +26,8 @@ fn optional_and_strip_option(
|
|||
cx: ::leptos::Scope,
|
||||
#[prop(optional, strip_option)] conflicting: bool,
|
||||
) -> impl ::leptos::IntoView {
|
||||
_ = cx;
|
||||
_ = conflicting;
|
||||
}
|
||||
|
||||
#[::leptos::component]
|
||||
|
@ -26,6 +35,8 @@ fn optional_no_strip_and_strip_option(
|
|||
cx: ::leptos::Scope,
|
||||
#[prop(optional_no_strip, strip_option)] conflicting: bool,
|
||||
) -> impl ::leptos::IntoView {
|
||||
_ = cx;
|
||||
_ = conflicting;
|
||||
}
|
||||
|
||||
#[::leptos::component]
|
||||
|
@ -33,6 +44,8 @@ fn default_without_value(
|
|||
cx: ::leptos::Scope,
|
||||
#[prop(default)] default: bool,
|
||||
) -> impl ::leptos::IntoView {
|
||||
_ = cx;
|
||||
_ = default;
|
||||
}
|
||||
|
||||
#[::leptos::component]
|
||||
|
@ -40,10 +53,13 @@ fn default_with_invalid_value(
|
|||
cx: ::leptos::Scope,
|
||||
#[prop(default= |)] default: bool,
|
||||
) -> impl ::leptos::IntoView {
|
||||
_ = cx;
|
||||
_ = default;
|
||||
}
|
||||
|
||||
#[::leptos::component]
|
||||
pub fn using_the_view_macro(cx: ::leptos::Scope) -> impl ::leptos::IntoView {
|
||||
_ = cx;
|
||||
::leptos::view! { cx,
|
||||
"ok"
|
||||
}
|
||||
|
|
|
@ -9,45 +9,45 @@ error: this method requires a `Scope` parameter
|
|||
error: return type is incorrect
|
||||
--> tests/ui/component_absolute.rs:5:1
|
||||
|
|
||||
5 | fn missing_return_type(cx: ::leptos::Scope) {}
|
||||
5 | fn missing_return_type(cx: ::leptos::Scope) {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: return signature must be `-> impl IntoView`
|
||||
|
||||
error: supported fields are `optional`, `optional_no_strip`, `strip_option`, `default` and `into`
|
||||
--> tests/ui/component_absolute.rs:8:52
|
||||
|
|
||||
8 | fn unknown_prop_option(cx: ::leptos::Scope, #[prop(hello)] test: bool) -> impl ::leptos::IntoView {}
|
||||
| ^^^^^
|
||||
--> tests/ui/component_absolute.rs:10:52
|
||||
|
|
||||
10 | fn unknown_prop_option(cx: ::leptos::Scope, #[prop(hello)] test: bool) -> impl ::leptos::IntoView {
|
||||
| ^^^^^
|
||||
|
||||
error: `optional` conflicts with mutually exclusive `optional_no_strip`
|
||||
--> tests/ui/component_absolute.rs:13:12
|
||||
--> tests/ui/component_absolute.rs:18:12
|
||||
|
|
||||
13 | #[prop(optional, optional_no_strip)] conflicting: bool,
|
||||
18 | #[prop(optional, optional_no_strip)] conflicting: bool,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `optional` conflicts with mutually exclusive `strip_option`
|
||||
--> tests/ui/component_absolute.rs:20:12
|
||||
--> tests/ui/component_absolute.rs:27:12
|
||||
|
|
||||
20 | #[prop(optional, strip_option)] conflicting: bool,
|
||||
27 | #[prop(optional, strip_option)] conflicting: bool,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: `optional_no_strip` conflicts with mutually exclusive `strip_option`
|
||||
--> tests/ui/component_absolute.rs:27:12
|
||||
--> tests/ui/component_absolute.rs:36:12
|
||||
|
|
||||
27 | #[prop(optional_no_strip, strip_option)] conflicting: bool,
|
||||
36 | #[prop(optional_no_strip, strip_option)] conflicting: bool,
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: unexpected end of input, expected assignment `=`
|
||||
--> tests/ui/component_absolute.rs:34:19
|
||||
--> tests/ui/component_absolute.rs:45:19
|
||||
|
|
||||
34 | #[prop(default)] default: bool,
|
||||
45 | #[prop(default)] default: bool,
|
||||
| ^
|
||||
|
||||
error: unexpected end of input, expected one of: `::`, `<`, `_`, literal, `const`, `ref`, `mut`, `&`, parentheses, square brackets, `..`, `const`
|
||||
|
||||
= help: try `#[prop(default=5 * 10)]`
|
||||
--> tests/ui/component_absolute.rs:41:22
|
||||
--> tests/ui/component_absolute.rs:54:22
|
||||
|
|
||||
41 | #[prop(default= |)] default: bool,
|
||||
54 | #[prop(default= |)] default: bool,
|
||||
| ^
|
||||
|
|
Loading…
Reference in a new issue