Skip to content

Commit 3fe3ec5

Browse files
committed
---
yaml --- r: 151439 b: refs/heads/try2 c: 6aefce6 h: refs/heads/master i: 151437: 690bd79 151435: 2c1f9cb 151431: 801316c 151423: 8ae3640 v: v3
1 parent bf87129 commit 3fe3ec5

File tree

50 files changed

+1145
-2185
lines changed

Some content is hidden

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

50 files changed

+1145
-2185
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: 574cbe5b07042c448c198af371803f977977b74f
8+
refs/heads/try2: 6aefce6f16d4ecddbc225c23a5ebeb481c19ea2c
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/prepare.mk

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ prepare-host-lib-$(1)-$(2)-$(3)-$(4): prepare-maybe-clean-$(4) \
106106
prepare-host-dirs-$(4)
107107
$$(if $$(findstring $(2), $$(PREPARE_STAGE)),\
108108
$$(if $$(findstring $(3), $$(PREPARE_HOST)),\
109-
$$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$$(PREPARE_HOST),$(1))),),)
109+
$$(if $$(findstring 1,$$(ONLY_RLIB_$(1))),,\
110+
$$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$$(PREPARE_HOST),$(1)))),),)
110111
endef
111112

112113

@@ -133,7 +134,8 @@ prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \
133134
$$(if $$(findstring $(3), $$(PREPARE_HOST)),\
134135
$$(call PREPARE_DIR,$$(PREPARE_WORKING_DEST_LIB_DIR))\
135136
$$(foreach crate,$$(TARGET_CRATES),\
136-
$$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate)))\
137+
$$(if $$(findstring 1, $$(ONLY_RLIB_$$(crate))),,\
138+
$$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate))))\
137139
$$(call PREPARE_LIB,$$(call CFG_RLIB_GLOB,$$(crate))))\
138140
$$(if $$(findstring $(2),$$(CFG_HOST)),\
139141
$$(foreach crate,$$(HOST_CRATES),\

branches/try2/src/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ The keywords are the following strings:
208208

209209
~~~~ {.notrust .keyword}
210210
as
211-
box break
211+
break
212212
crate
213213
else enum extern
214214
false fn for

branches/try2/src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
<keyword>as</keyword>
3939
<keyword>assert</keyword>
4040
<keyword>break</keyword>
41-
<keyword>box</keyword>
4241
<keyword>const</keyword>
4342
<keyword>continue</keyword>
4443
<keyword>crate</keyword>

branches/try2/src/etc/kate/rust.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
<list name="keywords">
1919
<item> as </item>
2020
<item> break </item>
21-
<item> box </item>
2221
<item> continue </item>
2322
<item> crate </item>
2423
<item> do </item>

branches/try2/src/etc/vim/syntax/rust.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ syn keyword rustOperator as
1818

1919
syn match rustAssert "\<assert\(\w\)*!" contained
2020
syn match rustFail "\<fail\(\w\)*!" contained
21-
syn keyword rustKeyword break box continue
21+
syn keyword rustKeyword break continue
2222
syn keyword rustKeyword extern nextgroup=rustExternCrate,rustObsoleteExternMod skipwhite
2323
syn keyword rustKeyword for in if impl let
2424
syn keyword rustKeyword loop once priv pub

branches/try2/src/libcollections/hashmap.rs

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,7 +1617,8 @@ mod test_map {
16171617
use std::cmp::Equiv;
16181618
use std::hash::Hash;
16191619
use std::iter::{Iterator,range_inclusive,range_step_inclusive};
1620-
use std::cell::RefCell;
1620+
use std::local_data;
1621+
use std::vec;
16211622

16221623
struct KindaIntLike(int);
16231624

@@ -1656,7 +1657,7 @@ mod test_map {
16561657
assert_eq!(*m.find(&2).unwrap(), 4);
16571658
}
16581659

1659-
local_data_key!(drop_vector: RefCell<Vec<int>>)
1660+
local_data_key!(drop_vector: vec::Vec<int>)
16601661

16611662
#[deriving(Hash, Eq, TotalEq)]
16621663
struct Dropable {
@@ -1666,72 +1667,75 @@ mod test_map {
16661667

16671668
impl Dropable {
16681669
fn new(k: uint) -> Dropable {
1669-
let v = drop_vector.get().unwrap();
1670-
v.borrow_mut().as_mut_slice()[k] += 1;
1670+
local_data::get_mut(drop_vector,
1671+
|v| { v.unwrap().as_mut_slice()[k] += 1; });
16711672

16721673
Dropable { k: k }
16731674
}
16741675
}
16751676

16761677
impl Drop for Dropable {
16771678
fn drop(&mut self) {
1678-
let v = drop_vector.get().unwrap();
1679-
v.borrow_mut().as_mut_slice()[self.k] -= 1;
1679+
local_data::get_mut(drop_vector, |v|
1680+
{ v.unwrap().as_mut_slice()[self.k] -= 1; });
16801681
}
16811682
}
16821683

16831684
#[test]
16841685
fn test_drops() {
1685-
drop_vector.replace(Some(RefCell::new(Vec::from_elem(200, 0))));
1686+
local_data::set(drop_vector, vec::Vec::from_elem(200, 0));
16861687

16871688
{
16881689
let mut m = HashMap::new();
16891690

1690-
let v = drop_vector.get().unwrap();
1691-
for i in range(0u, 200) {
1692-
assert_eq!(v.borrow().as_slice()[i], 0);
1693-
}
1694-
drop(v);
1691+
local_data::get(drop_vector, |v| {
1692+
for i in range(0u, 200) {
1693+
assert_eq!(v.unwrap().as_slice()[i], 0);
1694+
}
1695+
});
16951696

16961697
for i in range(0u, 100) {
16971698
let d1 = Dropable::new(i);
16981699
let d2 = Dropable::new(i+100);
16991700
m.insert(d1, d2);
17001701
}
17011702

1702-
let v = drop_vector.get().unwrap();
1703-
for i in range(0u, 200) {
1704-
assert_eq!(v.borrow().as_slice()[i], 1);
1705-
}
1706-
drop(v);
1703+
local_data::get(drop_vector, |v| {
1704+
for i in range(0u, 200) {
1705+
assert_eq!(v.unwrap().as_slice()[i], 1);
1706+
}
1707+
});
17071708

17081709
for i in range(0u, 50) {
17091710
let k = Dropable::new(i);
17101711
let v = m.pop(&k);
17111712

17121713
assert!(v.is_some());
17131714

1714-
let v = drop_vector.get().unwrap();
1715-
assert_eq!(v.borrow().as_slice()[i], 1);
1716-
assert_eq!(v.borrow().as_slice()[i+100], 1);
1715+
local_data::get(drop_vector, |v| {
1716+
assert_eq!(v.unwrap().as_slice()[i], 1);
1717+
assert_eq!(v.unwrap().as_slice()[i+100], 1);
1718+
});
17171719
}
17181720

1719-
let v = drop_vector.get().unwrap();
1720-
for i in range(0u, 50) {
1721-
assert_eq!(v.borrow().as_slice()[i], 0);
1722-
assert_eq!(v.borrow().as_slice()[i+100], 0);
1723-
}
1721+
local_data::get(drop_vector, |v| {
1722+
for i in range(0u, 50) {
1723+
assert_eq!(v.unwrap().as_slice()[i], 0);
1724+
assert_eq!(v.unwrap().as_slice()[i+100], 0);
1725+
}
17241726

1725-
for i in range(50u, 100) {
1726-
assert_eq!(v.borrow().as_slice()[i], 1);
1727-
assert_eq!(v.borrow().as_slice()[i+100], 1);
1728-
}
1727+
for i in range(50u, 100) {
1728+
assert_eq!(v.unwrap().as_slice()[i], 1);
1729+
assert_eq!(v.unwrap().as_slice()[i+100], 1);
1730+
}
1731+
});
17291732
}
17301733

1731-
let v = drop_vector.get().unwrap();
1732-
for i in range(0u, 200) {
1733-
assert_eq!(v.borrow().as_slice()[i], 0);
1734-
}
1734+
local_data::get(drop_vector, |v| {
1735+
for i in range(0u, 200) {
1736+
assert_eq!(v.unwrap().as_slice()[i], 0);
1737+
}
1738+
});
17351739
}
17361740

17371741
#[test]

branches/try2/src/libgraphviz/lib.rs

Lines changed: 12 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,11 @@ type Nd = int;
5454
type Ed = (int,int);
5555
struct Edges(Vec<Ed>);
5656
57-
pub fn render_to<W:Writer>(output: &mut W) {
57+
pub fn main() {
58+
use std::io::File;
5859
let edges = Edges(vec!((0,1), (0,2), (1,3), (2,3), (3,4), (4,4)));
59-
dot::render(&edges, output).unwrap()
60+
let mut f = File::create(&Path::new("example1.dot"));
61+
dot::render(&edges, &mut f).unwrap()
6062
}
6163
6264
impl<'a> dot::Labeller<'a, Nd, Ed> for Edges {
@@ -89,17 +91,6 @@ impl<'a> dot::GraphWalk<'a, Nd, Ed> for Edges {
8991
9092
fn target(&self, e: &Ed) -> Nd { let &(_,t) = e; t }
9193
}
92-
93-
# pub fn main() { use std::io::MemWriter; render_to(&mut MemWriter::new()) }
94-
```
95-
96-
```no_run
97-
# pub fn render_to<W:Writer>(output: &mut W) { unimplemented!() }
98-
pub fn main() {
99-
use std::io::File;
100-
let mut f = File::create(&Path::new("example1.dot"));
101-
render_to(&mut f)
102-
}
10394
```
10495
10596
Output from first example (in `example1.dot`):
@@ -149,17 +140,19 @@ entity `&sube`).
149140
```rust
150141
use dot = graphviz;
151142
use std::str;
143+
use std::io::File;
152144
153145
type Nd = uint;
154146
type Ed<'a> = &'a (uint, uint);
155147
struct Graph { nodes: Vec<&'static str>, edges: Vec<(uint,uint)> }
156148
157-
pub fn render_to<W:Writer>(output: &mut W) {
149+
pub fn main() {
158150
let nodes = vec!("{x,y}","{x}","{y}","{}");
159151
let edges = vec!((0,1), (0,2), (1,3), (2,3));
160152
let graph = Graph { nodes: nodes, edges: edges };
161153
162-
dot::render(&graph, output).unwrap()
154+
let mut f = File::create(&Path::new("example2.dot"));
155+
dot::render(&graph, &mut f).unwrap()
163156
}
164157
165158
impl<'a> dot::Labeller<'a, Nd, Ed<'a>> for Graph {
@@ -181,17 +174,6 @@ impl<'a> dot::GraphWalk<'a, Nd, Ed<'a>> for Graph {
181174
fn source(&self, e: &Ed) -> Nd { let & &(s,_) = e; s }
182175
fn target(&self, e: &Ed) -> Nd { let & &(_,t) = e; t }
183176
}
184-
185-
# pub fn main() { use std::io::MemWriter; render_to(&mut MemWriter::new()) }
186-
```
187-
188-
```no_run
189-
# pub fn render_to<W:Writer>(output: &mut W) { unimplemented!() }
190-
pub fn main() {
191-
use std::io::File;
192-
let mut f = File::create(&Path::new("example2.dot"));
193-
render_to(&mut f)
194-
}
195177
```
196178
197179
The third example is similar to the second, except now each node and
@@ -205,17 +187,19 @@ Hasse-diagram for the subsets of the set `{x, y}`.
205187
```rust
206188
use dot = graphviz;
207189
use std::str;
190+
use std::io::File;
208191
209192
type Nd<'a> = (uint, &'a str);
210193
type Ed<'a> = (Nd<'a>, Nd<'a>);
211194
struct Graph { nodes: Vec<&'static str>, edges: Vec<(uint,uint)> }
212195
213-
pub fn render_to<W:Writer>(output: &mut W) {
196+
pub fn main() {
214197
let nodes = vec!("{x,y}","{x}","{y}","{}");
215198
let edges = vec!((0,1), (0,2), (1,3), (2,3));
216199
let graph = Graph { nodes: nodes, edges: edges };
217200
218-
dot::render(&graph, output).unwrap()
201+
let mut f = File::create(&Path::new("example3.dot"));
202+
dot::render(&graph, &mut f).unwrap()
219203
}
220204
221205
impl<'a> dot::Labeller<'a, Nd<'a>, Ed<'a>> for Graph {
@@ -245,17 +229,6 @@ impl<'a> dot::GraphWalk<'a, Nd<'a>, Ed<'a>> for Graph {
245229
fn source(&self, e: &Ed<'a>) -> Nd<'a> { let &(s,_) = e; s }
246230
fn target(&self, e: &Ed<'a>) -> Nd<'a> { let &(_,t) = e; t }
247231
}
248-
249-
# pub fn main() { use std::io::MemWriter; render_to(&mut MemWriter::new()) }
250-
```
251-
252-
```no_run
253-
# pub fn render_to<W:Writer>(output: &mut W) { unimplemented!() }
254-
pub fn main() {
255-
use std::io::File;
256-
let mut f = File::create(&Path::new("example3.dot"));
257-
render_to(&mut f)
258-
}
259232
```
260233
261234
# References

branches/try2/src/liblog/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ use std::cast;
122122
use std::fmt;
123123
use std::io::LineBufferedWriter;
124124
use std::io;
125+
use std::local_data;
125126
use std::os;
126127
use std::rt;
127128
use std::slice;
@@ -227,7 +228,7 @@ pub fn log(level: u32, loc: &'static LogLocation, args: &fmt::Arguments) {
227228
// Completely remove the local logger from TLS in case anyone attempts to
228229
// frob the slot while we're doing the logging. This will destroy any logger
229230
// set during logging.
230-
let mut logger = local_logger.replace(None).unwrap_or_else(|| {
231+
let mut logger = local_data::pop(local_logger).unwrap_or_else(|| {
231232
box DefaultLogger { handle: io::stderr() } as Box<Logger:Send>
232233
});
233234
logger.log(&LogRecord {
@@ -237,7 +238,7 @@ pub fn log(level: u32, loc: &'static LogLocation, args: &fmt::Arguments) {
237238
module_path: loc.module_path,
238239
line: loc.line,
239240
});
240-
local_logger.replace(Some(logger));
241+
local_data::set(local_logger, logger);
241242
}
242243

243244
/// Getter for the global log level. This is a function so that it can be called
@@ -249,7 +250,9 @@ pub fn log_level() -> u32 { unsafe { LOG_LEVEL } }
249250
/// Replaces the task-local logger with the specified logger, returning the old
250251
/// logger.
251252
pub fn set_logger(logger: Box<Logger:Send>) -> Option<Box<Logger:Send>> {
252-
local_logger.replace(Some(logger))
253+
let prev = local_data::pop(local_logger);
254+
local_data::set(local_logger, logger);
255+
return prev;
253256
}
254257

255258
/// A LogRecord is created by the logging macros, and passed as the only

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

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,6 @@ pub static FIOCLEX: libc::c_ulong = 0x20006601;
2727
#[cfg(target_os = "android")]
2828
pub static FIOCLEX: libc::c_ulong = 0x5451;
2929

30-
#[cfg(target_os = "macos")]
31-
#[cfg(target_os = "freebsd")]
32-
pub static MSG_DONTWAIT: libc::c_int = 0x80;
33-
#[cfg(target_os = "linux")]
34-
#[cfg(target_os = "android")]
35-
pub static MSG_DONTWAIT: libc::c_int = 0x40;
36-
3730
extern {
3831
pub fn gettimeofday(timeval: *mut libc::timeval,
3932
tzp: *libc::c_void) -> libc::c_int;

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ pub static WSADESCRIPTION_LEN: uint = 256;
1818
pub static WSASYS_STATUS_LEN: uint = 128;
1919
pub static FIONBIO: libc::c_long = 0x8004667e;
2020
static FD_SETSIZE: uint = 64;
21-
pub static MSG_DONTWAIT: libc::c_int = 0;
2221

2322
pub struct WSADATA {
2423
pub wVersion: libc::WORD,

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,6 @@ impl rtio::RtioPipe for FileDesc {
189189
fn close_write(&mut self) -> Result<(), IoError> {
190190
Err(io::standard_error(io::InvalidInput))
191191
}
192-
fn set_timeout(&mut self, _t: Option<u64>) {}
193-
fn set_read_timeout(&mut self, _t: Option<u64>) {}
194-
fn set_write_timeout(&mut self, _t: Option<u64>) {}
195192
}
196193

197194
impl rtio::RtioTTY for FileDesc {

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,6 @@ impl rtio::RtioPipe for FileDesc {
221221
fn close_write(&mut self) -> IoResult<()> {
222222
Err(io::standard_error(io::InvalidInput))
223223
}
224-
fn set_timeout(&mut self, _t: Option<u64>) {}
225-
fn set_read_timeout(&mut self, _t: Option<u64>) {}
226-
fn set_write_timeout(&mut self, _t: Option<u64>) {}
227224
}
228225

229226
impl rtio::RtioTTY for FileDesc {

0 commit comments

Comments
 (0)