Skip to content

Commit 8560dcf

Browse files
committed
---
yaml --- r: 149478 b: refs/heads/try2 c: 4d10bdc h: refs/heads/master v: v3
1 parent 036fa10 commit 8560dcf

File tree

150 files changed

+486
-496
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

150 files changed

+486
-496
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: c250c16f81f82a21295e421be7bd47c91d64cb2a
8+
refs/heads/try2: 4d10bdc5b9fecee38abcad78a86e552a961b1a0a
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/crates.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ DEPS_flate := std native:miniz
6969
DEPS_arena := std collections
7070
DEPS_glob := std
7171
DEPS_serialize := std
72-
DEPS_term := std collections
72+
DEPS_term := std
7373
DEPS_semver := std
7474
DEPS_uuid := std serialize
7575
DEPS_sync := std

branches/try2/src/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ expression context, the final namespace qualifier is omitted.
467467
Two examples of paths with type arguments:
468468

469469
~~~~
470-
# struct HashMap<K, V>;
470+
# use std::hashmap::HashMap;
471471
# fn f() {
472472
# fn id<T>(t: T) -> T { t }
473473
type T = HashMap<int,~str>; // Type arguments used in a type expression

branches/try2/src/doc/tutorial.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,8 +1977,8 @@ illegal to copy and pass by value.
19771977
Generic `type`, `struct`, and `enum` declarations follow the same pattern:
19781978
19791979
~~~~
1980-
extern crate collections;
1981-
type Set<T> = collections::HashMap<T, ()>;
1980+
use std::hashmap::HashMap;
1981+
type Set<T> = HashMap<T, ()>;
19821982
19831983
struct Stack<T> {
19841984
elements: ~[T]
@@ -1988,7 +1988,6 @@ enum Option<T> {
19881988
Some(T),
19891989
None
19901990
}
1991-
# fn main() {}
19921991
~~~~
19931992
19941993
These declarations can be instantiated to valid types like `Set<int>`,

branches/try2/src/etc/combine-tests.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ def scrub(b):
5555
#[crate_id=\"run_pass_stage2#0.1\"];
5656
#[feature(globs, macro_rules, struct_variant, managed_boxes)];
5757
#[allow(warnings)];
58-
extern crate collections;
59-
extern crate extra;
6058
"""
6159
)
6260
for t in stage2_tests:

branches/try2/src/libarena/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ use std::num;
3737
use std::kinds::marker;
3838
use std::rc::Rc;
3939
use std::rt::global_heap;
40-
use std::unstable::intrinsics::{TyDesc, get_tydesc};
41-
use std::unstable::intrinsics;
40+
use std::intrinsics::{TyDesc, get_tydesc};
41+
use std::intrinsics;
4242
use std::vec;
4343

4444
// The way arena uses arrays is really deeply awful. The arrays are

branches/try2/src/libcollections/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,21 @@ pub use btree::BTree;
2727
pub use deque::Deque;
2828
pub use dlist::DList;
2929
pub use enum_set::EnumSet;
30-
pub use hashmap::{HashMap, HashSet};
3130
pub use list::List;
3231
pub use lru_cache::LruCache;
3332
pub use priority_queue::PriorityQueue;
3433
pub use ringbuf::RingBuf;
3534
pub use smallintmap::SmallIntMap;
3635
pub use treemap::{TreeMap, TreeSet};
37-
pub use trie::{TrieMap, TrieSet};
3836

3937
pub mod bitv;
4038
pub mod btree;
4139
pub mod deque;
4240
pub mod dlist;
4341
pub mod enum_set;
44-
pub mod hashmap;
4542
pub mod list;
4643
pub mod lru_cache;
4744
pub mod priority_queue;
4845
pub mod ringbuf;
4946
pub mod smallintmap;
5047
pub mod treemap;
51-
pub mod trie;

branches/try2/src/libcollections/lru_cache.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,11 @@
3838
//! ```
3939
4040
use std::container::Container;
41+
use std::hashmap::HashMap;
4142
use std::to_bytes::Cb;
4243
use std::ptr;
4344
use std::cast;
4445

45-
use HashMap;
46-
4746
struct KeyRef<K> { k: *K }
4847

4948
struct LruEntry<K, V> {

branches/try2/src/libextra/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ fn main() {
235235

236236
use std::char;
237237
use std::f64;
238-
use collections::HashMap;
238+
use std::hashmap::HashMap;
239239
use std::io;
240240
use std::io::MemWriter;
241241
use std::num;

branches/try2/src/libextra/stats.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212

1313
use std::cmp;
1414
use std::hash_old::Hash;
15+
use std::hashmap;
1516
use std::io;
1617
use std::mem;
1718
use std::num;
18-
use collections::hashmap;
1919

2020
// NB: this can probably be rewritten in terms of num::Num
2121
// to be less f64-specific.

branches/try2/src/libextra/url.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
use std::io::BufReader;
1616
use std::cmp::Eq;
17-
use collections::HashMap;
17+
use std::hashmap::HashMap;
1818
use std::to_bytes;
1919
use std::uint;
2020

@@ -957,7 +957,7 @@ mod tests {
957957
958958
use super::*;
959959
960-
use collections::HashMap;
960+
use std::hashmap::HashMap;
961961
962962
#[test]
963963
fn test_url_parse() {

branches/try2/src/libgreen/macros.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ memory and partly incapable of presentation to others.",
124124
abort();
125125

126126
fn abort() -> ! {
127-
use std::unstable::intrinsics;
127+
use std::intrinsics;
128128
unsafe { intrinsics::abort() }
129129
}
130130
}

branches/try2/src/libnative/io/pipe_unix.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::libc;
1515
use std::mem;
1616
use std::rt::rtio;
1717
use std::sync::arc::UnsafeArc;
18-
use std::unstable::intrinsics;
18+
use std::intrinsics;
1919

2020
use super::{IoResult, retry};
2121
use super::file::{keep_going, fd_t};

branches/try2/src/libnative/io/pipe_win32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ use std::os::win32::as_utf16_p;
9090
use std::ptr;
9191
use std::rt::rtio;
9292
use std::sync::arc::UnsafeArc;
93-
use std::unstable::intrinsics;
93+
use std::intrinsics;
9494

9595
use super::IoResult;
9696

branches/try2/src/libnative/io/timer_other.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#[allow(non_camel_case_types)];
5050

5151
use std::comm::Data;
52+
use std::hashmap::HashMap;
5253
use std::libc;
5354
use std::mem;
5455
use std::os;
@@ -104,7 +105,7 @@ fn helper(input: libc::c_int, messages: Port<Req>) {
104105
// sorted list, and dead timers are those which have expired, but ownership
105106
// hasn't yet been transferred back to the timer itself.
106107
let mut active: ~[~Inner] = ~[];
107-
let mut dead = ~[];
108+
let mut dead = HashMap::new();
108109

109110
// inserts a timer into an array of timers (sorted by firing time)
110111
fn insert(t: ~Inner, active: &mut ~[~Inner]) {
@@ -115,7 +116,7 @@ fn helper(input: libc::c_int, messages: Port<Req>) {
115116
}
116117

117118
// signals the first requests in the queue, possible re-enqueueing it.
118-
fn signal(active: &mut ~[~Inner], dead: &mut ~[(uint, ~Inner)]) {
119+
fn signal(active: &mut ~[~Inner], dead: &mut HashMap<uint, ~Inner>) {
119120
let mut timer = match active.shift() {
120121
Some(timer) => timer, None => return
121122
};
@@ -126,7 +127,7 @@ fn helper(input: libc::c_int, messages: Port<Req>) {
126127
insert(timer, active);
127128
} else {
128129
drop(chan);
129-
dead.push((timer.id, timer));
130+
dead.insert(timer.id, timer);
130131
}
131132
}
132133

@@ -171,12 +172,8 @@ fn helper(input: libc::c_int, messages: Port<Req>) {
171172
Data(NewTimer(timer)) => insert(timer, &mut active),
172173

173174
Data(RemoveTimer(id, ack)) => {
174-
match dead.iter().position(|&(i, _)| id == i) {
175-
Some(i) => {
176-
let (_, i) = dead.remove(i).unwrap();
177-
ack.send(i);
178-
continue
179-
}
175+
match dead.pop(&id) {
176+
Some(i) => { ack.send(i); continue }
180177
None => {}
181178
}
182179
let i = active.iter().position(|i| i.id == id);

branches/try2/src/libnative/io/timer_timerfd.rs

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ use std::libc;
3535
use std::ptr;
3636
use std::os;
3737
use std::rt::rtio;
38+
use std::hashmap::HashMap;
3839
use std::mem;
3940

4041
use io::file::FileDesc;
@@ -77,7 +78,7 @@ fn helper(input: libc::c_int, messages: Port<Req>) {
7778

7879
add(efd, input);
7980
let events: [imp::epoll_event, ..16] = unsafe { mem::init() };
80-
let mut list: ~[(libc::c_int, Chan<()>, bool)] = ~[];
81+
let mut map: HashMap<libc::c_int, (Chan<()>, bool)> = HashMap::new();
8182
'outer: loop {
8283
let n = match unsafe {
8384
imp::epoll_wait(efd, events.as_ptr(),
@@ -106,17 +107,13 @@ fn helper(input: libc::c_int, messages: Port<Req>) {
106107
// FIXME: should this perform a send() this number of
107108
// times?
108109
let _ = FileDesc::new(fd, false).inner_read(bits).unwrap();
109-
let (remove, i) = {
110-
match list.bsearch(|&(f, _, _)| f.cmp(&fd)) {
111-
Some(i) => {
112-
let (_, ref c, oneshot) = list[i];
113-
(!c.try_send(()) || oneshot, i)
114-
}
115-
None => fail!("fd not active: {}", fd),
110+
let remove = {
111+
match map.find(&fd).expect("fd unregistered") {
112+
&(ref c, oneshot) => !c.try_send(()) || oneshot
116113
}
117114
};
118115
if remove {
119-
drop(list.remove(i));
116+
map.remove(&fd);
120117
del(efd, fd);
121118
}
122119
}
@@ -131,17 +128,8 @@ fn helper(input: libc::c_int, messages: Port<Req>) {
131128

132129
// If we haven't previously seen the file descriptor, then
133130
// we need to add it to the epoll set.
134-
match list.bsearch(|&(f, _, _)| f.cmp(&fd)) {
135-
Some(i) => {
136-
drop(mem::replace(&mut list[i], (fd, chan, one)));
137-
}
138-
None => {
139-
match list.iter().position(|&(f, _, _)| f >= fd) {
140-
Some(i) => list.insert(i, (fd, chan, one)),
141-
None => list.push((fd, chan, one)),
142-
}
143-
add(efd, fd);
144-
}
131+
if map.insert(fd, (chan, one)) {
132+
add(efd, fd);
145133
}
146134

147135
// Update the timerfd's time value now that we have control
@@ -153,18 +141,14 @@ fn helper(input: libc::c_int, messages: Port<Req>) {
153141
}
154142

155143
Data(RemoveTimer(fd, chan)) => {
156-
match list.bsearch(|&(f, _, _)| f.cmp(&fd)) {
157-
Some(i) => {
158-
drop(list.remove(i));
159-
del(efd, fd);
160-
}
161-
None => {}
144+
if map.remove(&fd) {
145+
del(efd, fd);
162146
}
163147
chan.send(());
164148
}
165149

166150
Data(Shutdown) => {
167-
assert!(list.len() == 0);
151+
assert!(map.len() == 0);
168152
break 'outer;
169153
}
170154

branches/try2/src/librustc/back/rpath.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use driver::session;
1313
use metadata::cstore;
1414
use metadata::filesearch;
1515

16-
use collections::HashSet;
16+
use std::hashmap::HashSet;
1717
use std::{os, vec};
1818
use syntax::abi;
1919

branches/try2/src/librustc/driver/driver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ use extra::json;
3131
use serialize::Encodable;
3232

3333
use std::cell::{Cell, RefCell};
34+
use std::hashmap::{HashMap,HashSet};
3435
use std::io;
3536
use std::io::fs;
3637
use std::io::MemReader;
3738
use std::os;
3839
use std::vec;
39-
use collections::{HashMap, HashSet};
4040
use getopts::{optopt, optmulti, optflag, optflagopt};
4141
use getopts;
4242
use syntax::ast;

branches/try2/src/librustc/driver/session.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use syntax::{abi, ast, codemap};
2626
use syntax;
2727

2828
use std::cell::{Cell, RefCell};
29-
use collections::{HashMap,HashSet};
29+
use std::hashmap::{HashMap,HashSet};
3030

3131
pub struct Config {
3232
os: abi::Os,

branches/try2/src/librustc/lib/llvm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
use std::c_str::ToCStr;
1515
use std::cell::RefCell;
16-
use collections::HashMap;
16+
use std::hashmap::HashMap;
1717
use std::libc::{c_uint, c_ushort, c_void, free};
1818
use std::str::raw::from_c_str;
1919

branches/try2/src/librustc/metadata/creader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use metadata::loader;
2121
use metadata::loader::Os;
2222

2323
use std::cell::RefCell;
24-
use collections::HashMap;
24+
use std::hashmap::HashMap;
2525
use syntax::ast;
2626
use syntax::abi;
2727
use syntax::attr;

branches/try2/src/librustc/metadata/cstore.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use metadata::decoder;
1717
use metadata::loader;
1818

1919
use std::cell::RefCell;
20-
use collections::HashMap;
20+
use std::hashmap::HashMap;
2121
use syntax::ast;
2222
use syntax::parse::token::IdentInterner;
2323

branches/try2/src/librustc/metadata/encoder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ use serialize::Encodable;
2727
use std::cast;
2828
use std::cell::{Cell, RefCell};
2929
use std::hash_old::Hash;
30+
use std::hashmap::{HashMap, HashSet};
3031
use std::io::MemWriter;
3132
use std::str;
32-
use collections::{HashMap, HashSet};
3333
use syntax::abi::AbiSet;
3434
use syntax::ast::*;
3535
use syntax::ast;

branches/try2/src/librustc/metadata/filesearch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use std::cell::RefCell;
1414
use std::option;
1515
use std::os;
1616
use std::io::fs;
17-
use collections::HashSet;
17+
use std::hashmap::HashSet;
1818

1919
pub enum FileMatch { FileMatches, FileDoesntMatch }
2020

branches/try2/src/librustc/metadata/loader.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ use syntax::attr::AttrMetaMethods;
2626

2727
use std::c_str::ToCStr;
2828
use std::cast;
29+
use std::hashmap::{HashMap, HashSet};
2930
use std::cmp;
3031
use std::io;
3132
use std::os::consts::{macos, freebsd, linux, android, win32};
3233
use std::str;
3334
use std::vec;
3435

35-
use collections::{HashMap, HashSet};
3636
use flate;
3737
use time;
3838

0 commit comments

Comments
 (0)