-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
concise diagnostics for missing props #3873
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
Conversation
Visit the preview URL for this PR (updated for commit f5f68d3): https://yew-rs--pr3873-missing-props-diagno-8yfivone.web.app (expires Tue, 15 Jul 2025 10:19:10 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
@@ -1,4 +1,3 @@ | |||
#![no_implicit_prelude] |
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.
I removed these from the tests that have #[derive(Properties)]
because it prevents #[diagnostics]
from being used. I have no clue how to qualify diagnostics with no_implicit_prelude
. If anybody can help it's very appreciated.
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.
Hmm.. I think it's impossible to use no_implicit_prelude
together with diagnostic
https://doc.rust-lang.org/reference/attributes.html#r-attributes.tool.prelude
Tool attributes are not available if the no_implicit_prelude attribute is used.
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.
I think no_implicit_prelude was introduced to improve hygiene, it ensures our macros don't accidentally collide with rust's built-in ones, which could cause false passes in macro tests.
Sadly there seems to be no way around it for now and diagnostic improvements seem worth it.
Benchmark - coreYew Master
Pull Request
|
Benchmark - SSRYew Master
Pull Request
|
Size Comparison
✅ None of the examples has changed their size significantly. |
9206406
to
ac43025
Compare
c550f85
to
7e12097
Compare
7e12097
to
f5f68d3
Compare
Description
Leveraging the newly stablized
#[diagnostics]
attributes, we can massively clean up diagnostics for missing props.#[diagnostics::on_unimplemented]
is stablized in rust 1.78, May, 2024#[diagnostics::do_not_recommend]
is stablized in rust 1.85.0, February 20, 2025This PR raises the MSRV from 1.76 to 1.78.
the use of
#[diagnostics::do_not_recommend]
seems simply ignored in versions before 1.85.consider the following example:
old diagnostics:

new diagnostics (1.78):
new diagnostics (1.85)
Checklist