Skip to content

Commit aa2c142

Browse files
committed
---
yaml --- r: 169855 b: refs/heads/auto c: 0cb7a40 h: refs/heads/master i: 169853: 4f5685f 169851: 2b577c7 169847: 9562b02 169839: 60889f7 169823: e9463a8 169791: fa57186 169727: 358fb26 v: v3
1 parent 23f2f1f commit aa2c142

File tree

38 files changed

+5821
-620
lines changed

38 files changed

+5821
-620
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 8e83af6e879535c33fd83d247d16619e39e0b951
13+
refs/heads/auto: 0cb7a4062a3c69bb0c54f0c9136889a1006e4f62
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libcollections/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ mod std {
103103
mod prelude {
104104
// from core.
105105
pub use core::borrow::IntoCow;
106+
pub use core::char::Char;
106107
pub use core::clone::Clone;
107108
pub use core::cmp::{PartialEq, Eq, PartialOrd, Ord};
108109
pub use core::cmp::Ordering::{Less, Equal, Greater};
@@ -126,7 +127,7 @@ mod prelude {
126127

127128
// from other crates.
128129
pub use alloc::boxed::Box;
129-
pub use unicode::char::CharExt;
130+
pub use unicode::char::UnicodeChar;
130131

131132
// from collections.
132133
pub use slice::SliceConcatExt;

branches/auto/src/libcollections/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ use self::RecompositionState::*;
5555
use self::DecompositionType::*;
5656

5757
use core::borrow::{BorrowFrom, ToOwned};
58-
use core::char::CharExt;
58+
use core::char::Char;
5959
use core::clone::Clone;
6060
use core::iter::AdditiveIterator;
6161
use core::iter::{range, Iterator, IteratorExt};

branches/auto/src/libcore/char.rs

Lines changed: 32 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ pub const MAX: char = '\u{10ffff}';
6969

7070
/// Converts from `u32` to a `char`
7171
#[inline]
72-
#[stable]
72+
#[unstable = "pending decisions about costructors for primitives"]
7373
pub fn from_u32(i: u32) -> Option<char> {
7474
// catch out-of-bounds and surrogates
7575
if (i > MAX as u32) || (i >= 0xD800 && i <= 0xDFFF) {
@@ -92,7 +92,7 @@ pub fn from_u32(i: u32) -> Option<char> {
9292
/// Panics if given an `radix` > 36.
9393
///
9494
#[inline]
95-
#[unstable = "pending integer conventions"]
95+
#[unstable = "pending decisions about costructors for primitives"]
9696
pub fn from_digit(num: uint, radix: uint) -> Option<char> {
9797
if radix > 36 {
9898
panic!("from_digit: radix is too high (maximum 36)");
@@ -111,8 +111,8 @@ pub fn from_digit(num: uint, radix: uint) -> Option<char> {
111111
}
112112

113113
/// Basic `char` manipulations.
114-
#[stable]
115-
pub trait CharExt {
114+
#[experimental = "trait organization may change"]
115+
pub trait Char {
116116
/// Checks if a `char` parses as a numeric digit in the given radix.
117117
///
118118
/// Compared to `is_numeric()`, this function only recognizes the characters
@@ -126,7 +126,7 @@ pub trait CharExt {
126126
/// # Panics
127127
///
128128
/// Panics if given a radix > 36.
129-
#[unstable = "pending integer conventions"]
129+
#[unstable = "pending error conventions"]
130130
fn is_digit(self, radix: uint) -> bool;
131131

132132
/// Converts a character to the corresponding digit.
@@ -140,7 +140,7 @@ pub trait CharExt {
140140
/// # Panics
141141
///
142142
/// Panics if given a radix outside the range [0..36].
143-
#[unstable = "pending integer conventions"]
143+
#[unstable = "pending error conventions, trait organization"]
144144
fn to_digit(self, radix: uint) -> Option<uint>;
145145

146146
/// Returns an iterator that yields the hexadecimal Unicode escape
@@ -149,7 +149,7 @@ pub trait CharExt {
149149
/// All characters are escaped with Rust syntax of the form `\\u{NNNN}`
150150
/// where `NNNN` is the shortest hexadecimal representation of the code
151151
/// point.
152-
#[stable]
152+
#[unstable = "pending error conventions, trait organization"]
153153
fn escape_unicode(self) -> EscapeUnicode;
154154

155155
/// Returns an iterator that yields the 'default' ASCII and
@@ -164,44 +164,47 @@ pub trait CharExt {
164164
/// escaped.
165165
/// * Any other chars in the range [0x20,0x7e] are not escaped.
166166
/// * Any other chars are given hex Unicode escapes; see `escape_unicode`.
167-
#[stable]
167+
#[unstable = "pending error conventions, trait organization"]
168168
fn escape_default(self) -> EscapeDefault;
169169

170170
/// Returns the amount of bytes this character would need if encoded in
171171
/// UTF-8.
172-
#[stable]
172+
#[unstable = "pending trait organization"]
173173
fn len_utf8(self) -> uint;
174174

175175
/// Returns the amount of bytes this character would need if encoded in
176176
/// UTF-16.
177-
#[stable]
177+
#[unstable = "pending trait organization"]
178178
fn len_utf16(self) -> uint;
179179

180180
/// Encodes this character as UTF-8 into the provided byte buffer,
181181
/// and then returns the number of bytes written.
182182
///
183183
/// If the buffer is not large enough, nothing will be written into it
184184
/// and a `None` will be returned.
185-
#[stable]
186-
fn encode_utf8(self, dst: &mut [u8]) -> Option<uint>;
185+
#[unstable = "pending trait organization"]
186+
fn encode_utf8(&self, dst: &mut [u8]) -> Option<uint>;
187187

188188
/// Encodes this character as UTF-16 into the provided `u16` buffer,
189189
/// and then returns the number of `u16`s written.
190190
///
191191
/// If the buffer is not large enough, nothing will be written into it
192192
/// and a `None` will be returned.
193-
#[stable]
194-
fn encode_utf16(self, dst: &mut [u16]) -> Option<uint>;
193+
#[unstable = "pending trait organization"]
194+
fn encode_utf16(&self, dst: &mut [u16]) -> Option<uint>;
195195
}
196196

197-
#[stable]
198-
impl CharExt for char {
199-
#[unstable = "pending integer conventions"]
197+
#[experimental = "trait is experimental"]
198+
impl Char for char {
199+
#[unstable = "pending trait organization"]
200200
fn is_digit(self, radix: uint) -> bool {
201-
self.to_digit(radix).is_some()
201+
match self.to_digit(radix) {
202+
Some(_) => true,
203+
None => false,
204+
}
202205
}
203206

204-
#[unstable = "pending integer conventions"]
207+
#[unstable = "pending trait organization"]
205208
fn to_digit(self, radix: uint) -> Option<uint> {
206209
if radix > 36 {
207210
panic!("to_digit: radix is too high (maximum 36)");
@@ -216,12 +219,12 @@ impl CharExt for char {
216219
else { None }
217220
}
218221

219-
#[stable]
222+
#[unstable = "pending error conventions, trait organization"]
220223
fn escape_unicode(self) -> EscapeUnicode {
221224
EscapeUnicode { c: self, state: EscapeUnicodeState::Backslash }
222225
}
223226

224-
#[stable]
227+
#[unstable = "pending error conventions, trait organization"]
225228
fn escape_default(self) -> EscapeDefault {
226229
let init_state = match self {
227230
'\t' => EscapeDefaultState::Backslash('t'),
@@ -237,7 +240,7 @@ impl CharExt for char {
237240
}
238241

239242
#[inline]
240-
#[stable]
243+
#[unstable = "pending trait organization"]
241244
fn len_utf8(self) -> uint {
242245
let code = self as u32;
243246
match () {
@@ -249,17 +252,17 @@ impl CharExt for char {
249252
}
250253

251254
#[inline]
252-
#[stable]
255+
#[unstable = "pending trait organization"]
253256
fn len_utf16(self) -> uint {
254257
let ch = self as u32;
255258
if (ch & 0xFFFF_u32) == ch { 1 } else { 2 }
256259
}
257260

258261
#[inline]
259-
#[unstable = "pending decision about Iterator/Writer/Reader"]
260-
fn encode_utf8(self, dst: &mut [u8]) -> Option<uint> {
262+
#[unstable = "pending error conventions, trait organization"]
263+
fn encode_utf8<'a>(&self, dst: &'a mut [u8]) -> Option<uint> {
261264
// Marked #[inline] to allow llvm optimizing it away
262-
let code = self as u32;
265+
let code = *self as u32;
263266
if code < MAX_ONE_B && dst.len() >= 1 {
264267
dst[0] = code as u8;
265268
Some(1)
@@ -284,10 +287,10 @@ impl CharExt for char {
284287
}
285288

286289
#[inline]
287-
#[unstable = "pending decision about Iterator/Writer/Reader"]
288-
fn encode_utf16(self, dst: &mut [u16]) -> Option<uint> {
290+
#[unstable = "pending error conventions, trait organization"]
291+
fn encode_utf16(&self, dst: &mut [u16]) -> Option<uint> {
289292
// Marked #[inline] to allow llvm optimizing it away
290-
let mut ch = self as u32;
293+
let mut ch = *self as u32;
291294
if (ch & 0xFFFF_u32) == ch && dst.len() >= 1 {
292295
// The BMP falls through (assuming non-surrogate, as it should)
293296
dst[0] = ch as u16;
@@ -307,7 +310,6 @@ impl CharExt for char {
307310
/// An iterator over the characters that represent a `char`, as escaped by
308311
/// Rust's unicode escaping rules.
309312
#[derive(Clone)]
310-
#[stable]
311313
pub struct EscapeUnicode {
312314
c: char,
313315
state: EscapeUnicodeState
@@ -323,7 +325,6 @@ enum EscapeUnicodeState {
323325
Done,
324326
}
325327

326-
#[stable]
327328
impl Iterator for EscapeUnicode {
328329
type Item = char;
329330

@@ -369,7 +370,6 @@ impl Iterator for EscapeUnicode {
369370
/// An iterator over the characters that represent a `char`, escaped
370371
/// for maximum portability.
371372
#[derive(Clone)]
372-
#[stable]
373373
pub struct EscapeDefault {
374374
state: EscapeDefaultState
375375
}
@@ -382,7 +382,6 @@ enum EscapeDefaultState {
382382
Unicode(EscapeUnicode),
383383
}
384384

385-
#[stable]
386385
impl Iterator for EscapeDefault {
387386
type Item = char;
388387

branches/auto/src/libcore/fmt/float.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub use self::SignificantDigits::*;
1515
pub use self::SignFormat::*;
1616

1717
use char;
18-
use char::CharExt;
18+
use char::Char;
1919
use fmt;
2020
use iter::{IteratorExt, range};
2121
use num::{cast, Float, ToPrimitive};

branches/auto/src/libcore/fmt/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ impl<'a> Formatter<'a> {
388388
prefix: &str,
389389
buf: &str)
390390
-> Result {
391-
use char::CharExt;
391+
use char::Char;
392392
use fmt::rt::{FlagAlternate, FlagSignPlus, FlagSignAwareZeroPad};
393393

394394
let mut width = buf.len();
@@ -504,7 +504,7 @@ impl<'a> Formatter<'a> {
504504
fn with_padding<F>(&mut self, padding: uint, default: rt::Alignment, f: F) -> Result where
505505
F: FnOnce(&mut Formatter) -> Result,
506506
{
507-
use char::CharExt;
507+
use char::Char;
508508
let align = match self.align {
509509
rt::AlignUnknown => default,
510510
_ => self.align
@@ -613,7 +613,7 @@ impl Show for str {
613613

614614
impl Show for char {
615615
fn fmt(&self, f: &mut Formatter) -> Result {
616-
use char::CharExt;
616+
use char::Char;
617617

618618
let mut utf8 = [0u8; 4];
619619
let amt = self.encode_utf8(&mut utf8).unwrap_or(0);

branches/auto/src/libcore/num/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#![stable]
1616
#![allow(missing_docs)]
1717

18-
use char::CharExt;
18+
use char::Char;
1919
use clone::Clone;
2020
use cmp::{PartialEq, Eq};
2121
use cmp::{PartialOrd, Ord};

branches/auto/src/libcore/prelude.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ pub use mem::drop;
3838

3939
// Reexported types and traits
4040

41-
pub use char::CharExt;
41+
pub use char::Char;
4242
pub use clone::Clone;
4343
pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
4444
pub use iter::{Extend, IteratorExt};

0 commit comments

Comments
 (0)