diff --git a/tests/build/cases/widget_new/cannot_unset_in_when.stderr b/tests/build/cases/widget_new/cannot_unset_in_when.stderr index 20bfce33d..5f356a0b7 100644 --- a/tests/build/cases/widget_new/cannot_unset_in_when.stderr +++ b/tests/build/cases/widget_new/cannot_unset_in_when.stderr @@ -1,5 +1,5 @@ error: cannot unset in when assign - --> cases/widget_new/cannot_unset_in_when.rs:9:22 + --> cases/widget_new/cannot_unset_in_when.rs:8:22 | -9 | margin = unset!; +8 | margin = unset!; | ^^^^^ diff --git a/tests/build/cases/widget_new/error_first_token.stderr b/tests/build/cases/widget_new/error_first_token.stderr index 7133de311..46d7d8912 100644 --- a/tests/build/cases/widget_new/error_first_token.stderr +++ b/tests/build/cases/widget_new/error_first_token.stderr @@ -1,11 +1,11 @@ error: expected property or when - --> cases/widget_new/error_first_token.rs:6:9 + --> cases/widget_new/error_first_token.rs:5:9 | -6 | = +5 | = | ^ error: expected property path - --> cases/widget_new/error_first_token.rs:13:13 + --> cases/widget_new/error_first_token.rs:12:13 | -13 | = +12 | = | ^ diff --git a/tests/build/cases/widget_new/error_in_property_expr.stderr b/tests/build/cases/widget_new/error_in_property_expr.stderr index 8385f1d88..00c9b8719 100644 --- a/tests/build/cases/widget_new/error_in_property_expr.stderr +++ b/tests/build/cases/widget_new/error_in_property_expr.stderr @@ -1,5 +1,5 @@ error[E0433]: failed to resolve: use of undeclared crate or module `unknown` - --> cases/widget_new/error_in_property_expr.rs:8:21 + --> cases/widget_new/error_in_property_expr.rs:7:21 | -8 | let _ = unknown::path(); +7 | let _ = unknown::path(); | ^^^^^^^ use of undeclared crate or module `unknown` diff --git a/tests/build/cases/widget_new/error_in_when_expr1.stderr b/tests/build/cases/widget_new/error_in_when_expr1.stderr index 857fb5b9b..2ee881ebb 100644 --- a/tests/build/cases/widget_new/error_in_when_expr1.stderr +++ b/tests/build/cases/widget_new/error_in_when_expr1.stderr @@ -1,7 +1,7 @@ error[E0308]: mismatched types - --> cases/widget_new/error_in_when_expr1.rs:9:26 + --> cases/widget_new/error_in_when_expr1.rs:8:26 | -9 | let a: u32 = true; +8 | let a: u32 = true; | --- ^^^^ expected `u32`, found `bool` | | | expected due to this diff --git a/tests/build/cases/widget_new/error_in_when_expr2.stderr b/tests/build/cases/widget_new/error_in_when_expr2.stderr index 038de203a..e8063a904 100644 --- a/tests/build/cases/widget_new/error_in_when_expr2.stderr +++ b/tests/build/cases/widget_new/error_in_when_expr2.stderr @@ -1,5 +1,5 @@ error: expected a when block expr and properties - --> cases/widget_new/error_in_when_expr2.rs:10:9 - | -10 | } - | ^ + --> cases/widget_new/error_in_when_expr2.rs:9:9 + | +9 | } + | ^ diff --git a/tests/build/cases/widget_new/error_in_when_expr3.stderr b/tests/build/cases/widget_new/error_in_when_expr3.stderr index 4a7bf8f02..1161860ef 100644 --- a/tests/build/cases/widget_new/error_in_when_expr3.stderr +++ b/tests/build/cases/widget_new/error_in_when_expr3.stderr @@ -1,5 +1,5 @@ error: expected identifier or index - --> cases/widget_new/error_in_when_expr3.rs:8:23 + --> cases/widget_new/error_in_when_expr3.rs:7:23 | -8 | when *#margin.0. { +7 | when *#margin.0. { | ^^ diff --git a/tests/build/cases/widget_new/incorrect_arg_type1.stderr b/tests/build/cases/widget_new/incorrect_arg_type1.stderr index cbe9f8973..06ac3c98a 100644 --- a/tests/build/cases/widget_new/incorrect_arg_type1.stderr +++ b/tests/build/cases/widget_new/incorrect_arg_type1.stderr @@ -1,17 +1,15 @@ error[E0277]: the trait bound `bool: IntoVar` is not satisfied - --> cases/widget_new/incorrect_arg_type1.rs:6:13 + --> cases/widget_new/incorrect_arg_type1.rs:6:18 | -6 | let _ = Wgt! { - | _____________^ -7 | | margin = true - | | ------ required by a bound introduced by this call -8 | | }; - | |_____^ the trait `IntoVar` is not implemented for `bool` +6 | margin = true + | ------ ^^^^ the trait `IntoVar` is not implemented for `bool` + | | + | required by a bound introduced by this call | = help: the following other types implement trait `IntoVar`: -note: required by a bound in `margin::__new__` +note: required by a bound in `zero_ui::properties::margin::margin` --> $WORKSPACE/zero-ui/src/properties/layout.rs | | pub fn margin(child: impl UiNode, margin: impl IntoVar) -> impl UiNode { - | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `margin::__new__` + | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `margin::margin` diff --git a/tests/build/cases/widget_new/incorrect_arg_type2.stderr b/tests/build/cases/widget_new/incorrect_arg_type2.stderr index bf666b05e..d254bcce3 100644 --- a/tests/build/cases/widget_new/incorrect_arg_type2.stderr +++ b/tests/build/cases/widget_new/incorrect_arg_type2.stderr @@ -1,19 +1,15 @@ -error[E0277]: the trait bound `bool: IntoVar` is not satisfied - --> cases/widget_new/incorrect_arg_type2.rs:11:13 +error[E0277]: the trait bound `bool: zero_ui::prelude::IntoVar` is not satisfied + --> cases/widget_new/incorrect_arg_type2.rs:11:23 | -11 | let _ = Wgt! { - | _____________^ -12 | | simple_type = true - | | ----------- required by a bound introduced by this call -13 | | }; - | |_____^ the trait `IntoVar` is not implemented for `bool` +11 | simple_type = true + | ----------- ^^^^ the trait `zero_ui::prelude::IntoVar` is not implemented for `bool` + | | + | required by a bound introduced by this call | - = help: the following other types implement trait `IntoVar`: + = help: the following other types implement trait `zero_ui::prelude::IntoVar`: -note: required by a bound in `simple_type::__new__` - --> cases/widget_new/incorrect_arg_type2.rs:5:53 +note: required by a bound in `simple_type::simple_type` + --> cases/widget_new/incorrect_arg_type2.rs:4:53 | -4 | #[property(CONTEXT)] - | -------------------- required by a bound in this -5 | pub fn simple_type(child: impl UiNode, simple: impl IntoVar) -> impl UiNode { - | ^^^^^^^^^^^^ required by this bound in `simple_type::__new__` +4 | pub fn simple_type(child: impl UiNode, simple: impl IntoVar) -> impl UiNode { + | ^^^^^^^^^^^^ required by this bound in `simple_type::simple_type` diff --git a/tests/build/cases/widget_new/incorrect_arg_type3.stderr b/tests/build/cases/widget_new/incorrect_arg_type3.stderr index 4b59095c8..c065f8cc8 100644 --- a/tests/build/cases/widget_new/incorrect_arg_type3.stderr +++ b/tests/build/cases/widget_new/incorrect_arg_type3.stderr @@ -1,17 +1,15 @@ error[E0277]: the trait bound `bool: IntoVar` is not satisfied - --> cases/widget_new/incorrect_arg_type3.rs:7:13 + --> cases/widget_new/incorrect_arg_type3.rs:6:40 | -7 | let _ = Wgt! { - | _____________^ -8 | | background_gradient = 0.deg(), true - | | ------------------- required by a bound introduced by this call -9 | | }; - | |_____^ the trait `IntoVar` is not implemented for `bool` +6 | background_gradient = 0.deg(), true + | ------------------- ^^^^ the trait `IntoVar` is not implemented for `bool` + | | + | required by a bound introduced by this call | = help: the following other types implement trait `IntoVar`: -note: required by a bound in `background_gradient::__new__` +note: required by a bound in `zero_ui::properties::background_gradient::background_gradient` --> $WORKSPACE/zero-ui/src/properties/visual.rs | | pub fn background_gradient(child: impl UiNode, axis: impl IntoVar, stops: impl IntoVar) -> impl UiNode { - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `background_gradient::__new__` + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `background_gradient::background_gradient` diff --git a/tests/build/cases/widget_new/incorrect_arg_type4.stderr b/tests/build/cases/widget_new/incorrect_arg_type4.stderr index 5a989f71b..35d5f2a53 100644 --- a/tests/build/cases/widget_new/incorrect_arg_type4.stderr +++ b/tests/build/cases/widget_new/incorrect_arg_type4.stderr @@ -1,21 +1,15 @@ error[E0277]: the trait bound `bool: IntoVar` is not satisfied - --> cases/widget_new/incorrect_arg_type4.rs:7:13 - | -7 | let _ = Wgt! { - | ______________^ -8 | | // only background_gradient gets highlighted here because generics.. -9 | |/ background_gradient = { -10 | || axis: 0.deg(), -11 | || stops: true - | ||_________________- required by a bound introduced by this call -12 | | } -13 | | }; - | |______^ the trait `IntoVar` is not implemented for `bool` - | - = help: the following other types implement trait `IntoVar`: + --> cases/widget_new/incorrect_arg_type4.rs:9:20 + | +9 | stops: true + | ----- ^^^^ the trait `IntoVar` is not implemented for `bool` + | | + | required by a bound introduced by this call + | + = help: the following other types implement trait `IntoVar`: -note: required by a bound in `background_gradient::stops` - --> $WORKSPACE/zero-ui/src/properties/visual.rs - | - | pub fn background_gradient(child: impl UiNode, axis: impl IntoVar, stops: impl IntoVar) -> impl UiNode { - | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `background_gradient::stops` +note: required by a bound in `background_gradient_inputs__::stops` + --> $WORKSPACE/zero-ui/src/properties/visual.rs + | + | pub fn background_gradient(child: impl UiNode, axis: impl IntoVar, stops: impl IntoVar) -> impl UiNode { + | ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `background_gradient_inputs__::stops` diff --git a/tests/build/cases/widget_new/incorrect_arg_type5.stderr b/tests/build/cases/widget_new/incorrect_arg_type5.stderr index 111c2a2ac..0123089b0 100644 --- a/tests/build/cases/widget_new/incorrect_arg_type5.stderr +++ b/tests/build/cases/widget_new/incorrect_arg_type5.stderr @@ -1,19 +1,15 @@ -error[E0277]: the trait bound `bool: IntoVar` is not satisfied - --> cases/widget_new/incorrect_arg_type5.rs:11:13 +error[E0277]: the trait bound `bool: zero_ui::prelude::IntoVar` is not satisfied + --> cases/widget_new/incorrect_arg_type5.rs:11:27 | -11 | let _ = Wgt! { - | _____________^ -12 | | simple_type = 42, true - | | ----------- required by a bound introduced by this call -13 | | }; - | |_____^ the trait `IntoVar` is not implemented for `bool` +11 | simple_type = 42, true + | ----------- ^^^^ the trait `zero_ui::prelude::IntoVar` is not implemented for `bool` + | | + | required by a bound introduced by this call | - = help: the following other types implement trait `IntoVar`: + = help: the following other types implement trait `zero_ui::prelude::IntoVar`: -note: required by a bound in `simple_type::__new__` - --> cases/widget_new/incorrect_arg_type5.rs:5:84 +note: required by a bound in `simple_type::simple_type` + --> cases/widget_new/incorrect_arg_type5.rs:4:84 | -4 | #[property(CONTEXT)] - | -------------------- required by a bound in this -5 | pub fn simple_type(child: impl UiNode, simple_a: impl IntoVar, simple_b: impl IntoVar) -> impl UiNode { - | ^^^^^^^^^^^^ required by this bound in `simple_type::__new__` +4 | pub fn simple_type(child: impl UiNode, simple_a: impl IntoVar, simple_b: impl IntoVar) -> impl UiNode { + | ^^^^^^^^^^^^ required by this bound in `simple_type::simple_type` diff --git a/tests/build/cases/widget_new/incorrect_arg_type6.stderr b/tests/build/cases/widget_new/incorrect_arg_type6.stderr index 1c9ecf895..0636a5358 100644 --- a/tests/build/cases/widget_new/incorrect_arg_type6.stderr +++ b/tests/build/cases/widget_new/incorrect_arg_type6.stderr @@ -1,20 +1,15 @@ -error[E0277]: the trait bound `bool: IntoVar` is not satisfied - --> cases/widget_new/incorrect_arg_type6.rs:11:13 +error[E0277]: the trait bound `bool: zero_ui::prelude::IntoVar` is not satisfied + --> cases/widget_new/incorrect_arg_type6.rs:13:23 | -11 | let _ = Wgt! { - | ______________^ -12 | |/ simple_type = { -13 | || simple_a: 42, -14 | || simple_b: true, - | ||____________________- required by a bound introduced by this call -15 | | } -16 | | }; - | |______^ the trait `IntoVar` is not implemented for `bool` +13 | simple_b: true, + | -------- ^^^^ the trait `zero_ui::prelude::IntoVar` is not implemented for `bool` + | | + | required by a bound introduced by this call | - = help: the following other types implement trait `IntoVar`: + = help: the following other types implement trait `zero_ui::prelude::IntoVar`: -note: required by a bound in `simple_type::simple_b` - --> cases/widget_new/incorrect_arg_type6.rs:5:84 +note: required by a bound in `simple_type_inputs__::simple_b` + --> cases/widget_new/incorrect_arg_type6.rs:4:84 | -5 | pub fn simple_type(child: impl UiNode, simple_a: impl IntoVar, simple_b: impl IntoVar) -> impl UiNode { - | ^^^^^^^^^^^^ required by this bound in `simple_type::simple_b` +4 | pub fn simple_type(child: impl UiNode, simple_a: impl IntoVar, simple_b: impl IntoVar) -> impl UiNode { + | ^^^^^^^^^^^^ required by this bound in `simple_type_inputs__::simple_b` diff --git a/tests/build/cases/widget_new/incorrect_when_expr_type1.stderr b/tests/build/cases/widget_new/incorrect_when_expr_type1.stderr index 523aecb8c..a15dadd90 100644 --- a/tests/build/cases/widget_new/incorrect_when_expr_type1.stderr +++ b/tests/build/cases/widget_new/incorrect_when_expr_type1.stderr @@ -1,5 +1,5 @@ error[E0308]: mismatched types - --> cases/widget_new/incorrect_when_expr_type1.rs:11:14 - | -11 | when *#margin { - | ^^^^^^^^ expected `bool`, found struct `SideOffsets` + --> cases/widget_new/incorrect_when_expr_type1.rs:9:14 + | +9 | when *#margin { + | ^^^^^^^^ expected `bool`, found struct `SideOffsets` diff --git a/tests/build/cases/widget_new/malformed_fields1.stderr b/tests/build/cases/widget_new/malformed_fields1.stderr index 91ca42355..daf8fa0a0 100644 --- a/tests/build/cases/widget_new/malformed_fields1.stderr +++ b/tests/build/cases/widget_new/malformed_fields1.stderr @@ -1,19 +1,5 @@ -error[E0277]: the trait bound `(): IntoVar` is not satisfied - --> cases/widget_new/malformed_fields1.rs:6:13 - | -6 | let _ = Wgt! { - | ______________^ -7 | |/ margin = { -8 | || margin: 0; - | ||__________________- required by a bound introduced by this call -9 | | }; -10 | | }; - | |______^ the trait `IntoVar` is not implemented for `()` - | - = help: the following other types implement trait `IntoVar`: - -note: required by a bound in `margin::margin` - --> $WORKSPACE/zero-ui/src/properties/layout.rs - | - | pub fn margin(child: impl UiNode, margin: impl IntoVar) -> impl UiNode { - | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `margin::margin` +error: expected one of `)`, `,`, `.`, `?`, or an operator, found `;` + --> cases/widget_new/malformed_fields1.rs:7:22 + | +7 | margin: 0; + | ^ expected one of `)`, `,`, `.`, `?`, or an operator diff --git a/tests/build/cases/widget_new/malformed_fields2.stderr b/tests/build/cases/widget_new/malformed_fields2.stderr index 8cb66c5db..c754c08bc 100644 --- a/tests/build/cases/widget_new/malformed_fields2.stderr +++ b/tests/build/cases/widget_new/malformed_fields2.stderr @@ -1,19 +1,22 @@ -error[E0277]: the trait bound `(): IntoVar` is not satisfied - --> cases/widget_new/malformed_fields2.rs:6:13 +error[E0061]: this method takes 1 argument but 0 arguments were supplied + --> cases/widget_new/malformed_fields2.rs:7:13 + | +5 | let _ = Wgt! { + | _____________- +6 | | margin = { +7 | | margin: + | | ^^^^^^ +8 | | }; +9 | | }; + | |_____- an argument is missing + | +note: associated function defined here + --> $WORKSPACE/zero-ui/src/properties/layout.rs + | + | pub fn margin(child: impl UiNode, margin: impl IntoVar) -> impl UiNode { + | ^^^^^^ +help: provide the argument + --> $WORKSPACE/zero-ui/src/widgets.rs | -6 | let _ = Wgt! { - | ______________^ -7 | |/ margin = { -8 | || margin: - | ||__________________- required by a bound introduced by this call -9 | | }; -10 | | }; - | |______^ the trait `IntoVar` is not implemented for `()` + | margin(/* margin */) | - = help: the following other types implement trait `IntoVar`: - -note: required by a bound in `margin::margin` - --> $WORKSPACE/zero-ui/src/properties/layout.rs - | - | pub fn margin(child: impl UiNode, margin: impl IntoVar) -> impl UiNode { - | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `margin::margin` diff --git a/tests/build/cases/widget_new/malformed_property_attribute.stderr b/tests/build/cases/widget_new/malformed_property_attribute.stderr index 96dc8bbd4..c188d58c6 100644 --- a/tests/build/cases/widget_new/malformed_property_attribute.stderr +++ b/tests/build/cases/widget_new/malformed_property_attribute.stderr @@ -1,24 +1,11 @@ -error: macro expansion ignores token `compile_error` and any following - --> cases/widget_new/malformed_property_attribute.rs:7:11 - | -5 | let _w = Button! { - | ______________- -6 | | #![allow(inner_attribute)] -7 | | #[!foo] - | | ^ -8 | | margin = 10; -9 | | }; - | |_____- caused by the macro expansion here - | - = note: the usage of `zero_ui::core::widget_new!` is likely invalid in expression context -help: you might be missing a semicolon here - --> $WORKSPACE/zero-ui/src/widgets/button.rs - | - | #[widget($crate::widgets::Button)]; - | + - error: expected square brackets --> cases/widget_new/malformed_property_attribute.rs:6:10 | 6 | #![allow(inner_attribute)] | ^ + +error: expected identifier + --> cases/widget_new/malformed_property_attribute.rs:7:11 + | +7 | #[!foo] + | ^ diff --git a/tests/build/cases/widget_new/malformed_property_path1.stderr b/tests/build/cases/widget_new/malformed_property_path1.stderr index cbd1df7a5..b6bcc3afa 100644 --- a/tests/build/cases/widget_new/malformed_property_path1.stderr +++ b/tests/build/cases/widget_new/malformed_property_path1.stderr @@ -1,4 +1,4 @@ -error: expected property or when +error: expected identifier, found keyword `_` --> cases/widget_new/malformed_property_path1.rs:6:9 | 6 | _ = 0; diff --git a/tests/build/cases/widget_new/malformed_property_path2.stderr b/tests/build/cases/widget_new/malformed_property_path2.stderr index 3d1fd7450..49ea650c2 100644 --- a/tests/build/cases/widget_new/malformed_property_path2.stderr +++ b/tests/build/cases/widget_new/malformed_property_path2.stderr @@ -3,11 +3,3 @@ error: expected `=` | 6 | margin! = 0; | ^ - -warning: unused import: `properties::margin` - --> cases/widget_new/malformed_property_path2.rs:1:15 - | -1 | use zero_ui::{properties::margin, widgets::wgt}; - | ^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(unused_imports)]` on by default diff --git a/tests/build/cases/widget_new/malformed_property_path3.stderr b/tests/build/cases/widget_new/malformed_property_path3.stderr index 41cc14a0f..f2d2a10b0 100644 --- a/tests/build/cases/widget_new/malformed_property_path3.stderr +++ b/tests/build/cases/widget_new/malformed_property_path3.stderr @@ -4,13 +4,8 @@ error: expected `;` 6 | zero_ui::properties:margin = 0; | ^ -error[E0433]: failed to resolve: use of undeclared crate or module `margin` - --> cases/widget_new/malformed_property_path3.rs:6:29 +error: missing value + --> cases/widget_new/malformed_property_path3.rs:6:18 | 6 | zero_ui::properties:margin = 0; - | ^^^^^^ use of undeclared crate or module `margin` - | -help: consider importing this struct - | -1 | use zero_ui::prelude::margin; - | + | ^^^^^^^^^^ diff --git a/tests/build/cases/widget_new/missing_arg1.stderr b/tests/build/cases/widget_new/missing_arg1.stderr index cd45e65ef..6836ef036 100644 --- a/tests/build/cases/widget_new/missing_arg1.stderr +++ b/tests/build/cases/widget_new/missing_arg1.stderr @@ -1,19 +1,21 @@ -error[E0061]: this function takes 2 arguments but 1 argument was supplied - --> cases/widget_new/missing_arg1.rs:8:9 +error[E0061]: this method takes 2 arguments but 1 argument was supplied + --> cases/widget_new/missing_arg1.rs:6:9 | -8 | background_gradient = 0.deg(), ; - | ^^^^^^^^^^^^^^^^^^^ an argument is missing +5 | let _ = Wgt! { + | _____________- +6 | | background_gradient = 0.deg(), ; + | | ^^^^^^^^^^^^^^^^^^^ +7 | | margin = 0; +8 | | }; + | |_____- an argument is missing | note: associated function defined here --> $WORKSPACE/zero-ui/src/properties/visual.rs | - | / #[property(FILL, default(0.deg(), { - | | let c = colors::BLACK.transparent(); - | | crate::core::gradient::stops![c, c] - | | }))] - | |____^ - = note: this error originates in the attribute macro `property` (in Nightly builds, run with -Z macro-backtrace for more info) + | pub fn background_gradient(child: impl UiNode, axis: impl IntoVar, stops: impl IntoVar) -> impl UiNode { + | ^^^^^^^^^^^^^^^^^^^ help: provide the argument + --> |$WORKSPACE/zero-ui/src/widgets.rs + | + | background_gradient(0.deg(), /* stops */) | -8 | background_gradient(#[crate::core::widget($crate::widgets::wgt)], /* stops */) = 0.deg(), ; - | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tests/build/cases/widget_new/missing_field_all_multi.stderr b/tests/build/cases/widget_new/missing_field_all_multi.stderr index dcc76355f..d1d4217ae 100644 --- a/tests/build/cases/widget_new/missing_field_all_multi.stderr +++ b/tests/build/cases/widget_new/missing_field_all_multi.stderr @@ -1,40 +1,39 @@ error[E0277]: the trait bound `(): IntoVar` is not satisfied - --> cases/widget_new/missing_field_all_multi.rs:6:13 - | -6 | let _ = Wgt! { - | _____________^ -7 | | // background_gradient has two fields -8 | | // this is interpreted as an unnamed assign `{ }` is the value -9 | | // and the second value is missing -10 | | background_gradient = { } - | | ------------------- required by a bound introduced by this call -11 | | }; - | |_____^ the trait `IntoVar` is not implemented for `()` - | - = help: the following other types implement trait `IntoVar`: + --> cases/widget_new/missing_field_all_multi.rs:9:31 + | +9 | background_gradient = { } + | ------------------- ^^^ the trait `IntoVar` is not implemented for `()` + | | + | required by a bound introduced by this call + | + = help: the following other types implement trait `IntoVar`: -note: required by a bound in `background_gradient::__new__` - --> $WORKSPACE/zero-ui/src/properties/visual.rs - | - | pub fn background_gradient(child: impl UiNode, axis: impl IntoVar, stops: impl IntoVar) -> impl UiNode { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `background_gradient::__new__` +note: required by a bound in `zero_ui::properties::background_gradient::background_gradient` + --> $WORKSPACE/zero-ui/src/properties/visual.rs + | + | pub fn background_gradient(child: impl UiNode, axis: impl IntoVar, stops: impl IntoVar) -> impl UiNode { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `background_gradient::background_gradient` -error[E0061]: this function takes 2 arguments but 1 argument was supplied - --> cases/widget_new/missing_field_all_multi.rs:10:9 +error[E0061]: this method takes 2 arguments but 1 argument was supplied + --> cases/widget_new/missing_field_all_multi.rs:9:9 | -10 | background_gradient = { } - | ^^^^^^^^^^^^^^^^^^^ an argument is missing +5 | let _ = Wgt! { + | _____________- +6 | | // background_gradient has two fields +7 | | // this is interpreted as an unnamed assign `{ }` is the value +8 | | // and the second value is missing +9 | | background_gradient = { } + | | ^^^^^^^^^^^^^^^^^^^ +10 | | }; + | |_____- an argument is missing | note: associated function defined here --> $WORKSPACE/zero-ui/src/properties/visual.rs | - | / #[property(FILL, default(0.deg(), { - | | let c = colors::BLACK.transparent(); - | | crate::core::gradient::stops![c, c] - | | }))] - | |____^ - = note: this error originates in the attribute macro `property` (in Nightly builds, run with -Z macro-backtrace for more info) + | pub fn background_gradient(child: impl UiNode, axis: impl IntoVar, stops: impl IntoVar) -> impl UiNode { + | ^^^^^^^^^^^^^^^^^^^ help: provide the argument + --> |$WORKSPACE/zero-ui/src/widgets.rs + | + | background_gradient({ }, /* stops */) | -10 | background_gradient(#[crate::core::widget($crate::widgets::wgt)], /* stops */) = { } - | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tests/build/cases/widget_new/missing_field_all_single.stderr b/tests/build/cases/widget_new/missing_field_all_single.stderr index 44f0b20b8..4dc172588 100644 --- a/tests/build/cases/widget_new/missing_field_all_single.stderr +++ b/tests/build/cases/widget_new/missing_field_all_single.stderr @@ -1,19 +1,15 @@ error[E0277]: the trait bound `(): IntoVar` is not satisfied - --> cases/widget_new/missing_field_all_single.rs:6:13 - | -6 | let _ = Wgt! { - | _____________^ -7 | | // margin has one field -8 | | // this is interpreted as an unnamed assign `{ }` is the value -9 | | margin = { } - | | ------ required by a bound introduced by this call -10 | | }; - | |_____^ the trait `IntoVar` is not implemented for `()` - | - = help: the following other types implement trait `IntoVar`: + --> cases/widget_new/missing_field_all_single.rs:8:18 + | +8 | margin = { } + | ------ ^^^ the trait `IntoVar` is not implemented for `()` + | | + | required by a bound introduced by this call + | + = help: the following other types implement trait `IntoVar`: -note: required by a bound in `margin::__new__` - --> $WORKSPACE/zero-ui/src/properties/layout.rs - | - | pub fn margin(child: impl UiNode, margin: impl IntoVar) -> impl UiNode { - | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `margin::__new__` +note: required by a bound in `zero_ui::properties::margin::margin` + --> $WORKSPACE/zero-ui/src/properties/layout.rs + | + | pub fn margin(child: impl UiNode, margin: impl IntoVar) -> impl UiNode { + | ^^^^^^^^^^^^^^^^^^^^ required by this bound in `margin::margin` diff --git a/tests/build/cases/widget_new/missing_field_multi.stderr b/tests/build/cases/widget_new/missing_field_multi.stderr index 3ee07a1ab..e3e9200cb 100644 --- a/tests/build/cases/widget_new/missing_field_multi.stderr +++ b/tests/build/cases/widget_new/missing_field_multi.stderr @@ -1,8 +1,17 @@ -error[E0061]: this function takes 2 arguments but 1 argument was supplied - --> cases/widget_new/missing_field_multi.rs:11:9 +error[E0061]: this method takes 2 arguments but 1 argument was supplied + --> cases/widget_new/missing_field_multi.rs:9:9 | -11 | background_gradient = { - | ^^^^^^^^^^^^^^^^^^^ an argument is missing +5 | let _ = Wgt! { + | _____________- +6 | | // background_gradient has two fields +7 | | // the error highlights the property +8 | | // in a struct initializer the struct name is highlighted +9 | | background_gradient = { + | | ^^^^^^^^^^^^^^^^^^^ +10 | | axis: 0.deg(), +11 | | } +12 | | }; + | |_____- an argument is missing | note: associated function defined here --> $WORKSPACE/zero-ui/src/properties/visual.rs @@ -14,6 +23,7 @@ note: associated function defined here | |____^ = note: this error originates in the attribute macro `property` (in Nightly builds, run with -Z macro-backtrace for more info) help: provide the argument + --> |$WORKSPACE/zero-ui/src/widgets.rs + | + | background_gradient(axis, /* stops */) | -11 | background_gradient(axis, /* stops */) = { - | +++++++++++++++++++ diff --git a/tests/build/cases/widget_new/missing_semi1.stderr b/tests/build/cases/widget_new/missing_semi1.stderr index f99284946..9d0544fe6 100644 --- a/tests/build/cases/widget_new/missing_semi1.stderr +++ b/tests/build/cases/widget_new/missing_semi1.stderr @@ -1,5 +1,5 @@ error: expected `;` - --> cases/widget_new/missing_semi1.rs:10:9 - | -10 | enabled = true; - | ^^^^^^^ + --> cases/widget_new/missing_semi1.rs:8:9 + | +8 | enabled = true; + | ^^^^^^^ diff --git a/tests/build/cases/widget_new/missing_semi2.stderr b/tests/build/cases/widget_new/missing_semi2.stderr index 16c5877ee..f7e7eebe2 100644 --- a/tests/build/cases/widget_new/missing_semi2.stderr +++ b/tests/build/cases/widget_new/missing_semi2.stderr @@ -1,5 +1,5 @@ error: expected `;` - --> cases/widget_new/missing_semi2.rs:11:9 - | -11 | enabled = true; - | ^^^^^^^ + --> cases/widget_new/missing_semi2.rs:9:9 + | +9 | enabled = true; + | ^^^^^^^ diff --git a/tests/build/cases/widget_new/missing_semi_before_when1.stderr b/tests/build/cases/widget_new/missing_semi_before_when1.stderr index e1ed8adef..0ba62f41f 100644 --- a/tests/build/cases/widget_new/missing_semi_before_when1.stderr +++ b/tests/build/cases/widget_new/missing_semi_before_when1.stderr @@ -1,5 +1,5 @@ error: expected `;` - --> cases/widget_new/missing_semi_before_when1.rs:8:9 + --> cases/widget_new/missing_semi_before_when1.rs:7:9 | -8 | when *#is_pressed { +7 | when *#is_pressed { | ^^^^ diff --git a/tests/build/cases/widget_new/missing_semi_in_when1.stderr b/tests/build/cases/widget_new/missing_semi_in_when1.stderr index 3fd19e33a..304d19fd8 100644 --- a/tests/build/cases/widget_new/missing_semi_in_when1.stderr +++ b/tests/build/cases/widget_new/missing_semi_in_when1.stderr @@ -1,5 +1,5 @@ error: expected `,` - --> cases/widget_new/missing_semi_in_when1.rs:12:13 + --> cases/widget_new/missing_semi_in_when1.rs:10:13 | -12 | cursor = CursorIcon::Hand; +10 | cursor = CursorIcon::Hand; | ^^^^^^ diff --git a/tests/build/cases/widget_new/missing_semi_in_when2.stderr b/tests/build/cases/widget_new/missing_semi_in_when2.stderr index cb252f294..d91a8a419 100644 --- a/tests/build/cases/widget_new/missing_semi_in_when2.stderr +++ b/tests/build/cases/widget_new/missing_semi_in_when2.stderr @@ -1,22 +1,31 @@ error: expected `,` - --> cases/widget_new/missing_semi_in_when2.rs:12:13 + --> cases/widget_new/missing_semi_in_when2.rs:10:13 | -12 | cursor = CursorIcon::Hand; +10 | cursor = CursorIcon::Hand; | ^^^^^^ -error[E0061]: this function takes 1 argument but 0 arguments were supplied - --> cases/widget_new/missing_semi_in_when2.rs:11:13 +error[E0061]: this method takes 1 argument but 0 arguments were supplied + --> cases/widget_new/missing_semi_in_when2.rs:9:13 | -11 | margin = - | ^^^^^^ an argument is missing +5 | let _ = Wgt! { + | _____________- +6 | | margin = 0; +7 | | cursor = CursorIcon::Default; +8 | | when *#is_pressed { +9 | | margin = + | | ^^^^^^ +10 | | cursor = CursorIcon::Hand; +11 | | } +12 | | }; + | |_____- an argument is missing | note: associated function defined here --> $WORKSPACE/zero-ui/src/properties/layout.rs | - | #[property(LAYOUT, default(0))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `property` (in Nightly builds, run with -Z macro-backtrace for more info) + | pub fn margin(child: impl UiNode, margin: impl IntoVar) -> impl UiNode { + | ^^^^^^ help: provide the argument + --> $WORKSPACE/zero-ui/src/widgets.rs + | + | margin(/* margin */) | -11 | margin(/* margin */) = - | ++++++++++++++ diff --git a/tests/build/cases/widget_new/missing_value1.stderr b/tests/build/cases/widget_new/missing_value1.stderr index 293feaf42..140b93ae4 100644 --- a/tests/build/cases/widget_new/missing_value1.stderr +++ b/tests/build/cases/widget_new/missing_value1.stderr @@ -1,16 +1,20 @@ -error[E0061]: this function takes 1 argument but 0 arguments were supplied - --> cases/widget_new/missing_value1.rs:7:9 +error[E0061]: this method takes 1 argument but 0 arguments were supplied + --> cases/widget_new/missing_value1.rs:6:9 | -7 | margin = ; - | ^^^^^^ an argument is missing +5 | let _ = Wgt! { + | _____________- +6 | | margin = ; + | | ^^^^^^ +7 | | }; + | |_____- an argument is missing | note: associated function defined here --> $WORKSPACE/zero-ui/src/properties/layout.rs | - | #[property(LAYOUT, default(0))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `property` (in Nightly builds, run with -Z macro-backtrace for more info) + | pub fn margin(child: impl UiNode, margin: impl IntoVar) -> impl UiNode { + | ^^^^^^ help: provide the argument + --> $WORKSPACE/zero-ui/src/widgets.rs + | + | margin(/* margin */) | -7 | margin(/* margin */) = ; - | ++++++++++++++ diff --git a/tests/build/cases/widget_new/missing_value2.stderr b/tests/build/cases/widget_new/missing_value2.stderr index 5f9d40627..f4db20a96 100644 --- a/tests/build/cases/widget_new/missing_value2.stderr +++ b/tests/build/cases/widget_new/missing_value2.stderr @@ -1,16 +1,20 @@ -error[E0061]: this function takes 1 argument but 0 arguments were supplied - --> cases/widget_new/missing_value2.rs:7:9 +error[E0061]: this method takes 1 argument but 0 arguments were supplied + --> cases/widget_new/missing_value2.rs:6:9 | -7 | margin = - | ^^^^^^ an argument is missing +5 | let _ = Wgt! { + | _____________- +6 | | margin = + | | ^^^^^^ +7 | | }; + | |_____- an argument is missing | note: associated function defined here --> $WORKSPACE/zero-ui/src/properties/layout.rs | - | #[property(LAYOUT, default(0))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `property` (in Nightly builds, run with -Z macro-backtrace for more info) + | pub fn margin(child: impl UiNode, margin: impl IntoVar) -> impl UiNode { + | ^^^^^^ help: provide the argument + --> $WORKSPACE/zero-ui/src/widgets.rs + | + | margin(/* margin */) | -7 | margin(/* margin */) = - | ++++++++++++++ diff --git a/tests/build/cases/widget_new/missing_value3.stderr b/tests/build/cases/widget_new/missing_value3.stderr index 6fdf2b0ef..715653895 100644 --- a/tests/build/cases/widget_new/missing_value3.stderr +++ b/tests/build/cases/widget_new/missing_value3.stderr @@ -1,16 +1,23 @@ -error[E0061]: this function takes 1 argument but 0 arguments were supplied - --> cases/widget_new/missing_value3.rs:8:9 - | -8 | cursor = ; - | ^^^^^^ an argument is missing - | -note: associated function defined here - --> $WORKSPACE/zero-ui/src/properties/mouse.rs - | - | #[property(CONTEXT, default(CursorIcon::Default))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `property` (in Nightly builds, run with -Z macro-backtrace for more info) -help: provide the argument +error[E0061]: this method takes 1 argument but 0 arguments were supplied + --> cases/widget_new/missing_value3.rs:7:9 + | +5 | let _ = Wgt! { + | _____________- +6 | | // we expected an error here. +7 | | cursor = ; + | | ^^^^^^ +8 | | // we expect margin to be used here. +9 | | margin = 0; +10 | | }; + | |_____- an argument is missing + | +note: associated function defined here + --> $WORKSPACE/zero-ui/src/properties/mouse.rs + | + | pub fn cursor(child: impl UiNode, cursor: impl IntoVar>) -> impl UiNode { + | ^^^^^^ +help: provide the argument + --> $WORKSPACE/zero-ui/src/widgets.rs + | + | cursor(/* cursor */) | -8 | cursor(/* cursor */) = ; - | ++++++++++++++ diff --git a/tests/build/cases/widget_new/missing_value4.stderr b/tests/build/cases/widget_new/missing_value4.stderr index 45bb7a36d..df8c8e266 100644 --- a/tests/build/cases/widget_new/missing_value4.stderr +++ b/tests/build/cases/widget_new/missing_value4.stderr @@ -1,22 +1,29 @@ error: expected `;` - --> cases/widget_new/missing_value4.rs:9:9 + --> cases/widget_new/missing_value4.rs:8:9 | -9 | margin = 0; +8 | margin = 0; | ^^^^^^ -error[E0061]: this function takes 1 argument but 0 arguments were supplied - --> cases/widget_new/missing_value4.rs:7:9 - | -7 | cursor = - | ^^^^^^ an argument is missing - | -note: associated function defined here - --> $WORKSPACE/zero-ui/src/properties/mouse.rs - | - | #[property(CONTEXT, default(CursorIcon::Default))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `property` (in Nightly builds, run with -Z macro-backtrace for more info) -help: provide the argument +error[E0061]: this method takes 1 argument but 0 arguments were supplied + --> cases/widget_new/missing_value4.rs:6:9 + | +5 | let _ = Wgt! { + | _____________- +6 | | cursor = + | | ^^^^^^ +7 | | // we expect these properties to be used. +8 | | margin = 0; +9 | | enabled = true; +10 | | }; + | |_____- an argument is missing + | +note: associated function defined here + --> $WORKSPACE/zero-ui/src/properties/mouse.rs + | + | pub fn cursor(child: impl UiNode, cursor: impl IntoVar>) -> impl UiNode { + | ^^^^^^ +help: provide the argument + --> $WORKSPACE/zero-ui/src/widgets.rs + | + | cursor(/* cursor */) | -7 | cursor(/* cursor */) = - | ++++++++++++++ diff --git a/tests/build/cases/widget_new/missing_value5.stderr b/tests/build/cases/widget_new/missing_value5.stderr index 2c02c6b95..02bd8fd49 100644 --- a/tests/build/cases/widget_new/missing_value5.stderr +++ b/tests/build/cases/widget_new/missing_value5.stderr @@ -1,25 +1,28 @@ error: expected expression, found `)` - --> cases/widget_new/missing_value5.rs:7:9 - | -7 | cursor = - | ^^^^^^ expected expression + --> cases/widget_new/missing_value5.rs:5:13 + | +5 | let _ = Wgt! { + | _____________^ +6 | | cursor = +7 | | #[allow(unused_imports)] +8 | | margin = { +... | +11 | | } +12 | | }; + | |_____^ expected expression + | + = note: this error originates in the macro `zero_ui::core::widget_new` which comes from the expansion of the macro `Wgt` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected `;` - --> cases/widget_new/missing_value5.rs:9:9 + --> cases/widget_new/missing_value5.rs:8:9 | -9 | margin = { +8 | margin = { | ^^^^^^ -warning: unused import: `cursor` - --> cases/widget_new/missing_value5.rs:1:27 +warning: unused import: `zero_ui::core::units::PxPoint` + --> cases/widget_new/missing_value5.rs:9:17 | -1 | use zero_ui::properties::{cursor, margin}; - | ^^^^^^ +9 | use zero_ui::core::units::PxPoint; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default - -warning: unused import: `zero_ui::core::units::PxPoint` - --> cases/widget_new/missing_value5.rs:10:17 - | -10 | use zero_ui::core::units::PxPoint; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/build/cases/widget_new/missing_value6.stderr b/tests/build/cases/widget_new/missing_value6.stderr index 1b3bf4503..481ea525a 100644 --- a/tests/build/cases/widget_new/missing_value6.stderr +++ b/tests/build/cases/widget_new/missing_value6.stderr @@ -1,25 +1,27 @@ error: expected `;` - --> cases/widget_new/missing_value6.rs:9:9 + --> cases/widget_new/missing_value6.rs:7:9 | -9 | margin = 0; +7 | margin = 0; | ^^^^^^ -error[E0061]: this function takes 2 arguments but 1 argument was supplied - --> cases/widget_new/missing_value6.rs:8:9 +error[E0061]: this method takes 2 arguments but 1 argument was supplied + --> cases/widget_new/missing_value6.rs:6:9 | -8 | background_gradient = 0.deg(), - | ^^^^^^^^^^^^^^^^^^^ an argument is missing +5 | let _ = Wgt! { + | _____________- +6 | | background_gradient = 0.deg(), + | | ^^^^^^^^^^^^^^^^^^^ +7 | | margin = 0; +8 | | }; + | |_____- an argument is missing | note: associated function defined here --> $WORKSPACE/zero-ui/src/properties/visual.rs | - | / #[property(FILL, default(0.deg(), { - | | let c = colors::BLACK.transparent(); - | | crate::core::gradient::stops![c, c] - | | }))] - | |____^ - = note: this error originates in the attribute macro `property` (in Nightly builds, run with -Z macro-backtrace for more info) + | pub fn background_gradient(child: impl UiNode, axis: impl IntoVar, stops: impl IntoVar) -> impl UiNode { + | ^^^^^^^^^^^^^^^^^^^ help: provide the argument + --> |$WORKSPACE/zero-ui/src/widgets.rs + | + | background_gradient(0.deg(), /* stops */) | -8 | background_gradient(#[crate::core::widget($crate::widgets::wgt)], /* stops */) = 0.deg(), - | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/tests/build/cases/widget_new/missing_value_before_when1.stderr b/tests/build/cases/widget_new/missing_value_before_when1.stderr index f109b3b2d..7e1556e52 100644 --- a/tests/build/cases/widget_new/missing_value_before_when1.stderr +++ b/tests/build/cases/widget_new/missing_value_before_when1.stderr @@ -1,22 +1,29 @@ error: expected `;` - --> cases/widget_new/missing_value_before_when1.rs:8:9 - | -8 | when *#is_pressed { - | ^^^^ - -error[E0061]: this function takes 1 argument but 0 arguments were supplied --> cases/widget_new/missing_value_before_when1.rs:7:9 | -7 | margin = // missing 0; here - | ^^^^^^ an argument is missing - | -note: associated function defined here - --> $WORKSPACE/zero-ui/src/properties/layout.rs - | - | #[property(LAYOUT, default(0))] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - = note: this error originates in the attribute macro `property` (in Nightly builds, run with -Z macro-backtrace for more info) -help: provide the argument +7 | when *#is_pressed { + | ^^^^ + +error[E0061]: this method takes 1 argument but 0 arguments were supplied + --> cases/widget_new/missing_value_before_when1.rs:6:9 + | +5 | let _ = Wgt! { + | _____________- +6 | | margin = // missing 0; here + | | ^^^^^^ +7 | | when *#is_pressed { +8 | | margin = 20; +9 | | } +10 | | }; + | |_____- an argument is missing + | +note: associated function defined here + --> $WORKSPACE/zero-ui/src/properties/layout.rs + | + | pub fn margin(child: impl UiNode, margin: impl IntoVar) -> impl UiNode { + | ^^^^^^ +help: provide the argument + --> $WORKSPACE/zero-ui/src/widgets.rs + | + | margin(/* margin */) | -7 | margin(/* margin */) = // missing 0; here - | ++++++++++++++ diff --git a/tests/build/cases/widget_new/not_allowed_in_when1.stderr b/tests/build/cases/widget_new/not_allowed_in_when1.stderr index f2d2caa07..78a1dee10 100644 --- a/tests/build/cases/widget_new/not_allowed_in_when1.stderr +++ b/tests/build/cases/widget_new/not_allowed_in_when1.stderr @@ -1,22 +1,17 @@ -warning: unused variable: `node` - --> cases/widget_new/not_allowed_in_when1.rs:16:17 +error[E0599]: no method named `allowed_in_when_expr` found for struct `foo_meta__` in the current scope + --> cases/widget_new/not_allowed_in_when1.rs:11:13 | -16 | let node = #foo; - | ^^^^ help: if this is intentional, prefix it with an underscore: `_node` - | - = note: `#[warn(unused_variables)]` on by default - -error[E0080]: evaluation of constant value failed - --> cases/widget_new/not_allowed_in_when1.rs:13:13 - | -13 | let _ = Wgt! { +3 | #[property(CONTEXT)] + | -------------------- method `allowed_in_when_expr` not found for this struct +... +11 | let _ = Wgt! { | _____________^ -14 | | margin = 0; -15 | | when { -16 | | let node = #foo; +12 | | margin = 0; +13 | | when { +14 | | let node = #foo; ... | -20 | | } -21 | | }; - | |_____^ the evaluated program panicked at 'property `foo` cannot be read in when expr', $DIR/cases/widget_new/not_allowed_in_when1.rs:13:13 +18 | | } +19 | | }; + | |_____^ help: there is a method with a similar name: `allowed_in_when_assign` | - = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `wgt` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `zero_ui::core::widget_new` which comes from the expansion of the macro `Wgt` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/build/cases/widget_new/not_allowed_in_when2.stderr b/tests/build/cases/widget_new/not_allowed_in_when2.stderr index 35dc62fec..5d427555d 100644 --- a/tests/build/cases/widget_new/not_allowed_in_when2.stderr +++ b/tests/build/cases/widget_new/not_allowed_in_when2.stderr @@ -1,7 +1,17 @@ -error[E0080]: evaluation of constant value failed - --> cases/widget_new/not_allowed_in_when2.rs:19:13 +error[E0599]: no method named `allowed_in_when_assign` found for struct `foo_meta__` in the current scope + --> cases/widget_new/not_allowed_in_when2.rs:13:13 | -19 | foo = true; - | ^^^ the evaluated program panicked at 'property `foo` cannot be assigned in when', $DIR/cases/widget_new/not_allowed_in_when2.rs:19:13 +5 | #[property(CONTEXT)] + | -------------------- method `allowed_in_when_assign` not found for this struct +... +13 | let _ = Wgt! { + | _____________^ +14 | | foo = false; +15 | | margin = 0; +16 | | +... | +20 | | } +21 | | }; + | |_____^ help: there is a method with a similar name: `allowed_in_when_expr` | - = note: this error originates in the macro `$crate::panic::panic_2021` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `zero_ui::core::widget_new` which comes from the expansion of the macro `Wgt` (in Nightly builds, run with -Z macro-backtrace for more info) diff --git a/tests/build/cases/widget_new/property_generic1.stderr b/tests/build/cases/widget_new/property_generic1.stderr index 1fbbadd9b..2cfd8c65a 100644 --- a/tests/build/cases/widget_new/property_generic1.stderr +++ b/tests/build/cases/widget_new/property_generic1.stderr @@ -2,15 +2,11 @@ error[E0283]: type annotations needed --> cases/widget_new/property_generic1.rs:7:9 | 7 | value = 0; - | ^^^^^ cannot infer type of the type parameter `T` declared on the struct `value` + | ^^^^^ cannot infer type for type parameter `T` declared on the associated function `value` | = note: cannot satisfy `_: VarValue` -note: required by a bound in `zero_ui::widgets::toggle::value::::__new__` - --> $WORKSPACE/zero-ui/src/widgets/toggle_wgt.rs +note: required by a bound in `zero_ui::widgets::Toggle::value` + --> $WORKSPACE/zero-ui/src/widgets/toggle.rs | - | pub fn value(child: impl UiNode, value: impl IntoVar) -> impl UiNode { - | ^^^^^^^^ required by this bound in `value::::__new__` -help: consider specifying the generic argument - | -7 | value:: = 0; - | +++++ + | pub fn value(child: impl UiNode, value: impl IntoVar) -> impl UiNode { + | ^^^^^^^^ required by this bound in `Toggle::value` diff --git a/tests/build/cases/widget_new/property_generic2.stderr b/tests/build/cases/widget_new/property_generic2.stderr index feef768ed..4dc8d02d2 100644 --- a/tests/build/cases/widget_new/property_generic2.stderr +++ b/tests/build/cases/widget_new/property_generic2.stderr @@ -1,15 +1,15 @@ error[E0277]: the trait bound `{integer}: IntoVar` is not satisfied - --> cases/widget_new/property_generic2.rs:7:23 + --> cases/widget_new/property_generic2.rs:7:25 | 7 | value:: = 0; - | ----- ^ the trait `IntoVar` is not implemented for `{integer}` + | ----- ^ the trait `IntoVar` is not implemented for `{integer}` | | | required by a bound introduced by this call | = help: the following other types implement trait `IntoVar`: -note: required by a bound in `zero_ui::widgets::toggle::value::::__new__` - --> $WORKSPACE/zero-ui/src/widgets/toggle_wgt.rs +note: required by a bound in `zero_ui::widgets::Toggle::value` + --> $WORKSPACE/zero-ui/src/widgets/toggle.rs | - | pub fn value(child: impl UiNode, value: impl IntoVar) -> impl UiNode { - | ^^^^^^^^^^ required by this bound in `value::::__new__` + | pub fn value(child: impl UiNode, value: impl IntoVar) -> impl UiNode { + | ^^^^^^^^^^ required by this bound in `Toggle::value` diff --git a/tests/build/cases/widget_new/unknown_field.stderr b/tests/build/cases/widget_new/unknown_field.stderr index e85dd6751..dd061fd62 100644 --- a/tests/build/cases/widget_new/unknown_field.stderr +++ b/tests/build/cases/widget_new/unknown_field.stderr @@ -1,5 +1,5 @@ -error[E0599]: no function or associated item named `unknown` found for struct `margin` in the current scope - --> cases/widget_new/unknown_field.rs:8:13 +error[E0599]: no method named `unknown` found for struct `margin_inputs__` in the current scope + --> cases/widget_new/unknown_field.rs:7:13 | -8 | unknown: 0, - | ^^^^^^^ function or associated item not found in `margin` +7 | unknown: 0, + | ^^^^^^^ method not found in `margin_inputs__` diff --git a/tests/build/cases/widget_new/unknown_member_in_when_expr1.stderr b/tests/build/cases/widget_new/unknown_member_in_when_expr1.stderr index 976278a07..5b72d75fd 100644 --- a/tests/build/cases/widget_new/unknown_member_in_when_expr1.stderr +++ b/tests/build/cases/widget_new/unknown_member_in_when_expr1.stderr @@ -1,8 +1,5 @@ -error[E0599]: no associated item named `__w_1__` found for struct `is_pressed` in the current scope - --> cases/widget_new/unknown_member_in_when_expr1.rs:8:16 +error[E0599]: no method named `__w_1__` found for struct `is_pressed_inputs__` in the current scope + --> cases/widget_new/unknown_member_in_when_expr1.rs:7:16 | -8 | when *#is_pressed.1 { // only .0 or .state allowed. - | ^^^^^^^^^^ - | | - | associated item not found in `is_pressed` - | help: there is an associated function with a similar name: `__w_0__` +7 | when *#is_pressed.1 { // only .0 or .state allowed. + | ^^^^^^^^^^ help: there is a method with a similar name: `__w_0__` diff --git a/tests/build/cases/widget_new/unknown_member_in_when_expr2.stderr b/tests/build/cases/widget_new/unknown_member_in_when_expr2.stderr index 4f3f88a4d..479ecb4bd 100644 --- a/tests/build/cases/widget_new/unknown_member_in_when_expr2.stderr +++ b/tests/build/cases/widget_new/unknown_member_in_when_expr2.stderr @@ -1,8 +1,5 @@ -error[E0599]: no associated item named `__w_unknown__` found for struct `is_pressed` in the current scope - --> cases/widget_new/unknown_member_in_when_expr2.rs:8:16 +error[E0599]: no method named `__w_unknown__` found for struct `is_pressed_inputs__` in the current scope + --> cases/widget_new/unknown_member_in_when_expr2.rs:7:16 | -8 | when *#is_pressed.unknown { // only .0 or .state allowed. - | ^^^^^^^^^^ - | | - | associated item not found in `is_pressed` - | help: there is an associated function with a similar name: `__new__` +7 | when *#is_pressed.unknown { // only .0 or .state allowed. + | ^^^^^^^^^^ help: there is a method with a similar name: `__w_0__` diff --git a/tests/build/cases/widget_new/unknown_property1.stderr b/tests/build/cases/widget_new/unknown_property1.stderr index f851662fe..11f1c3854 100644 --- a/tests/build/cases/widget_new/unknown_property1.stderr +++ b/tests/build/cases/widget_new/unknown_property1.stderr @@ -1,5 +1,5 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `unknown` +error[E0599]: no method named `unknown` found for mutable reference `&mut Wgt` in the current scope --> cases/widget_new/unknown_property1.rs:6:9 | 6 | unknown = 0; - | ^^^^^^^ use of undeclared crate or module `unknown` + | ^^^^^^^ method not found in `&mut Wgt` diff --git a/tests/build/cases/widget_new/unknown_property2.stderr b/tests/build/cases/widget_new/unknown_property2.stderr index 9b12f0090..3f803661e 100644 --- a/tests/build/cases/widget_new/unknown_property2.stderr +++ b/tests/build/cases/widget_new/unknown_property2.stderr @@ -1,5 +1,11 @@ -error[E0433]: failed to resolve: use of undeclared crate or module `unknown` +error[E0599]: no method named `unknown_meta__` found for mutable reference `&mut Wgt` in the current scope --> cases/widget_new/unknown_property2.rs:6:9 | 6 | unknown = { - | ^^^^^^^ use of undeclared crate or module `unknown` + | ^^^^^^^ method not found in `&mut Wgt` + +error[E0599]: no method named `unknown_sorted__` found for mutable reference `&mut Wgt` in the current scope + --> cases/widget_new/unknown_property2.rs:6:9 + | +6 | unknown = { + | ^^^^^^^ help: there is a method with a similar name: `id_sorted__` diff --git a/tests/build/cases/widget_new/unknown_special_value.stderr b/tests/build/cases/widget_new/unknown_special_value.stderr index bdfdf5a9b..f01fe2e7f 100644 --- a/tests/build/cases/widget_new/unknown_special_value.stderr +++ b/tests/build/cases/widget_new/unknown_special_value.stderr @@ -1,13 +1,5 @@ error: unknown special value, expected `unset!` - --> cases/widget_new/unknown_special_value.rs:7:18 + --> cases/widget_new/unknown_special_value.rs:6:18 | -7 | margin = foo!; +6 | margin = foo!; | ^^^ - -warning: unused import: `zero_ui::properties::margin` - --> cases/widget_new/unknown_special_value.rs:1:5 - | -1 | use zero_ui::properties::margin; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(unused_imports)]` on by default diff --git a/tests/build/cases/widget_new/unknown_special_value_in_when.stderr b/tests/build/cases/widget_new/unknown_special_value_in_when.stderr index 486cbe773..abd7aaf39 100644 --- a/tests/build/cases/widget_new/unknown_special_value_in_when.stderr +++ b/tests/build/cases/widget_new/unknown_special_value_in_when.stderr @@ -1,13 +1,5 @@ error: unexpected token - --> cases/widget_new/unknown_special_value_in_when.rs:9:25 + --> cases/widget_new/unknown_special_value_in_when.rs:8:25 | -9 | margin = foo!; +8 | margin = foo!; | ^ - -warning: unused imports: `margin`, `states::is_pressed` - --> cases/widget_new/unknown_special_value_in_when.rs:1:27 - | -1 | use zero_ui::properties::{margin, states::is_pressed}; - | ^^^^^^ ^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(unused_imports)]` on by default diff --git a/tests/build/cases/widget_new/when_missing_block.stderr b/tests/build/cases/widget_new/when_missing_block.stderr index 890641d27..8582e64dd 100644 --- a/tests/build/cases/widget_new/when_missing_block.stderr +++ b/tests/build/cases/widget_new/when_missing_block.stderr @@ -1,13 +1,5 @@ error: expected a when block expr and properties - --> cases/widget_new/when_missing_block.rs:7:16 + --> cases/widget_new/when_missing_block.rs:6:16 | -7 | when *#is_pressed +6 | when *#is_pressed | ^^^^^^^^^^ - -warning: unused import: `zero_ui::properties::states::is_pressed` - --> cases/widget_new/when_missing_block.rs:1:5 - | -1 | use zero_ui::properties::states::is_pressed; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - | - = note: `#[warn(unused_imports)]` on by default diff --git a/tests/build/cases/widget_new/when_missing_expr1.stderr b/tests/build/cases/widget_new/when_missing_expr1.stderr index c70ed016f..b94af5956 100644 --- a/tests/build/cases/widget_new/when_missing_expr1.stderr +++ b/tests/build/cases/widget_new/when_missing_expr1.stderr @@ -7,4 +7,4 @@ error: expected when expression 7 | | }; | |_____^ | - = note: this error originates in the macro `wgt` (in Nightly builds, run with -Z macro-backtrace for more info) + = note: this error originates in the macro `Wgt` (in Nightly builds, run with -Z macro-backtrace for more info)