Skip to content

Commit c4045d4

Browse files
committed
---
yaml --- r: 161270 b: refs/heads/snap-stage3 c: a4b1ac5 h: refs/heads/master v: v3
1 parent 0adb52d commit c4045d4

File tree

4 files changed

+13
-47
lines changed

4 files changed

+13
-47
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 4eb72d268f337a8f117c86a2ac1b98336cab9e9d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 5acb97ae76aeaeed9b4d78a613aa448ea815d74e
4+
refs/heads/snap-stage3: a4b1ac5447c44b5ad5923653ed2091e0510ac8db
55
refs/heads/try: 0f0d21c1eb5c7be04d323e0b06faf252ad790af6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/etc/emacs/rust-mode.el

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
(modify-syntax-entry ?\" "\"" table)
3232
(modify-syntax-entry ?\\ "\\" table)
3333

34+
;; _ is a word-char
35+
(modify-syntax-entry ?_ "w" table)
36+
3437
;; Comments
3538
(modify-syntax-entry ?/ ". 124b" table)
3639
(modify-syntax-entry ?* ". 23" table)
@@ -394,7 +397,7 @@ This is written mainly to be used as `beginning-of-defun-function' for Rust.
394397
Don't move to the beginning of the line. `beginning-of-defun',
395398
which calls this, does that afterwards."
396399
(interactive "p")
397-
(re-search-backward (concat "^\\(" rust-top-item-beg-re "\\)\\_>")
400+
(re-search-backward (concat "^\\(" rust-top-item-beg-re "\\)\\b")
398401
nil 'move (or arg 1)))
399402

400403
(defun rust-end-of-defun ()

branches/snap-stage3/src/libstd/io/net/tcp.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,22 +34,18 @@ use sys::tcp::TcpAcceptor as TcpAcceptorImp;
3434
/// A structure which represents a TCP stream between a local socket and a
3535
/// remote socket.
3636
///
37-
/// The socket will be closed when the value is dropped.
38-
///
3937
/// # Example
4038
///
4139
/// ```no_run
40+
/// # #![allow(unused_must_use)]
4241
/// use std::io::TcpStream;
4342
///
44-
/// {
45-
/// let mut stream = TcpStream::connect("127.0.0.1:34254");
46-
///
47-
/// // ignore the Result
48-
/// let _ = stream.write(&[1]);
43+
/// let mut stream = TcpStream::connect("127.0.0.1:34254");
4944
///
50-
/// let mut buf = [0];
51-
/// let _ = stream.read(&mut buf); // ignore here too
52-
/// } // the stream is closed here
45+
/// stream.write(&[1]);
46+
/// let mut buf = [0];
47+
/// stream.read(&mut buf);
48+
/// drop(stream); // close the connection
5349
/// ```
5450
pub struct TcpStream {
5551
inner: TcpStreamImp,

branches/snap-stage3/src/libstd/sys/common/thread_local.rs

Lines changed: 2 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,7 @@
5959
use prelude::*;
6060

6161
use kinds::marker;
62-
use mem;
6362
use rustrt::exclusive::Exclusive;
64-
use rustrt;
6563
use sync::atomic::{mod, AtomicUint};
6664
use sync::{Once, ONCE_INIT};
6765

@@ -174,7 +172,7 @@ impl StaticKey {
174172
pub unsafe fn destroy(&self) {
175173
match self.inner.key.swap(0, atomic::SeqCst) {
176174
0 => {}
177-
n => { unregister_key(n as imp::Key); imp::destroy(n as imp::Key) }
175+
n => { imp::destroy(n as imp::Key) }
178176
}
179177
}
180178

@@ -191,10 +189,7 @@ impl StaticKey {
191189
assert!(key != 0);
192190
match self.inner.key.compare_and_swap(0, key as uint, atomic::SeqCst) {
193191
// The CAS succeeded, so we've created the actual key
194-
0 => {
195-
register_key(key);
196-
key as uint
197-
}
192+
0 => key as uint,
198193
// If someone beat us to the punch, use their key instead
199194
n => { imp::destroy(key); n }
200195
}
@@ -237,34 +232,6 @@ impl Drop for Key {
237232
}
238233
}
239234

240-
fn init_keys() {
241-
let keys = box Exclusive::new(Vec::<imp::Key>::new());
242-
unsafe {
243-
KEYS = mem::transmute(keys);
244-
}
245-
246-
rustrt::at_exit(proc() unsafe {
247-
let keys: Box<Exclusive<Vec<imp::Key>>> = mem::transmute(KEYS);
248-
KEYS = 0 as *mut _;
249-
let keys = keys.lock();
250-
for key in keys.iter() {
251-
imp::destroy(*key);
252-
}
253-
});
254-
}
255-
256-
fn register_key(key: imp::Key) {
257-
INIT_KEYS.doit(init_keys);
258-
let mut keys = unsafe { (*KEYS).lock() };
259-
keys.push(key);
260-
}
261-
262-
fn unregister_key(key: imp::Key) {
263-
INIT_KEYS.doit(init_keys);
264-
let mut keys = unsafe { (*KEYS).lock() };
265-
keys.retain(|k| *k != key);
266-
}
267-
268235
#[cfg(test)]
269236
mod tests {
270237
use prelude::*;

0 commit comments

Comments
 (0)