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:
|
async fn uhoh(&mut self) { |
|
let guard = &mut self.u; //~ ERROR `Umm` held across |
|
|
|
other().await; |
|
|
|
*guard = Umm { |
|
i: 2 |
|
} |
|
} |
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 test case
src/test/ui/lint/must_not_suspend/ref.rsfails when-Zdrop-trackingis enabled.We are not recognizing the
Ummtype 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
Ummacross 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 Ummas 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?