-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
must_not_suspend
lint regression with -Zdrop-tracking
#97333
Comments
@guswynn - What do you think is the right behavior here? |
@eholk this was always an issue with |
I'm spending some time looking at this one again this afternoon to see if it's still an issue after @jyn514's changes. It seems like yes, although we aren't getting duplicate warnings now, we're just getting now warnings. I think seeing through references is probably the right option, but I'm getting kind of lost between the different PRs I have open so I'm going to rebase some things and figure out where we're at. |
Sounds good :) @eholk let me know if there's any way I can help, I've been repeatedly running into places at work that would be fixed by drop tracking haha |
…d, r=cjgillot Make must_not_suspend lint see through references when drop tracking is enabled See rust-lang#97333. With drop tracking enabled, sometimes values that were previously linted are now considered dropped and not linted. This change makes must_not_suspend traverse through references to still catch these values. Unfortunately, this leads to duplicate warnings in some cases (e.g. [dedup.rs](https://cs.github.com/rust-lang/rust/blob/9a74608543d499bcc7dd505e195e8bfab9447315/src/test/ui/lint/must_not_suspend/dedup.rs#L4)), so we only use the new behavior when drop tracking is enabled. cc `@guswynn`
…d, r=cjgillot Make must_not_suspend lint see through references when drop tracking is enabled See rust-lang#97333. With drop tracking enabled, sometimes values that were previously linted are now considered dropped and not linted. This change makes must_not_suspend traverse through references to still catch these values. Unfortunately, this leads to duplicate warnings in some cases (e.g. [dedup.rs](https://cs.github.com/rust-lang/rust/blob/9a74608543d499bcc7dd505e195e8bfab9447315/src/test/ui/lint/must_not_suspend/dedup.rs#L4)), so we only use the new behavior when drop tracking is enabled. cc ``@guswynn``
This should be fixed as of #97962! |
The test case
src/test/ui/lint/must_not_suspend/ref.rs
fails when-Zdrop-tracking
is enabled.We are not recognizing the
Umm
type as held across a borrow. Here's the revelant code from the test:rust/src/test/ui/lint/must_not_suspend/ref.rs
Lines 17 to 25 in 7f997f5
In a way, that's correct. We aren't holding
Umm
across the borrow, we are holding&mut Umm
. The question is whether this should trigger the lint? If not, we need some way to annotate&mut Umm
as also not being able to be held across the borrow.It looks like in
check_must_not_suspend_ty
, we already recurse through a few types, so maybe we should look through references too?The text was updated successfully, but these errors were encountered: