Skip to content

Commit e8b154f

Browse files
committed
---
yaml --- r: 195855 b: refs/heads/auto c: 25d070f h: refs/heads/master i: 195853: 4fde109 195851: 5004cdc 195847: 64e8a3b 195839: 079cddd v: v3
1 parent 898c33f commit e8b154f

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
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 35275076f52d53c3dcd9dee85d92a2059a663225
13+
refs/heads/auto: 25d070f228a101a806165a434b150a59a54f08ba
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/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/auto/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)