Skip to content

Commit 10c0403

Browse files
committed
---
yaml --- r: 62786 b: refs/heads/snap-stage3 c: b4a3fe2 h: refs/heads/master v: v3
1 parent 0c284af commit 10c0403

File tree

127 files changed

+377
-588
lines changed

Some content is hidden

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

127 files changed

+377
-588
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: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 9a06ff05908234d92de9673734e089b0c315bdfd
4+
refs/heads/snap-stage3: b4a3fe25c6fa35d5b243d6dfaee59306c4bcfda9
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ define TEST_RUNNER
284284
# If NO_REBUILD is set then break the dependencies on extra so we can
285285
# test crates without rebuilding std and extra first
286286
ifeq ($(NO_REBUILD),)
287-
STDTESTDEP_$(1)_$(2)_$(3) = $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_EXTRALIB_$(2))
287+
STDTESTDEP_$(1)_$(2)_$(3) = $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB_$(2))
288288
else
289289
STDTESTDEP_$(1)_$(2)_$(3) =
290290
endif
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"Highlight the 100th text column
2+
"Feature became available in v7.3
3+
if version >= 703
4+
setlocal colorcolumn=100
5+
endif

branches/snap-stage3/src/libextra/arc.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
* In this example, a large vector of floats is shared between several tasks.
1818
* With simple pipes, without ARC, a copy would have to be made for each task.
1919
*
20-
* ~~~ {.rust}
20+
* ~~~
2121
* extern mod std;
2222
* use std::arc;
2323
* let numbers=vec::from_fn(100, |ind| (ind as float)*rand::random());
@@ -370,10 +370,7 @@ pub impl<T:Const + Owned> RWARC<T> {
370370
* See sync::rwlock.write_downgrade(). The RWWriteMode token must be used
371371
* to obtain the &mut T, and can be transformed into a RWReadMode token by
372372
* calling downgrade(), after which a &T can be obtained instead.
373-
*
374-
* # Example
375-
*
376-
* ~~~ {.rust}
373+
* ~~~
377374
* do arc.write_downgrade |write_mode| {
378375
* do (&write_mode).write_cond |state, condvar| {
379376
* ... exclusive access with mutable state ...
@@ -510,6 +507,7 @@ mod tests {
510507
use core::prelude::*;
511508
use core::cell::Cell;
512509
use arc::*;
510+
use arc;
513511

514512
#[test]
515513
fn manually_share_arc() {

branches/snap-stage3/src/libextra/base64.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@ impl<'self> ToBase64 for &'self [u8] {
2828
/**
2929
* Turn a vector of `u8` bytes into a base64 string.
3030
*
31-
* # Example
31+
* *Example*:
3232
*
33-
* ~~~ {.rust}
33+
* ~~~~
3434
* extern mod std;
3535
* use std::base64::ToBase64;
3636
*
3737
* fn main () {
3838
* let str = [52,32].to_base64();
3939
* println(fmt!("%s", str));
4040
* }
41-
* ~~~
41+
* ~~~~
4242
*/
4343
fn to_base64(&self) -> ~str {
4444
let mut s = ~"";
@@ -91,17 +91,17 @@ impl<'self> ToBase64 for &'self str {
9191
* Convert any string (literal, `@`, `&`, or `~`) to base64 encoding.
9292
*
9393
*
94-
* # Example
94+
* *Example*:
9595
*
96-
* ~~~ {.rust}
96+
* ~~~~
9797
* extern mod std;
9898
* use std::base64::ToBase64;
9999
*
100100
* fn main () {
101101
* let str = "Hello, World".to_base64();
102102
* println(fmt!("%s",str));
103103
* }
104-
* ~~~
104+
* ~~~~
105105
*
106106
*/
107107
fn to_base64(&self) -> ~str {
@@ -118,9 +118,9 @@ impl FromBase64 for ~[u8] {
118118
* Convert base64 `u8` vector into u8 byte values.
119119
* Every 4 encoded characters is converted into 3 octets, modulo padding.
120120
*
121-
* # Example
121+
* *Example*:
122122
*
123-
* ~~~ {.rust}
123+
* ~~~~
124124
* extern mod std;
125125
* use std::base64::ToBase64;
126126
* use std::base64::FromBase64;
@@ -131,7 +131,7 @@ impl FromBase64 for ~[u8] {
131131
* let bytes = str.from_base64();
132132
* println(fmt!("%?",bytes));
133133
* }
134-
* ~~~
134+
* ~~~~
135135
*/
136136
fn from_base64(&self) -> ~[u8] {
137137
if self.len() % 4u != 0u { fail!("invalid base64 length"); }
@@ -196,11 +196,11 @@ impl FromBase64 for ~str {
196196
* You can use the `from_bytes` function in `core::str`
197197
* to turn a `[u8]` into a string with characters corresponding to those values.
198198
*
199-
* # Example
199+
* *Example*:
200200
*
201201
* This converts a string literal to base64 and back.
202202
*
203-
* ~~~ {.rust}
203+
* ~~~~
204204
* extern mod std;
205205
* use std::base64::ToBase64;
206206
* use std::base64::FromBase64;
@@ -214,7 +214,7 @@ impl FromBase64 for ~str {
214214
* let result_str = str::from_bytes(bytes);
215215
* println(fmt!("%s",result_str));
216216
* }
217-
* ~~~
217+
* ~~~~
218218
*/
219219
fn from_base64(&self) -> ~[u8] {
220220
str::to_bytes(*self).from_base64()

branches/snap-stage3/src/libextra/bitv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1197,7 +1197,7 @@ mod tests {
11971197
#[test]
11981198
fn test_from_bytes() {
11991199
let bitv = from_bytes([0b10110110, 0b00000000, 0b11111111]);
1200-
let str = ~"10110110" + "00000000" + "11111111";
1200+
let str = ~"10110110" + ~"00000000" + ~"11111111";
12011201
assert_eq!(bitv.to_str(), str);
12021202
}
12031203

branches/snap-stage3/src/libextra/deque.rs

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -125,31 +125,6 @@ pub impl<T> Deque<T> {
125125
self.hi = (self.hi + 1u) % self.elts.len();
126126
self.nelts += 1u;
127127
}
128-
129-
/// Reserve capacity for exactly `n` elements in the given deque,
130-
/// doing nothing if `self`'s capacity is already equal to or greater
131-
/// than the requested capacity
132-
///
133-
/// # Arguments
134-
///
135-
/// * n - The number of elements to reserve space for
136-
fn reserve(&mut self, n: uint) {
137-
vec::reserve(&mut self.elts, n);
138-
}
139-
140-
/// Reserve capacity for at least `n` elements in the given deque,
141-
/// over-allocating in case the caller needs to reserve additional
142-
/// space.
143-
///
144-
/// Do nothing if `self`'s capacity is already equal to or greater
145-
/// than the requested capacity.
146-
///
147-
/// # Arguments
148-
///
149-
/// * n - The number of elements to reserve space for
150-
fn reserve_at_least(&mut self, n: uint) {
151-
vec::reserve_at_least(&mut self.elts, n);
152-
}
153128
}
154129

155130
/// Grow is only called on full elts, so nelts is also len(elts), unlike
@@ -174,7 +149,6 @@ mod tests {
174149
use super::*;
175150
use core::cmp::Eq;
176151
use core::kinds::Copy;
177-
use core::vec::capacity;
178152

179153
#[test]
180154
fn test_simple() {
@@ -354,29 +328,4 @@ mod tests {
354328
}
355329

356330
}
357-
358-
#[test]
359-
fn test_reserve() {
360-
let mut d = Deque::new();
361-
d.add_back(0u64);
362-
d.reserve(50);
363-
assert_eq!(capacity(&mut d.elts), 50);
364-
let mut d = Deque::new();
365-
d.add_back(0u32);
366-
d.reserve(50);
367-
assert_eq!(capacity(&mut d.elts), 50);
368-
}
369-
370-
#[test]
371-
fn test_reserve_at_least() {
372-
let mut d = Deque::new();
373-
d.add_back(0u64);
374-
d.reserve_at_least(50);
375-
assert_eq!(capacity(&mut d.elts), 64);
376-
let mut d = Deque::new();
377-
d.add_back(0u32);
378-
d.reserve_at_least(50);
379-
assert_eq!(capacity(&mut d.elts), 64);
380-
}
381-
382331
}

branches/snap-stage3/src/libextra/flatpipes.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ports and channels.
2525
2626
This example sends boxed integers across tasks using serialization.
2727
28-
~~~ {.rust}
28+
~~~
2929
let (port, chan) = serial::pipe_stream();
3030
3131
do task::spawn || {
@@ -927,7 +927,7 @@ mod test {
927927
fn test_try_recv_none3<P:BytePort>(loader: PortLoader<P>) {
928928
static CONTINUE: [u8, ..4] = [0xAA, 0xBB, 0xCC, 0xDD];
929929
// The control word is followed by garbage
930-
let bytes = CONTINUE.to_vec() + [0];
930+
let bytes = CONTINUE.to_vec() + ~[0];
931931
let port = loader(bytes);
932932
let res: Option<int> = port.try_recv();
933933
assert!(res.is_none());
@@ -951,7 +951,7 @@ mod test {
951951
1, sys::size_of::<u64>()) |len_bytes| {
952952
len_bytes.to_vec()
953953
};
954-
let bytes = CONTINUE.to_vec() + len_bytes + [0, 0, 0, 0];
954+
let bytes = CONTINUE.to_vec() + len_bytes + ~[0, 0, 0, 0];
955955

956956
let port = loader(bytes);
957957

branches/snap-stage3/src/libextra/future.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*
1515
* # Example
1616
*
17-
* ~~~ {.rust}
17+
* ~~~
1818
* # fn fib(n: uint) -> uint {42};
1919
* # fn make_a_sandwich() {};
2020
* let mut delayed_fib = std::future::spawn (|| fib(5000) );

branches/snap-stage3/src/libextra/json.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1880,13 +1880,13 @@ mod tests {
18801880
]));
18811881
assert_eq!(result::unwrap(from_str(
18821882
~"{" +
1883-
"\"a\": 1.0, " +
1884-
"\"b\": [" +
1885-
"true," +
1886-
"\"foo\\nbar\", " +
1887-
"{ \"c\": {\"d\": null} } " +
1888-
"]" +
1889-
"}")),
1883+
~"\"a\": 1.0, " +
1884+
~"\"b\": [" +
1885+
~"true," +
1886+
~"\"foo\\nbar\", " +
1887+
~"{ \"c\": {\"d\": null} } " +
1888+
~"]" +
1889+
~"}")),
18901890
mk_object([
18911891
(~"a", Number(1.0f)),
18921892
(~"b", List(~[

branches/snap-stage3/src/libextra/net_ip.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ mod test {
375375
use uv;
376376

377377
use core::result;
378+
use core::vec;
378379

379380
#[test]
380381
fn test_ip_ipv4_parse_and_format_ip() {

branches/snap-stage3/src/libextra/net_tcp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ fn read_future(sock: &TcpSocket, timeout_msecs: uint)
466466
* Here, the `new_conn` is used in conjunction with `accept` from within
467467
* a task spawned by the `new_connect_cb` passed into `listen`
468468
*
469-
* ~~~ {.rust}
469+
* ~~~~~~~~~~~
470470
* do net::tcp::listen(remote_ip, remote_port, backlog, iotask,
471471
* // this callback is ran once after the connection is successfully
472472
* // set up
@@ -497,7 +497,7 @@ fn read_future(sock: &TcpSocket, timeout_msecs: uint)
497497
* None => ()
498498
* }
499499
* };
500-
* ~~~
500+
* ~~~~~~~~~~~
501501
*
502502
* # Arguments
503503
*

branches/snap-stage3/src/libextra/sha1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ mod tests {
317317
Test {
318318
input:
319319
~"abcdbcdecdefdefgefghfghighij" +
320-
"hijkijkljklmklmnlmnomnopnopq",
320+
~"hijkijkljklmklmnlmnomnopnopq",
321321
output: ~[
322322
0x84u8, 0x98u8, 0x3Eu8, 0x44u8,
323323
0x1Cu8, 0x3Bu8, 0xD2u8, 0x6Eu8,

branches/snap-stage3/src/libextra/sort.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,8 @@ fn shift_vec<T:Copy>(dest: &mut [T],
746746

747747
#[cfg(test)]
748748
mod test_qsort3 {
749+
use core::prelude::*;
750+
749751
use sort::*;
750752

751753
use core::vec;

branches/snap-stage3/src/libextra/sync.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -545,10 +545,7 @@ pub impl RWlock {
545545
* the meantime (such as unlocking and then re-locking as a reader would
546546
* do). The block takes a "write mode token" argument, which can be
547547
* transformed into a "read mode token" by calling downgrade(). Example:
548-
*
549-
* # Example
550-
*
551-
* ~~~ {.rust}
548+
* ~~~
552549
* do lock.write_downgrade |write_mode| {
553550
* do (&write_mode).write_cond |condvar| {
554551
* ... exclusive access ...
@@ -720,6 +717,7 @@ mod tests {
720717

721718
use core::cast;
722719
use core::cell::Cell;
720+
use core::ptr;
723721
use core::result;
724722
use core::task;
725723
use core::vec;

branches/snap-stage3/src/libextra/tempfile.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ mod tests {
3030
use core::prelude::*;
3131

3232
use tempfile::mkdtemp;
33+
use tempfile;
3334
use core::os;
3435

3536
#[test]

branches/snap-stage3/src/libextra/time.rs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -22,11 +22,11 @@ pub mod rustrt {
2222
pub unsafe fn precise_time_ns(ns: &mut u64);
2323

2424
pub unsafe fn rust_tzset();
25-
25+
// FIXME: The i64 values can be passed by-val when #2064 is fixed.
2626
pub unsafe fn rust_gmtime(sec: i64, nsec: i32, result: &mut Tm);
2727
pub unsafe fn rust_localtime(sec: i64, nsec: i32, result: &mut Tm);
28-
pub unsafe fn rust_timegm(tm: &Tm) -> i64;
29-
pub unsafe fn rust_mktime(tm: &Tm) -> i64;
28+
pub unsafe fn rust_timegm(tm: &Tm, sec: &mut i64);
29+
pub unsafe fn rust_mktime(tm: &Tm, sec: &mut i64);
3030
}
3131
}
3232

@@ -177,11 +177,12 @@ pub impl Tm {
177177
/// Convert time to the seconds from January 1, 1970
178178
fn to_timespec(&self) -> Timespec {
179179
unsafe {
180-
let sec = match self.tm_gmtoff {
181-
0_i32 => rustrt::rust_timegm(self),
182-
_ => rustrt::rust_mktime(self)
183-
};
184-
180+
let mut sec = 0i64;
181+
if self.tm_gmtoff == 0_i32 {
182+
rustrt::rust_timegm(self, &mut sec);
183+
} else {
184+
rustrt::rust_mktime(self, &mut sec);
185+
}
185186
Timespec::new(sec, self.tm_nsec)
186187
}
187188
}
@@ -1205,8 +1206,8 @@ mod tests {
12051206
// abbreviation.
12061207
let rfc822 = local.rfc822();
12071208
let prefix = ~"Fri, 13 Feb 2009 15:31:30 ";
1208-
assert!(rfc822 == prefix + "PST" ||
1209-
rfc822 == prefix + "Pacific Standard Time");
1209+
assert!(rfc822 == prefix + ~"PST" ||
1210+
rfc822 == prefix + ~"Pacific Standard Time");
12101211
12111212
assert_eq!(local.ctime(), ~"Fri Feb 13 15:31:30 2009");
12121213
assert_eq!(local.rfc822z(), ~"Fri, 13 Feb 2009 15:31:30 -0800");

0 commit comments

Comments
 (0)