Update must_not_suspend lint to traverse references

This commit is contained in:
Eric Holk 2022-05-23 12:50:55 -07:00
parent bdfc688558
commit 89d35060b9
2 changed files with 12 additions and 6 deletions

View file

@ -1,5 +1,5 @@
error: `Umm` held across a suspend point, but should not be
--> $DIR/ref.rs:18:26
error: reference to `Umm` held across a suspend point, but should not be
--> $DIR/ref.rs:18:13
|
LL | let guard = &mut self.u;
| ^^^^^^
@ -13,15 +13,15 @@ note: the lint level is defined here
LL | #![deny(must_not_suspend)]
| ^^^^^^^^^^^^^^^^
note: You gotta use Umm's, ya know?
--> $DIR/ref.rs:18:26
--> $DIR/ref.rs:18:13
|
LL | let guard = &mut self.u;
| ^^^^^^
| ^^^^^
help: consider using a block (`{ ... }`) to shrink the value's scope, ending before the suspend point
--> $DIR/ref.rs:18:26
--> $DIR/ref.rs:18:13
|
LL | let guard = &mut self.u;
| ^^^^^^
| ^^^^^
error: aborting due to previous error