Skip to content

Commit 47c5886

Browse files
committed
---
yaml --- r: 196328 b: refs/heads/tmp c: 25d070f h: refs/heads/master v: v3
1 parent f8f2bf6 commit 47c5886

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3232
refs/heads/beta: 9854143cba679834bc4ef932858cd5303f015a0e
3333
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3434
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
35-
refs/heads/tmp: 35275076f52d53c3dcd9dee85d92a2059a663225
35+
refs/heads/tmp: 25d070f228a101a806165a434b150a59a54f08ba
3636
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3737
refs/tags/homu-tmp: 53a183f0274316596bf9405944d4f0468d8c93e4
3838
refs/heads/gate: 97c84447b65164731087ea82685580cc81424412

branches/tmp/src/libstd/sync/mutex.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ pub struct Mutex<T> {
121121
data: UnsafeCell<T>,
122122
}
123123

124+
// these are the only places where `T: Send` matters; all other
125+
// functionality works fine on a single thread.
124126
unsafe impl<T: Send> Send for Mutex<T> { }
125127

126128
unsafe impl<T: Send> Sync for Mutex<T> { }
@@ -179,7 +181,7 @@ pub const MUTEX_INIT: StaticMutex = StaticMutex {
179181
poison: poison::FLAG_INIT,
180182
};
181183

182-
impl<T: Send> Mutex<T> {
184+
impl<T> Mutex<T> {
183185
/// Creates a new mutex in an unlocked state ready for use.
184186
#[stable(feature = "rust1", since = "1.0.0")]
185187
pub fn new(t: T) -> Mutex<T> {
@@ -242,7 +244,7 @@ impl<T: Send> Mutex<T> {
242244

243245
#[unsafe_destructor]
244246
#[stable(feature = "rust1", since = "1.0.0")]
245-
impl<T: Send> Drop for Mutex<T> {
247+
impl<T> Drop for Mutex<T> {
246248
fn drop(&mut self) {
247249
// This is actually safe b/c we know that there is no further usage of
248250
// this mutex (it's up to the user to arrange for a mutex to get
@@ -252,7 +254,7 @@ impl<T: Send> Drop for Mutex<T> {
252254
}
253255

254256
#[stable(feature = "rust1", since = "1.0.0")]
255-
impl<T: fmt::Debug + Send + 'static> fmt::Debug for Mutex<T> {
257+
impl<T: fmt::Debug + 'static> fmt::Debug for Mutex<T> {
256258
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
257259
match self.try_lock() {
258260
Ok(guard) => write!(f, "Mutex {{ data: {:?} }}", *guard),

branches/tmp/src/libstd/sync/rwlock.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub struct RwLockWriteGuard<'a, T: 'a> {
129129

130130
impl<'a, T> !marker::Send for RwLockWriteGuard<'a, T> {}
131131

132-
impl<T: Send + Sync> RwLock<T> {
132+
impl<T> RwLock<T> {
133133
/// Creates a new instance of an `RwLock<T>` which is unlocked.
134134
///
135135
/// # Examples
@@ -257,7 +257,7 @@ impl<T> Drop for RwLock<T> {
257257
}
258258

259259
#[stable(feature = "rust1", since = "1.0.0")]
260-
impl<T: fmt::Debug + Send + Sync> fmt::Debug for RwLock<T> {
260+
impl<T: fmt::Debug> fmt::Debug for RwLock<T> {
261261
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
262262
match self.try_read() {
263263
Ok(guard) => write!(f, "RwLock {{ data: {:?} }}", *guard),

0 commit comments

Comments
 (0)