Skip to content

Commit d4bbef1

Browse files
committed
---
yaml --- r: 193918 b: refs/heads/beta c: c42067c h: refs/heads/master v: v3
1 parent dd32a55 commit d4bbef1

File tree

23 files changed

+173
-207
lines changed

23 files changed

+173
-207
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: e245e65ef8ddb8c047cafcd3d0c30f427a33e6c4
34+
refs/heads/beta: c42067c9e9ac605fc330c3ed11d29477ac251d8a
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/src/compiletest/runtest.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,22 +1052,22 @@ fn scan_char(haystack: &str, needle: char, idx: &mut uint) -> bool {
10521052
if *idx >= haystack.len() {
10531053
return false;
10541054
}
1055-
let ch = haystack.char_at(*idx);
1056-
if ch != needle {
1055+
let range = haystack.char_range_at(*idx);
1056+
if range.ch != needle {
10571057
return false;
10581058
}
1059-
*idx += ch.len_utf8();
1059+
*idx = range.next;
10601060
return true;
10611061
}
10621062

10631063
fn scan_integer(haystack: &str, idx: &mut uint) -> bool {
10641064
let mut i = *idx;
10651065
while i < haystack.len() {
1066-
let ch = haystack.char_at(i);
1067-
if ch < '0' || '9' < ch {
1066+
let range = haystack.char_range_at(i);
1067+
if range.ch < '0' || '9' < range.ch {
10681068
break;
10691069
}
1070-
i += ch.len_utf8();
1070+
i = range.next;
10711071
}
10721072
if i == *idx {
10731073
return false;
@@ -1083,9 +1083,9 @@ fn scan_string(haystack: &str, needle: &str, idx: &mut uint) -> bool {
10831083
if haystack_i >= haystack.len() {
10841084
return false;
10851085
}
1086-
let ch = haystack.char_at(haystack_i);
1087-
haystack_i += ch.len_utf8();
1088-
if !scan_char(needle, ch, &mut needle_i) {
1086+
let range = haystack.char_range_at(haystack_i);
1087+
haystack_i = range.next;
1088+
if !scan_char(needle, range.ch, &mut needle_i) {
10891089
return false;
10901090
}
10911091
}

branches/beta/src/libcollections/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
#![feature(unique)]
3636
#![feature(unsafe_no_drop_flag)]
3737
#![feature(step_by)]
38-
#![feature(str_char)]
3938
#![cfg_attr(test, feature(rand, rustc_private, test))]
4039
#![cfg_attr(test, allow(deprecated))] // rand
4140

branches/beta/src/libcollections/str.rs

Lines changed: 58 additions & 104 deletions
Large diffs are not rendered by default.

branches/beta/src/libcollections/string.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use unicode::str as unicode_str;
2929
use unicode::str::Utf16Item;
3030

3131
use borrow::{Cow, IntoCow};
32-
use str::{self, FromStr, Utf8Error};
32+
use str::{self, CharRange, FromStr, Utf8Error};
3333
use vec::{DerefVec, Vec, as_vec};
3434

3535
/// A growable string stored as a UTF-8 encoded buffer.
@@ -561,9 +561,9 @@ impl String {
561561
return None
562562
}
563563

564-
let ch = self.char_at_reverse(len);
564+
let CharRange {ch, next} = self.char_range_at_reverse(len);
565565
unsafe {
566-
self.vec.set_len(len - ch.len_utf8());
566+
self.vec.set_len(next);
567567
}
568568
Some(ch)
569569
}
@@ -595,8 +595,7 @@ impl String {
595595
let len = self.len();
596596
assert!(idx <= len);
597597

598-
let ch = self.char_at(idx);
599-
let next = idx + ch.len_utf8();
598+
let CharRange { ch, next } = self.char_range_at(idx);
600599
unsafe {
601600
ptr::copy(self.vec.as_mut_ptr().offset(idx as isize),
602601
self.vec.as_ptr().offset(next as isize),

branches/beta/src/libcore/str/mod.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
use self::OldSearcher::{TwoWay, TwoWayLong};
2020

21-
use char::CharExt;
2221
use clone::Clone;
2322
use cmp::{self, Eq};
2423
use default::Default;
@@ -1113,10 +1112,8 @@ static UTF8_CHAR_WIDTH: [u8; 256] = [
11131112
/// the next `char` in a string. This can be used as a data structure
11141113
/// for iterating over the UTF-8 bytes of a string.
11151114
#[derive(Copy)]
1116-
#[unstable(feature = "str_char",
1117-
reason = "existence of this struct is uncertain as it is frequently \
1118-
able to be replaced with char.len_utf8() and/or \
1119-
char/char_indices iterators")]
1115+
#[unstable(feature = "core",
1116+
reason = "naming is uncertain with container conventions")]
11201117
pub struct CharRange {
11211118
/// Current `char`
11221119
pub ch: char,
@@ -1649,8 +1646,8 @@ impl StrExt for str {
16491646
if self.is_empty() {
16501647
None
16511648
} else {
1652-
let ch = self.char_at(0);
1653-
let next_s = unsafe { self.slice_unchecked(ch.len_utf8(), self.len()) };
1649+
let CharRange {ch, next} = self.char_range_at(0);
1650+
let next_s = unsafe { self.slice_unchecked(next, self.len()) };
16541651
Some((ch, next_s))
16551652
}
16561653
}

branches/beta/src/libgetopts/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,11 @@
9292
html_playground_url = "http://play.rust-lang.org/")]
9393

9494
#![deny(missing_docs)]
95+
#![feature(collections)]
9596
#![feature(int_uint)]
9697
#![feature(staged_api)]
98+
#![feature(core)]
9799
#![feature(str_words)]
98-
#![feature(str_char)]
99100
#![cfg_attr(test, feature(rustc_private))]
100101

101102
#[cfg(test)] #[macro_use] extern crate log;
@@ -619,8 +620,8 @@ pub fn getopts(args: &[String], optgrps: &[OptGroup]) -> Result {
619620
let mut j = 1;
620621
names = Vec::new();
621622
while j < curlen {
622-
let ch = cur.char_at(j);
623-
let opt = Short(ch);
623+
let range = cur.char_range_at(j);
624+
let opt = Short(range.ch);
624625

625626
/* In a series of potential options (eg. -aheJ), if we
626627
see one which takes an argument, we assume all
@@ -641,13 +642,12 @@ pub fn getopts(args: &[String], optgrps: &[OptGroup]) -> Result {
641642
No => false
642643
};
643644

644-
let next = j + ch.len_utf8();
645-
if arg_follows && next < curlen {
646-
i_arg = Some((&cur[next..curlen]).to_string());
645+
if arg_follows && range.next < curlen {
646+
i_arg = Some((&cur[range.next..curlen]).to_string());
647647
break;
648648
}
649649

650-
j = next;
650+
j = range.next;
651651
}
652652
}
653653
let mut name_pos = 0;

branches/beta/src/liblibc/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,8 +269,8 @@ pub mod types {
269269
#[repr(C)]
270270
#[derive(Copy)] pub struct sockaddr_storage {
271271
pub ss_family: sa_family_t,
272-
pub __ss_align: isize,
273-
pub __ss_pad2: [u8; 128 - 2 * (::core::isize::BYTES as usize)],
272+
pub __ss_align: i64,
273+
pub __ss_pad2: [u8; 112],
274274
}
275275
#[repr(C)]
276276
#[derive(Copy)] pub struct sockaddr_in {

branches/beta/src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#![feature(io)]
4343
#![feature(path_ext)]
4444
#![feature(str_words)]
45-
#![feature(str_char)]
4645
#![cfg_attr(test, feature(test))]
4746

4847
extern crate arena;

branches/beta/src/librustc_driver/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
#![feature(exit_status)]
3939
#![feature(io)]
4040
#![feature(set_stdio)]
41-
#![feature(unicode)]
4241

4342
extern crate arena;
4443
extern crate flate;

branches/beta/src/librustc_lint/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#![feature(unsafe_destructor)]
4242
#![feature(staged_api)]
4343
#![feature(std_misc)]
44-
#![feature(str_char)]
4544
#![cfg_attr(test, feature(test))]
4645

4746
extern crate syntax;

branches/beta/src/librustc_typeck/check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5240,7 +5240,7 @@ pub fn may_break(cx: &ty::ctxt, id: ast::NodeId, b: &ast::Block) -> bool {
52405240
// inside the loop?
52415241
(loop_query(&*b, |e| {
52425242
match *e {
5243-
ast::ExprBreak(None) => true,
5243+
ast::ExprBreak(_) => true,
52445244
_ => false
52455245
}
52465246
})) ||

branches/beta/src/libserialize/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Core encoding and decoding interfaces.
3737
#![feature(staged_api)]
3838
#![feature(std_misc)]
3939
#![feature(unicode)]
40-
#![feature(str_char)]
4140
#![cfg_attr(test, feature(test))]
4241

4342
// test harness access

branches/beta/src/libstd/lib.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@
7373
//!
7474
//! ## Concurrency, I/O, and the runtime
7575
//!
76-
//! The [`thread`](thread/index.html) module contains Rust's threading abstractions.
77-
//! [`sync`](sync/index.html) contains further, primitive, shared memory types,
78-
//! including [`atomic`](sync/atomic/index.html), and [`mpsc`](sync/mpmc/index.html),
79-
//! which contains the channel types for message passing.
76+
//! The [`thread`](thread/index.html) module contains Rust's threading abstractions,
77+
//! while [`comm`](comm/index.html) contains the channel types for message
78+
//! passing. [`sync`](sync/index.html) contains further, primitive, shared
79+
//! memory types, including [`atomic`](sync/atomic/index.html).
8080
//!
8181
//! Common types of I/O, including files, TCP, UDP, pipes, Unix domain sockets,
8282
//! timers, and process spawning, are defined in the
@@ -127,7 +127,6 @@
127127
#![feature(int_uint)]
128128
#![feature(unique)]
129129
#![feature(allow_internal_unstable)]
130-
#![feature(str_char)]
131130
#![cfg_attr(test, feature(test, rustc_private))]
132131

133132
// Don't link to std. We are std.

branches/beta/src/libstd/net/ip.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ impl FromInner<libc::in_addr> for Ipv4Addr {
202202
impl Ipv6Addr {
203203
/// Create a new IPv6 address from eight 16-bit segments.
204204
///
205-
/// The result will represent the IP address a:b:c:d:e:f:g:h
205+
/// The result will represent the IP address a:b:c:d:e:f
206206
#[stable(feature = "rust1", since = "1.0.0")]
207207
pub fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16,
208208
h: u16) -> Ipv6Addr {

0 commit comments

Comments
 (0)