File tree 5 files changed +14
-3
lines changed
src/test/ui/lint/must_not_suspend
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<'_> {
1303
1303
///
1304
1304
/// See the [module-level documentation](self) for more.
1305
1305
#[ 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
+ ) ]
1306
1311
pub struct Ref < ' b , T : ?Sized + ' b > {
1307
1312
value : & ' b T ,
1308
1313
borrow : BorrowRef < ' b > ,
@@ -1679,6 +1684,11 @@ impl<'b> BorrowRefMut<'b> {
1679
1684
///
1680
1685
/// See the [module-level documentation](self) for more.
1681
1686
#[ 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
+ ) ]
1682
1692
pub struct RefMut < ' b , T : ?Sized + ' b > {
1683
1693
value : & ' b mut T ,
1684
1694
borrow : BorrowRefMut < ' b > ,
Original file line number Diff line number Diff line change 141
141
#![ feature( link_llvm_intrinsics) ]
142
142
#![ feature( llvm_asm) ]
143
143
#![ feature( min_specialization) ]
144
+ #![ cfg_attr( not( bootstrap) , feature( must_not_suspend) ) ]
144
145
#![ feature( negative_impls) ]
145
146
#![ feature( never_type) ]
146
147
#![ 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> {}
192
192
not( bootstrap) ,
193
193
must_not_suspend = "Holding a MutexGuard across suspend \
194
194
points can cause deadlocks, delays, \
195
- and cause Future's to not implement `Send`"
195
+ and cause Futures to not implement `Send`"
196
196
) ]
197
197
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
198
198
pub 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> {}
99
99
not( bootstrap) ,
100
100
must_not_suspend = "Holding a RwLockReadGuard across suspend \
101
101
points can cause deadlocks, delays, \
102
- and cause Future's to not implement `Send`"
102
+ and cause Futures to not implement `Send`"
103
103
) ]
104
104
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
105
105
pub 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
11
11
|
12
12
LL | #![deny(must_not_suspend)]
13
13
| ^^^^^^^^^^^^^^^^
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`
15
15
--> $DIR/mutex.rs:7:9
16
16
|
17
17
LL | let _guard = m.lock().unwrap();
You can’t perform that action at this time.
0 commit comments