Skip to content

Commit 57df7af

Browse files
---
yaml --- r: 157055 b: refs/heads/try c: ca0446d h: refs/heads/master i: 157053: b961310 157051: e45298d 157047: 919a92e 157039: 0326b33 157023: 50904b7 156991: 8fc7313 156927: f3309a8 v: v3
1 parent 81abb8e commit 57df7af

File tree

4 files changed

+108
-290
lines changed

4 files changed

+108
-290
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 2d27bfaeb6522d386d0a2735cb3f75cc5707314a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: d44ea720fa9dfe062ef06d0eb49a58d4e7e92344
5-
refs/heads/try: a93e9c20f2a79eacad21592d0eb58e1a89648629
5+
refs/heads/try: ca0446d10795691e3fc206794ac7fbd441442b34
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 6601b0501e31d08d3892a2d5a7d8a57ab120bf75

branches/try/src/compiletest/compiletest.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use std::io::fs;
2525
use std::from_str::FromStr;
2626
use getopts::{optopt, optflag, reqopt};
2727
use common::Config;
28-
use common::{Pretty, DebugInfoGdb, Codegen};
28+
use common::{Pretty, DebugInfoGdb, DebugInfoLldb, Codegen};
2929
use util::logv;
3030
use regex::Regex;
3131

@@ -244,6 +244,16 @@ pub fn run_tests(config: &Config) {
244244
os::setenv("RUST_TEST_TASKS","1");
245245
}
246246

247+
match config.mode {
248+
DebugInfoLldb => {
249+
// Some older versions of LLDB seem to have problems with multiple
250+
// instances running in parallel, so only run one test task at a
251+
// time.
252+
os::setenv("RUST_TEST_TASKS", "1");
253+
}
254+
_ => { /* proceed */ }
255+
}
256+
247257
let opts = test_opts(config);
248258
let tests = make_tests(config);
249259
// sadly osx needs some file descriptor limits raised for running tests in

branches/try/src/libstd/io/net/udp.rs

Lines changed: 13 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ impl UdpSocket {
100100
///
101101
/// Note that this call does not perform any actual network communication,
102102
/// because UDP is a datagram protocol.
103-
#[deprecated = "`UdpStream` has been deprecated"]
104-
#[allow(deprecated)]
105103
pub fn connect(self, other: SocketAddr) -> UdpStream {
106104
UdpStream {
107105
socket: self,
@@ -207,14 +205,6 @@ impl Clone for UdpSocket {
207205

208206
/// A type that allows convenient usage of a UDP stream connected to one
209207
/// address via the `Reader` and `Writer` traits.
210-
///
211-
/// # Note
212-
///
213-
/// This structure has been deprecated because `Reader` is a stream-oriented API but UDP
214-
/// is a packet-oriented protocol. Every `Reader` method will read a whole packet and
215-
/// throw all superfluous bytes away so that they are no longer available for further
216-
/// method calls.
217-
#[deprecated]
218208
pub struct UdpStream {
219209
socket: UdpSocket,
220210
connected_to: SocketAddr
@@ -235,15 +225,13 @@ impl UdpStream {
235225
}
236226

237227
impl Reader for UdpStream {
238-
/// Returns the next non-empty message from the specified address.
239228
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
240229
let peer = self.connected_to;
241230
self.as_socket(|sock| {
242-
loop {
243-
let (nread, src) = try!(sock.recv_from(buf));
244-
if nread > 0 && src == peer {
245-
return Ok(nread);
246-
}
231+
match sock.recv_from(buf) {
232+
Ok((_nread, src)) if src != peer => Ok(0),
233+
Ok((nread, _src)) => Ok(nread),
234+
Err(e) => Err(e),
247235
}
248236
})
249237
}
@@ -346,28 +334,22 @@ mod test {
346334
}
347335

348336
#[test]
349-
#[allow(deprecated)]
350337
fn stream_smoke_test_ip4() {
351338
let server_ip = next_test_ip4();
352339
let client_ip = next_test_ip4();
353-
let dummy_ip = next_test_ip4();
354340
let (tx1, rx1) = channel();
355341
let (tx2, rx2) = channel();
356342

357343
spawn(proc() {
358-
let send_as = |ip, val: &[u8]| {
359-
match UdpSocket::bind(ip) {
360-
Ok(client) => {
361-
let client = box client;
362-
let mut stream = client.connect(server_ip);
363-
stream.write(val).unwrap();
364-
}
365-
Err(..) => fail!()
344+
match UdpSocket::bind(client_ip) {
345+
Ok(client) => {
346+
let client = box client;
347+
let mut stream = client.connect(server_ip);
348+
rx1.recv();
349+
stream.write([99]).unwrap();
366350
}
367-
};
368-
rx1.recv();
369-
send_as(dummy_ip, [98]);
370-
send_as(client_ip, [99]);
351+
Err(..) => fail!()
352+
}
371353
tx2.send(());
372354
});
373355

@@ -382,7 +364,7 @@ mod test {
382364
assert_eq!(nread, 1);
383365
assert_eq!(buf[0], 99);
384366
}
385-
Err(..) => fail!(),
367+
Err(..) => fail!()
386368
}
387369
}
388370
Err(..) => fail!()
@@ -391,7 +373,6 @@ mod test {
391373
}
392374

393375
#[test]
394-
#[allow(deprecated)]
395376
fn stream_smoke_test_ip6() {
396377
let server_ip = next_test_ip6();
397378
let client_ip = next_test_ip6();

0 commit comments

Comments
 (0)