Skip to content

Commit 57f5ac9

Browse files
committed
Test fixes and rebase conflicts, round 2
1 parent d49b67e commit 57f5ac9

File tree

12 files changed

+29
-64
lines changed

12 files changed

+29
-64
lines changed

src/libcore/num/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1347,7 +1347,7 @@ macro_rules! uint_impl {
13471347

13481348
/// Returns the largest value that can be represented by this integer type.
13491349
#[stable(feature = "rust1", since = "1.0.0")]
1350-
pub fn max_value() -> $T { -1 }
1350+
pub fn max_value() -> $T { !0 }
13511351

13521352
/// Convert a string slice in a given base to an integer.
13531353
///

src/liblibc/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2571,7 +2571,7 @@ pub mod consts {
25712571
pub const ERROR_IO_PENDING: c_int = 997;
25722572
pub const ERROR_FILE_INVALID : c_int = 1006;
25732573
pub const ERROR_NOT_FOUND: c_int = 1168;
2574-
pub const INVALID_HANDLE_VALUE: HANDLE = -1 as HANDLE;
2574+
pub const INVALID_HANDLE_VALUE: HANDLE = !0 as HANDLE;
25752575

25762576
pub const DELETE : DWORD = 0x00010000;
25772577
pub const READ_CONTROL : DWORD = 0x00020000;
@@ -2609,12 +2609,12 @@ pub mod consts {
26092609
pub const WAIT_ABANDONED : DWORD = 0x00000080;
26102610
pub const WAIT_OBJECT_0 : DWORD = 0x00000000;
26112611
pub const WAIT_TIMEOUT : DWORD = 0x00000102;
2612-
pub const WAIT_FAILED : DWORD = -1;
2612+
pub const WAIT_FAILED : DWORD = !0;
26132613

26142614
pub const DUPLICATE_CLOSE_SOURCE : DWORD = 0x00000001;
26152615
pub const DUPLICATE_SAME_ACCESS : DWORD = 0x00000002;
26162616

2617-
pub const INFINITE : DWORD = -1;
2617+
pub const INFINITE : DWORD = !0;
26182618
pub const STILL_ACTIVE : DWORD = 259;
26192619

26202620
pub const MEM_COMMIT : DWORD = 0x00001000;

src/libstd/sync/mpsc/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ mod spsc_queue;
342342
/// The receiving-half of Rust's channel type. This half can only be owned by
343343
/// one task
344344
#[stable(feature = "rust1", since = "1.0.0")]
345-
pub struct Receiver<T:Send> {
345+
pub struct Receiver<T> {
346346
inner: UnsafeCell<Flavor<T>>,
347347
}
348348

@@ -354,14 +354,14 @@ unsafe impl<T: Send> Send for Receiver<T> { }
354354
/// whenever `next` is called, waiting for a new message, and `None` will be
355355
/// returned when the corresponding channel has hung up.
356356
#[stable(feature = "rust1", since = "1.0.0")]
357-
pub struct Iter<'a, T:Send+'a> {
357+
pub struct Iter<'a, T: 'a> {
358358
rx: &'a Receiver<T>
359359
}
360360

361361
/// The sending-half of Rust's asynchronous channel type. This half can only be
362362
/// owned by one task, but it can be cloned to send to other tasks.
363363
#[stable(feature = "rust1", since = "1.0.0")]
364-
pub struct Sender<T:Send> {
364+
pub struct Sender<T> {
365365
inner: UnsafeCell<Flavor<T>>,
366366
}
367367

@@ -372,7 +372,7 @@ unsafe impl<T: Send> Send for Sender<T> { }
372372
/// The sending-half of Rust's synchronous channel type. This half can only be
373373
/// owned by one task, but it can be cloned to send to other tasks.
374374
#[stable(feature = "rust1", since = "1.0.0")]
375-
pub struct SyncSender<T: Send> {
375+
pub struct SyncSender<T> {
376376
inner: Arc<UnsafeCell<sync::Packet<T>>>,
377377
}
378378

@@ -433,15 +433,15 @@ pub enum TrySendError<T> {
433433
Disconnected(T),
434434
}
435435

436-
enum Flavor<T:Send> {
436+
enum Flavor<T> {
437437
Oneshot(Arc<UnsafeCell<oneshot::Packet<T>>>),
438438
Stream(Arc<UnsafeCell<stream::Packet<T>>>),
439439
Shared(Arc<UnsafeCell<shared::Packet<T>>>),
440440
Sync(Arc<UnsafeCell<sync::Packet<T>>>),
441441
}
442442

443443
#[doc(hidden)]
444-
trait UnsafeFlavor<T:Send> {
444+
trait UnsafeFlavor<T> {
445445
fn inner_unsafe<'a>(&'a self) -> &'a UnsafeCell<Flavor<T>>;
446446
unsafe fn inner_mut<'a>(&'a self) -> &'a mut Flavor<T> {
447447
&mut *self.inner_unsafe().get()
@@ -450,12 +450,12 @@ trait UnsafeFlavor<T:Send> {
450450
&*self.inner_unsafe().get()
451451
}
452452
}
453-
impl<T:Send> UnsafeFlavor<T> for Sender<T> {
453+
impl<T> UnsafeFlavor<T> for Sender<T> {
454454
fn inner_unsafe<'a>(&'a self) -> &'a UnsafeCell<Flavor<T>> {
455455
&self.inner
456456
}
457457
}
458-
impl<T:Send> UnsafeFlavor<T> for Receiver<T> {
458+
impl<T> UnsafeFlavor<T> for Receiver<T> {
459459
fn inner_unsafe<'a>(&'a self) -> &'a UnsafeCell<Flavor<T>> {
460460
&self.inner
461461
}

src/libstd/sync/mpsc/mpsc_queue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ struct Node<T> {
7272
/// The multi-producer single-consumer structure. This is not cloneable, but it
7373
/// may be safely shared so long as it is guaranteed that there is only one
7474
/// popper at a time (many pushers are allowed).
75-
pub struct Queue<T: Send> {
75+
pub struct Queue<T> {
7676
head: AtomicPtr<Node<T>>,
7777
tail: UnsafeCell<*mut Node<T>>,
7878
}
7979

80-
unsafe impl<T:Send> Send for Queue<T> { }
80+
unsafe impl<T: Send> Send for Queue<T> { }
8181
unsafe impl<T: Send> Sync for Queue<T> { }
8282

8383
impl<T> Node<T> {

src/libstd/sync/mpsc/oneshot.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const DISCONNECTED: usize = 2; // channel is disconnected OR upgraded
5454
// moves *from* a pointer, ownership of the token is transferred to
5555
// whoever changed the state.
5656

57-
pub struct Packet<T:Send> {
57+
pub struct Packet<T> {
5858
// Internal state of the chan/port pair (stores the blocked task as well)
5959
state: AtomicUsize,
6060
// One-shot data slot location
@@ -64,7 +64,7 @@ pub struct Packet<T:Send> {
6464
upgrade: MyUpgrade<T>,
6565
}
6666

67-
pub enum Failure<T:Send> {
67+
pub enum Failure<T> {
6868
Empty,
6969
Disconnected,
7070
Upgraded(Receiver<T>),
@@ -76,13 +76,13 @@ pub enum UpgradeResult {
7676
UpWoke(SignalToken),
7777
}
7878

79-
pub enum SelectionResult<T:Send> {
79+
pub enum SelectionResult<T> {
8080
SelCanceled,
8181
SelUpgraded(SignalToken, Receiver<T>),
8282
SelSuccess,
8383
}
8484

85-
enum MyUpgrade<T:Send> {
85+
enum MyUpgrade<T> {
8686
NothingSent,
8787
SendUsed,
8888
GoUp(Receiver<T>),

src/libstd/sync/mpsc/shared.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const MAX_STEALS: isize = 5;
4040
#[cfg(not(test))]
4141
const MAX_STEALS: isize = 1 << 20;
4242

43-
pub struct Packet<T: Send> {
43+
pub struct Packet<T> {
4444
queue: mpsc::Queue<T>,
4545
cnt: AtomicIsize, // How many items are on this channel
4646
steals: isize, // How many times has a port received without blocking?

src/libstd/sync/mpsc/spsc_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ struct Node<T> {
5757
/// but it can be safely shared in an Arc if it is guaranteed that there
5858
/// is only one popper and one pusher touching the queue at any one point in
5959
/// time.
60-
pub struct Queue<T: Send> {
60+
pub struct Queue<T> {
6161
// consumer fields
6262
tail: UnsafeCell<*mut Node<T>>, // where to pop from
6363
tail_prev: AtomicPtr<Node<T>>, // where to pop from

src/libstd/sync/mpsc/stream.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const MAX_STEALS: isize = 5;
3939
#[cfg(not(test))]
4040
const MAX_STEALS: isize = 1 << 20;
4141

42-
pub struct Packet<T:Send> {
42+
pub struct Packet<T> {
4343
queue: spsc::Queue<Message<T>>, // internal queue for all message
4444

4545
cnt: AtomicIsize, // How many items are on this channel
@@ -49,7 +49,7 @@ pub struct Packet<T:Send> {
4949
port_dropped: AtomicBool, // flag if the channel has been destroyed.
5050
}
5151

52-
pub enum Failure<T:Send> {
52+
pub enum Failure<T> {
5353
Empty,
5454
Disconnected,
5555
Upgraded(Receiver<T>),
@@ -61,15 +61,15 @@ pub enum UpgradeResult {
6161
UpWoke(SignalToken),
6262
}
6363

64-
pub enum SelectionResult<T:Send> {
64+
pub enum SelectionResult<T> {
6565
SelSuccess,
6666
SelCanceled,
6767
SelUpgraded(SignalToken, Receiver<T>),
6868
}
6969

7070
// Any message could contain an "upgrade request" to a new shared port, so the
7171
// internal queue it's a queue of T, but rather Message<T>
72-
enum Message<T:Send> {
72+
enum Message<T> {
7373
Data(T),
7474
GoUp(Receiver<T>),
7575
}

src/libstd/sync/mpsc/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use sync::mpsc::blocking::{self, WaitToken, SignalToken};
4747
use sync::mpsc::select::StartResult::{self, Installed, Abort};
4848
use sync::{Mutex, MutexGuard};
4949

50-
pub struct Packet<T: Send> {
50+
pub struct Packet<T> {
5151
/// Only field outside of the mutex. Just done for kicks, but mainly because
5252
/// the other shared channel already had the code implemented
5353
channels: AtomicUsize,

src/libstd/sync/mutex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ use fmt;
112112
/// *guard += 1;
113113
/// ```
114114
#[stable(feature = "rust1", since = "1.0.0")]
115-
pub struct Mutex<T: Send> {
115+
pub struct Mutex<T> {
116116
// Note that this static mutex is in a *box*, not inlined into the struct
117117
// itself. Once a native mutex has been used once, its address can never
118118
// change (it can't be moved). This mutex type can be safely moved at any

src/libstd/sys/windows/c.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ pub const ERROR_NO_MORE_FILES: libc::DWORD = 18;
4949
pub const TOKEN_READ: libc::DWORD = 0x20008;
5050

5151
// Note that these are not actually HANDLEs, just values to pass to GetStdHandle
52-
pub const STD_INPUT_HANDLE: libc::DWORD = -10;
53-
pub const STD_OUTPUT_HANDLE: libc::DWORD = -11;
54-
pub const STD_ERROR_HANDLE: libc::DWORD = -12;
52+
pub const STD_INPUT_HANDLE: libc::DWORD = -10i32 as libc::DWORD;
53+
pub const STD_OUTPUT_HANDLE: libc::DWORD = -11i32 as libc::DWORD;
54+
pub const STD_ERROR_HANDLE: libc::DWORD = -12i32 as libc::DWORD;
5555

5656
#[repr(C)]
5757
#[cfg(target_arch = "x86")]

src/test/compile-fail/unsendable-class.rs

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)