-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix generic props structs #2746
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -279,6 +279,17 @@ error[E0425]: cannot find value `props` in this scope | |
69 | html! { <Child value=1 ..props /> }; | ||
| ^^^^^ not found in this scope | ||
|
||
error[E0308]: mismatched types | ||
--> tests/html_macro/component-fail.rs:53:22 | ||
| | ||
53 | html! { <Child ..p1 ..p2 /> }; | ||
| ----- ^^^^^^^ expected struct `ChildProperties`, found struct `std::ops::Range` | ||
| | | ||
| expected due to this | ||
| | ||
= note: expected struct `ChildProperties` | ||
found struct `std::ops::Range<_>` | ||
|
||
error[E0609]: no field `value` on type `ChildProperties` | ||
--> tests/html_macro/component-fail.rs:69:20 | ||
| | ||
|
@@ -295,43 +306,6 @@ error[E0609]: no field `r#type` on type `ChildProperties` | |
| | ||
= note: available fields are: `string`, `int` | ||
|
||
error[E0609]: no field `unknown` on type `ChildProperties` | ||
--> tests/html_macro/component-fail.rs:74:20 | ||
| | ||
74 | html! { <Child unknown="unknown" /> }; | ||
| ^^^^^^^ unknown field | ||
| | ||
= note: available fields are: `string`, `int` | ||
|
||
error[E0609]: no field `children` on type `ChildProperties` | ||
--> tests/html_macro/component-fail.rs:87:14 | ||
| | ||
87 | html! { <Child>{ "Not allowed" }</Child> }; | ||
| ^^^^^ unknown field | ||
| | ||
= note: available fields are: `string`, `int` | ||
= note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0609]: no field `children` on type `ChildProperties` | ||
--> tests/html_macro/component-fail.rs:94:10 | ||
| | ||
94 | <Child ..ChildProperties { string: "hello".to_owned(), int: 5 }> | ||
| ^^^^^ unknown field | ||
| | ||
= note: available fields are: `string`, `int` | ||
= note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0308]: mismatched types | ||
--> tests/html_macro/component-fail.rs:53:22 | ||
| | ||
53 | html! { <Child ..p1 ..p2 /> }; | ||
| ----- ^^^^^^^ expected struct `ChildProperties`, found struct `std::ops::Range` | ||
| | | ||
| expected due to this | ||
| | ||
= note: expected struct `ChildProperties` | ||
found struct `std::ops::Range<_>` | ||
|
||
error[E0599]: no method named `r#type` found for struct `ChildPropertiesBuilder` in the current scope | ||
--> tests/html_macro/component-fail.rs:71:20 | ||
| | ||
|
@@ -341,6 +315,14 @@ error[E0599]: no method named `r#type` found for struct `ChildPropertiesBuilder` | |
71 | html! { <Child type=0 /> }; | ||
| ^^^^ method not found in `ChildPropertiesBuilder` | ||
|
||
error[E0609]: no field `unknown` on type `ChildProperties` | ||
--> tests/html_macro/component-fail.rs:74:20 | ||
| | ||
74 | html! { <Child unknown="unknown" /> }; | ||
| ^^^^^^^ unknown field | ||
| | ||
= note: available fields are: `string`, `int` | ||
|
||
error[E0599]: no method named `unknown` found for struct `ChildPropertiesBuilder` in the current scope | ||
--> tests/html_macro/component-fail.rs:74:20 | ||
| | ||
|
@@ -408,6 +390,15 @@ note: required because of the requirements on the impl of `HasAllProps<ChildProp | |
= note: required because of the requirements on the impl of `AllPropsFor<ChildPropertiesBuilder, (_,)>` for `AssertAllProps` | ||
= note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0609]: no field `children` on type `ChildProperties` | ||
--> tests/html_macro/component-fail.rs:87:14 | ||
| | ||
87 | html! { <Child>{ "Not allowed" }</Child> }; | ||
| ^^^^^ unknown field | ||
| | ||
= note: available fields are: `string`, `int` | ||
= note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0599]: no method named `children` found for struct `ChildPropertiesBuilder` in the current scope | ||
--> tests/html_macro/component-fail.rs:87:14 | ||
| | ||
|
@@ -419,6 +410,15 @@ error[E0599]: no method named `children` found for struct `ChildPropertiesBuilde | |
| | ||
= note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0609]: no field `children` on type `ChildProperties` | ||
--> tests/html_macro/component-fail.rs:94:10 | ||
| | ||
94 | <Child ..ChildProperties { string: "hello".to_owned(), int: 5 }> | ||
| ^^^^^ unknown field | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a bad span. Can we do better? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree in principle, but don't want to block this PR with this. The errors were like this before, even before #2729 . This PR only affects the order in which errors are reported, since they emit from a non-const context again. Don't ask me why that changes the order of error reporting though, idk :) Note that this bad span is only for field |
||
| | ||
= note: available fields are: `string`, `int` | ||
= note: this error originates in the macro `html` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error[E0277]: the trait bound `AssertAllProps: HasProp<_ChildContainerProperties::children, _>` is not satisfied | ||
--> tests/html_macro/component-fail.rs:99:14 | ||
| | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Span should reference MissingTypeBounds here