5

Add `await_holding_invalid_type` lint by lilymara-onesignal · Pull Request #8707...

 2 years ago
source link: https://github.com/rust-lang/rust-clippy/pull/8707
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Copy link

Contributor

@lilymara-onesignal lilymara-onesignal commented 7 days ago

changelog: [await_holding_invalid_type]

This lint allows users to create a denylist of types which are not allowed to be
held across await points. This is essentially a re-implementation of the
language-level must_not_suspend
lint
. That lint has a lot of
work still to be done before it will reach Rust stable, and in the meantime
there are a lot of types which can trip up developers if they are used
improperly.

I originally implemented this specifically for tracing::span::Entered, until I discovered #8434 and read the commentary on that PR. Given this implementation is fully user configurable, doesn't tie clippy to any one particular crate, and introduces no additional dependencies, it seems more appropriate.

silverlyra reacted with heart emoji

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK