Skip to content
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

Invalid use of must_use, will cause problems with upcoming Rust stable versions #10

Closed
estebank opened this issue Mar 8, 2024 · 1 comment

Comments

@estebank
Copy link

estebank commented Mar 8, 2024

rust-lang/rust#121545 will cause rustc to start validating attributes on associated items in traits. It should have always done so. That change will cause async_ui_web_html to error:

[INFO] [stdout] error: malformed `must_use` attribute input
[INFO] [stdout]   --> src/common_events.rs:6:9
[INFO] [stdout]    |
[INFO] [stdout] 6  |         #[must_use("the returned object is a Future+Stream that does nothing unless polled")]
[INFO] [stdout]    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[INFO] [stdout] ...
[INFO] [stdout] 77 |     make_event_impl!("change", until_change, web_sys::Event, "[MDN documentation for this event](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event)...
[INFO] [stdout]    |     ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- in this macro invocation
[INFO] [stdout]    |
[INFO] [stdout]    = note: this error originates in the macro `make_event_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
[INFO] [stdout] help: the following are the possible correct uses
[INFO] [stdout]    |
[INFO] [stdout] 6  |         #[must_use = "reason"]
[INFO] [stdout]    |
[INFO] [stdout] 6  |         #[must_use]
[INFO] [stdout]    |

#[must_use("the returned object is a Future+Stream that does nothing unless polled")]

Fixing this will be straightforward.

@wishawa
Copy link
Owner

wishawa commented Mar 9, 2024

Fixed by #9 . Thank you!

@wishawa wishawa closed this as completed Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants