Skip to content

Commit d5c001b

Browse files
committed
---
yaml --- r: 142521 b: refs/heads/try2 c: 17b3712 h: refs/heads/master i: 142519: aa50b97 v: v3
1 parent e4dbec7 commit d5c001b

24 files changed

+94
-154
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: 30c8aac677a754e0d4ebc16f261618f15d15a6e2
8+
refs/heads/try2: 17b3712487a4cf2be30e6bd43e89a736a7d86908
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,11 @@ endif
139139

140140
# version-string calculation
141141
CFG_GIT_DIR := $(CFG_SRC_DIR).git
142-
CFG_RELEASE = 0.8-pre
142+
CFG_RELEASE = 0.7
143143
CFG_VERSION = $(CFG_RELEASE)
144144
# windows exe's need numeric versions - don't use anything but
145145
# numbers and dots here
146-
CFG_VERSION_WIN = 0.8
146+
CFG_VERSION_WIN = 0.7
147147

148148
ifneq ($(wildcard $(CFG_GIT)),)
149149
ifneq ($(wildcard $(CFG_GIT_DIR)),)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<!ENTITY rustIdent "[a-zA-Z_][a-zA-Z_0-9]*">
88
<!ENTITY rustIntSuf "([iu](8|16|32|64)?)?">
99
]>
10-
<language name="Rust" version="0.8-pre" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15">
10+
<language name="Rust" version="0.7" kateversion="2.4" section="Sources" extensions="*.rs;*.rc" mimetype="text/x-rust" priority="15">
1111
<highlighting>
1212
<list name="fn">
1313
<item> fn </item>

branches/try2/src/libextra/extra.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Rust extras are part of the standard Rust distribution.
2121
*/
2222

2323
#[link(name = "extra",
24-
vers = "0.8-pre",
24+
vers = "0.7",
2525
uuid = "122bed0b-c19b-4b82-b0b7-7ae8aead7297",
2626
url = "https://github.com/mozilla/rust/tree/master/src/libextra")];
2727

branches/try2/src/libextra/json.rs

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -481,30 +481,22 @@ pub fn to_pretty_str(json: &Json) -> ~str {
481481
io::with_str_writer(|wr| to_pretty_writer(wr, json))
482482
}
483483

484-
static BUF_SIZE : uint = 64000;
485-
486484
#[allow(missing_doc)]
487485
pub struct Parser {
488486
priv rdr: @io::Reader,
489-
priv buf: ~[char],
490-
priv buf_idx: uint,
491487
priv ch: char,
492488
priv line: uint,
493489
priv col: uint,
494490
}
495491

496492
/// Decode a json value from an io::reader
497493
pub fn Parser(rdr: @io::Reader) -> Parser {
498-
let mut p = Parser {
494+
Parser {
499495
rdr: rdr,
500-
buf: rdr.read_chars(BUF_SIZE),
501-
buf_idx: 0,
502-
ch: 0 as char,
496+
ch: rdr.read_char(),
503497
line: 1,
504-
col: 0,
505-
};
506-
p.bump();
507-
p
498+
col: 1,
499+
}
508500
}
509501

510502
impl Parser {
@@ -529,26 +521,13 @@ impl Parser {
529521
fn eof(&self) -> bool { self.ch == -1 as char }
530522

531523
fn bump(&mut self) {
532-
if self.eof() {
533-
return;
534-
}
535-
536-
self.col += 1u;
537-
538-
if self.buf_idx >= self.buf.len() {
539-
self.buf = self.rdr.read_chars(BUF_SIZE);
540-
if self.buf.len() == 0 {
541-
self.ch = -1 as char;
542-
return;
543-
}
544-
self.buf_idx = 0;
545-
}
546-
self.ch = self.buf[self.buf_idx];
547-
self.buf_idx += 1;
524+
self.ch = self.rdr.read_char();
548525

549526
if self.ch == '\n' {
550527
self.line += 1u;
551528
self.col = 1u;
529+
} else {
530+
self.col += 1u;
552531
}
553532
}
554533

@@ -1744,7 +1723,7 @@ mod tests {
17441723
assert_eq!(v, 0.4e-01f);
17451724
}
17461725
1747-
// FIXME: #7611: xfailed for now
1726+
#[test]
17481727
fn test_read_str() {
17491728
assert_eq!(from_str("\""),
17501729
Err(Error {line: 1u, col: 2u, msg: @~"EOF while parsing string"

branches/try2/src/librust/rust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// FIXME #2238 Make run only accept source that emits an executable
1414

1515
#[link(name = "rust",
16-
vers = "0.8-pre",
16+
vers = "0.7",
1717
uuid = "4a24da33-5cc8-4037-9352-2cbe9bd9d27c",
1818
url = "https://github.com/mozilla/rust/tree/master/src/rust")];
1919

branches/try2/src/librustc/front/std_inject.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use syntax::codemap::dummy_sp;
1818
use syntax::codemap;
1919
use syntax::fold;
2020

21-
static STD_VERSION: &'static str = "0.8-pre";
21+
static STD_VERSION: &'static str = "0.7";
2222

2323
pub fn maybe_inject_libstd_ref(sess: Session, crate: @ast::crate)
2424
-> @ast::crate {

branches/try2/src/librustc/front/test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ mod __test {
273273
*/
274274

275275
fn mk_std(cx: &TestCtxt) -> ast::view_item {
276-
let vers = ast::lit_str(@"0.8-pre");
276+
let vers = ast::lit_str(@"0.7");
277277
let vers = nospan(vers);
278278
let mi = ast::meta_name_value(@"vers", vers);
279279
let mi = nospan(mi);

branches/try2/src/librustc/rustc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#[link(name = "rustc",
12-
vers = "0.8-pre",
12+
vers = "0.7",
1313
uuid = "0ce89b41-2f92-459e-bbc1-8f5fe32f16cf",
1414
url = "https://github.com/mozilla/rust/tree/master/src/rustc")];
1515

branches/try2/src/librustdoc/rustdoc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
//! Rustdoc - The Rust documentation generator
1212
1313
#[link(name = "rustdoc",
14-
vers = "0.8-pre",
14+
vers = "0.7",
1515
uuid = "f8abd014-b281-484d-a0c3-26e3de8e2412",
1616
url = "https://github.com/mozilla/rust/tree/master/src/rustdoc")];
1717

branches/try2/src/librusti/rusti.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
*/
4545

4646
#[link(name = "rusti",
47-
vers = "0.8-pre",
47+
vers = "0.7",
4848
uuid = "7fb5bf52-7d45-4fee-8325-5ad3311149fc",
4949
url = "https://github.com/mozilla/rust/tree/master/src/rusti")];
5050

branches/try2/src/librustpkg/rustpkg.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// rustpkg - a package manager and build system for Rust
1212

1313
#[link(name = "rustpkg",
14-
vers = "0.8-pre",
14+
vers = "0.7",
1515
uuid = "25de5e6e-279e-4a20-845c-4cabae92daaf",
1616
url = "https://github.com/mozilla/rust/tree/master/src/librustpkg")];
1717

branches/try2/src/libstd/char.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ pub fn is_uppercase(c: char) -> bool { general_category::Lu(c) }
8282
///
8383
#[inline]
8484
pub fn is_whitespace(c: char) -> bool {
85-
c == ' '
86-
|| ('\x09' <= c && c <= '\x0d')
85+
('\x09' <= c && c <= '\x0d')
8786
|| general_category::Zs(c)
8887
|| general_category::Zl(c)
8988
|| general_category::Zp(c)

branches/try2/src/libstd/iterator.rs

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -245,25 +245,6 @@ pub trait IteratorUtil<A> {
245245
fn flat_map_<'r, B, U: Iterator<B>>(self, f: &'r fn(A) -> U)
246246
-> FlatMapIterator<'r, A, B, Self, U>;
247247

248-
/// Creates an iterator that calls a function with a reference to each
249-
/// element before yielding it. This is often useful for debugging an
250-
/// iterator pipeline.
251-
///
252-
/// # Example
253-
///
254-
/// ~~~ {.rust}
255-
///let xs = [1u, 4, 2, 3, 8, 9, 6];
256-
///let sum = xs.iter()
257-
/// .transform(|&x| x)
258-
/// .peek_(|&x| debug!("filtering %u", x))
259-
/// .filter(|&x| x % 2 == 0)
260-
/// .peek_(|&x| debug!("%u made it through", x))
261-
/// .sum();
262-
///println(sum.to_str());
263-
/// ~~~
264-
// FIXME: #5898: should be called `peek`
265-
fn peek_<'r>(self, f: &'r fn(&A)) -> PeekIterator<'r, A, Self>;
266-
267248
/// An adaptation of an external iterator to the for-loop protocol of rust.
268249
///
269250
/// # Example
@@ -461,12 +442,6 @@ impl<A, T: Iterator<A>> IteratorUtil<A> for T {
461442
FlatMapIterator{iter: self, f: f, subiter: None }
462443
}
463444

464-
// FIXME: #5898: should be called `peek`
465-
#[inline]
466-
fn peek_<'r>(self, f: &'r fn(&A)) -> PeekIterator<'r, A, T> {
467-
PeekIterator{iter: self, f: f}
468-
}
469-
470445
/// A shim implementing the `for` loop iteration protocol for iterator objects
471446
#[inline]
472447
fn advance(&mut self, f: &fn(A) -> bool) -> bool {
@@ -1066,32 +1041,6 @@ impl<'self, A, T: Iterator<A>, B, U: Iterator<B>> Iterator<B> for
10661041
}
10671042
}
10681043

1069-
/// An iterator that calls a function with a reference to each
1070-
/// element before yielding it.
1071-
pub struct PeekIterator<'self, A, T> {
1072-
priv iter: T,
1073-
priv f: &'self fn(&A)
1074-
}
1075-
1076-
impl<'self, A, T: Iterator<A>> Iterator<A> for PeekIterator<'self, A, T> {
1077-
#[inline]
1078-
fn next(&mut self) -> Option<A> {
1079-
let next = self.iter.next();
1080-
1081-
match next {
1082-
Some(ref a) => (self.f)(a),
1083-
None => ()
1084-
}
1085-
1086-
next
1087-
}
1088-
1089-
#[inline]
1090-
fn size_hint(&self) -> (uint, Option<uint>) {
1091-
self.iter.size_hint()
1092-
}
1093-
}
1094-
10951044
/// An iterator which just modifies the contained state throughout iteration.
10961045
pub struct UnfoldrIterator<'self, A, St> {
10971046
priv f: &'self fn(&mut St) -> Option<A>,
@@ -1287,20 +1236,6 @@ mod tests {
12871236
assert_eq!(i, ys.len());
12881237
}
12891238

1290-
#[test]
1291-
fn test_peek() {
1292-
let xs = [1u, 2, 3, 4];
1293-
let mut n = 0;
1294-
1295-
let ys = xs.iter()
1296-
.transform(|&x| x)
1297-
.peek_(|_| n += 1)
1298-
.collect::<~[uint]>();
1299-
1300-
assert_eq!(n, xs.len());
1301-
assert_eq!(xs, ys.as_slice());
1302-
}
1303-
13041239
#[test]
13051240
fn test_unfoldr() {
13061241
fn count(st: &mut uint) -> Option<uint> {

branches/try2/src/libstd/std.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ they contained the following prologue:
4949

5050

5151
#[link(name = "std",
52-
vers = "0.8-pre",
52+
vers = "0.7",
5353
uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8",
5454
url = "https://github.com/mozilla/rust/tree/master/src/libstd")];
5555

branches/try2/src/libstd/str.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,10 @@ static MAX_TWO_B: uint = 2048u;
750750
static TAG_THREE_B: uint = 224u;
751751
static MAX_THREE_B: uint = 65536u;
752752
static TAG_FOUR_B: uint = 240u;
753+
static MAX_FOUR_B: uint = 2097152u;
754+
static TAG_FIVE_B: uint = 248u;
755+
static MAX_FIVE_B: uint = 67108864u;
756+
static TAG_SIX_B: uint = 252u;
753757

754758
/**
755759
* A dummy trait to hold all the utility methods that we implement on strings.
@@ -2065,13 +2069,14 @@ impl OwnedStr for ~str {
20652069
/// Appends a character to the back of a string
20662070
#[inline]
20672071
fn push_char(&mut self, c: char) {
2068-
assert!(c as uint <= 0x10ffff); // FIXME: #7609: should be enforced on all `char`
20692072
unsafe {
20702073
let code = c as uint;
20712074
let nb = if code < MAX_ONE_B { 1u }
20722075
else if code < MAX_TWO_B { 2u }
20732076
else if code < MAX_THREE_B { 3u }
2074-
else { 4u };
2077+
else if code < MAX_FOUR_B { 4u }
2078+
else if code < MAX_FIVE_B { 5u }
2079+
else { 6u };
20752080
let len = self.len();
20762081
let new_len = len + nb;
20772082
self.reserve_at_least(new_len);
@@ -2097,6 +2102,21 @@ impl OwnedStr for ~str {
20972102
*ptr::mut_offset(buf, off + 2u) = (code >> 6u & 63u | TAG_CONT) as u8;
20982103
*ptr::mut_offset(buf, off + 3u) = (code & 63u | TAG_CONT) as u8;
20992104
}
2105+
5u => {
2106+
*ptr::mut_offset(buf, off) = (code >> 24u & 3u | TAG_FIVE_B) as u8;
2107+
*ptr::mut_offset(buf, off + 1u) = (code >> 18u & 63u | TAG_CONT) as u8;
2108+
*ptr::mut_offset(buf, off + 2u) = (code >> 12u & 63u | TAG_CONT) as u8;
2109+
*ptr::mut_offset(buf, off + 3u) = (code >> 6u & 63u | TAG_CONT) as u8;
2110+
*ptr::mut_offset(buf, off + 4u) = (code & 63u | TAG_CONT) as u8;
2111+
}
2112+
6u => {
2113+
*ptr::mut_offset(buf, off) = (code >> 30u & 1u | TAG_SIX_B) as u8;
2114+
*ptr::mut_offset(buf, off + 1u) = (code >> 24u & 63u | TAG_CONT) as u8;
2115+
*ptr::mut_offset(buf, off + 2u) = (code >> 18u & 63u | TAG_CONT) as u8;
2116+
*ptr::mut_offset(buf, off + 3u) = (code >> 12u & 63u | TAG_CONT) as u8;
2117+
*ptr::mut_offset(buf, off + 4u) = (code >> 6u & 63u | TAG_CONT) as u8;
2118+
*ptr::mut_offset(buf, off + 5u) = (code & 63u | TAG_CONT) as u8;
2119+
}
21002120
_ => {}
21012121
}
21022122
}

branches/try2/src/libsyntax/syntax.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
*/
1515

1616
#[link(name = "syntax",
17-
vers = "0.8-pre",
17+
vers = "0.7",
1818
uuid = "9311401b-d6ea-4cd9-a1d9-61f89499c645")];
1919

2020
#[license = "MIT/ASL2"];

branches/try2/src/test/compile-fail/borrowck-move-out-of-vec-tail.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn main() {
1111
Foo { string: ~"baz" }
1212
];
1313
match x {
14-
[first, ..tail] => {
14+
[_, ..tail] => {
1515
match tail {
1616
[Foo { string: a }, Foo { string: b }] => {
1717
//~^ ERROR cannot move out of dereference of & pointer

branches/try2/src/test/compile-fail/borrowck-vec-pattern-nesting.rs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,41 @@ fn b() {
1717
}
1818
}
1919

20+
fn c() {
21+
let mut vec = [~1, ~2, ~3];
22+
match vec {
23+
[_a, .._b] => {
24+
//~^ ERROR cannot move out
25+
26+
// Note: `_a` is *moved* here, but `b` is borrowing,
27+
// hence illegal.
28+
//
29+
// See comment in middle/borrowck/gather_loans/mod.rs
30+
// in the case covering these sorts of vectors.
31+
}
32+
_ => {}
33+
}
34+
let a = vec[0]; //~ ERROR use of partially moved value: `vec`
35+
}
36+
37+
fn d() {
38+
let mut vec = [~1, ~2, ~3];
39+
match vec {
40+
[.._a, _b] => {
41+
//~^ ERROR cannot move out
42+
}
43+
_ => {}
44+
}
45+
let a = vec[0]; //~ ERROR use of partially moved value: `vec`
46+
}
47+
48+
fn e() {
49+
let mut vec = [~1, ~2, ~3];
50+
match vec {
51+
[_a, _b, _c] => {}
52+
_ => {}
53+
}
54+
let a = vec[0]; //~ ERROR use of partially moved value: `vec`
55+
}
56+
2057
fn main() {}

0 commit comments

Comments
 (0)