Skip to content

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

Closed
@estebank

Description

@estebank

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions