File tree Expand file tree Collapse file tree 5 files changed +14
-3
lines changed
src/test/ui/lint/must_not_suspend Expand file tree Collapse file tree 5 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -1303,6 +1303,11 @@ impl Clone for BorrowRef<'_> {
13031303///
13041304/// See the [module-level documentation](self) for more.
13051305#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1306+ #[ cfg_attr(
1307+ not( bootstrap) ,
1308+ must_not_suspend = "Holding a Ref across suspend \
1309+ points can cause BorrowErrors"
1310+ ) ]
13061311pub struct Ref < ' b , T : ?Sized + ' b > {
13071312 value : & ' b T ,
13081313 borrow : BorrowRef < ' b > ,
@@ -1679,6 +1684,11 @@ impl<'b> BorrowRefMut<'b> {
16791684///
16801685/// See the [module-level documentation](self) for more.
16811686#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1687+ #[ cfg_attr(
1688+ not( bootstrap) ,
1689+ must_not_suspend = "Holding a RefMut across suspend \
1690+ points can cause BorrowErrors"
1691+ ) ]
16821692pub struct RefMut < ' b , T : ?Sized + ' b > {
16831693 value : & ' b mut T ,
16841694 borrow : BorrowRefMut < ' b > ,
Original file line number Diff line number Diff line change 141141#![ feature( link_llvm_intrinsics) ]
142142#![ feature( llvm_asm) ]
143143#![ feature( min_specialization) ]
144+ #![ cfg_attr( not( bootstrap) , feature( must_not_suspend) ) ]
144145#![ feature( negative_impls) ]
145146#![ feature( never_type) ]
146147#![ feature( no_core) ]
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ unsafe impl<T: ?Sized + Send> Sync for Mutex<T> {}
192192 not( bootstrap) ,
193193 must_not_suspend = "Holding a MutexGuard across suspend \
194194 points can cause deadlocks, delays, \
195- and cause Future's to not implement `Send`"
195+ and cause Futures to not implement `Send`"
196196) ]
197197#[ stable( feature = "rust1" , since = "1.0.0" ) ]
198198pub struct MutexGuard < ' a , T : ?Sized + ' a > {
Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ unsafe impl<T: ?Sized + Send + Sync> Sync for RwLock<T> {}
9999 not( bootstrap) ,
100100 must_not_suspend = "Holding a RwLockReadGuard across suspend \
101101 points can cause deadlocks, delays, \
102- and cause Future's to not implement `Send`"
102+ and cause Futures to not implement `Send`"
103103) ]
104104#[ stable( feature = "rust1" , since = "1.0.0" ) ]
105105pub struct RwLockReadGuard < ' a , T : ?Sized + ' a > {
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ note: the lint level is defined here
1111 |
1212LL | #![deny(must_not_suspend)]
1313 | ^^^^^^^^^^^^^^^^
14- note: Holding a MutexGuard across suspend points can cause deadlocks, delays, and cause Future's to not implement `Send`
14+ note: Holding a MutexGuard across suspend points can cause deadlocks, delays, and cause Futures to not implement `Send`
1515 --> $DIR/mutex.rs:7:9
1616 |
1717LL | let _guard = m.lock().unwrap();
You can’t perform that action at this time.
0 commit comments