@@ -268,6 +268,7 @@ pub trait Char {
268
268
/// # Failure
269
269
///
270
270
/// Fails if given a radix > 36.
271
+ #[ unstable = "pending error conventions" ]
271
272
fn is_digit ( & self , radix : uint ) -> bool ;
272
273
273
274
/// Converts a character to the corresponding digit.
@@ -281,6 +282,7 @@ pub trait Char {
281
282
/// # Failure
282
283
///
283
284
/// Fails if given a radix outside the range [0..36].
285
+ #[ unstable = "pending error conventions, trait organization" ]
284
286
fn to_digit ( & self , radix : uint ) -> Option < uint > ;
285
287
286
288
/// Converts a number to the character representing it.
@@ -307,6 +309,7 @@ pub trait Char {
307
309
/// * Characters in [0,0xff] get 2-digit escapes: `\\xNN`
308
310
/// * Characters in [0x100,0xffff] get 4-digit escapes: `\\uNNNN`.
309
311
/// * Characters above 0x10000 get 8-digit escapes: `\\UNNNNNNNN`.
312
+ #[ unstable = "pending error conventions, trait organization" ]
310
313
fn escape_unicode ( & self , f: |char|) ;
311
314
312
315
/// Returns a 'default' ASCII and C++11-like literal escape of a
@@ -321,6 +324,7 @@ pub trait Char {
321
324
/// escaped.
322
325
/// * Any other chars in the range [0x20,0x7e] are not escaped.
323
326
/// * Any other chars are given hex Unicode escapes; see `escape_unicode`.
327
+ #[ unstable = "pending error conventions, trait organization" ]
324
328
fn escape_default ( & self , f: |char|) ;
325
329
326
330
/// Returns the amount of bytes this character would need if encoded in
@@ -330,24 +334,28 @@ pub trait Char {
330
334
331
335
/// Returns the amount of bytes this character would need if encoded in
332
336
/// UTF-8.
337
+ #[ unstable = "pending trait organization" ]
333
338
fn len_utf8 ( & self ) -> uint ;
334
339
335
340
/// Returns the amount of bytes this character would need if encoded in
336
341
/// UTF-16.
342
+ #[ unstable = "pending trait organization" ]
337
343
fn len_utf16 ( & self ) -> uint ;
338
344
339
345
/// Encodes this character as UTF-8 into the provided byte buffer,
340
346
/// and then returns the number of bytes written.
341
347
///
342
348
/// If the buffer is not large enough, nothing will be written into it
343
349
/// and a `None` will be returned.
350
+ #[ unstable = "pending trait organization" ]
344
351
fn encode_utf8 ( & self , dst : & mut [ u8 ] ) -> Option < uint > ;
345
352
346
353
/// Encodes this character as UTF-16 into the provided `u16` buffer,
347
354
/// and then returns the number of `u16`s written.
348
355
///
349
356
/// If the buffer is not large enough, nothing will be written into it
350
357
/// and a `None` will be returned.
358
+ #[ unstable = "pending trait organization" ]
351
359
fn encode_utf16 ( & self , dst : & mut [ u16 ] ) -> Option < uint > ;
352
360
}
353
361
@@ -356,8 +364,10 @@ impl Char for char {
356
364
#[ deprecated = "use is_digit" ]
357
365
fn is_digit_radix ( & self , radix : uint ) -> bool { is_digit_radix ( * self , radix) }
358
366
367
+ #[ unstable = "pending trait organization" ]
359
368
fn is_digit ( & self , radix : uint ) -> bool { is_digit_radix ( * self , radix) }
360
369
370
+ #[ unstable = "pending trait organization" ]
361
371
fn to_digit ( & self , radix : uint ) -> Option < uint > { to_digit ( * self , radix) }
362
372
363
373
#[ deprecated = "use the char::from_digit free function" ]
@@ -367,24 +377,29 @@ impl Char for char {
367
377
#[ deprecated = "use the char::from_u32 free function" ]
368
378
fn from_u32 ( i : u32 ) -> Option < char > { from_u32 ( i) }
369
379
380
+ #[ unstable = "pending error conventions, trait organization" ]
370
381
fn escape_unicode ( & self , f: |char|) { escape_unicode ( * self , f) }
371
382
383
+ #[ unstable = "pending error conventions, trait organization" ]
372
384
fn escape_default ( & self , f: |char|) { escape_default ( * self , f) }
373
385
374
386
#[ inline]
375
387
#[ deprecated = "use len_utf8" ]
376
388
fn len_utf8_bytes ( & self ) -> uint { len_utf8_bytes ( * self ) }
377
389
378
390
#[ inline]
391
+ #[ unstable = "pending trait organization" ]
379
392
fn len_utf8 ( & self ) -> uint { len_utf8_bytes ( * self ) }
380
393
381
394
#[ inline]
395
+ #[ unstable = "pending trait organization" ]
382
396
fn len_utf16 ( & self ) -> uint {
383
397
let ch = * self as u32 ;
384
398
if ( ch & 0xFFFF_u32 ) == ch { 1 } else { 2 }
385
399
}
386
400
387
401
#[ inline]
402
+ #[ unstable = "pending error conventions, trait organization" ]
388
403
fn encode_utf8 < ' a > ( & self , dst : & ' a mut [ u8 ] ) -> Option < uint > {
389
404
// Marked #[inline] to allow llvm optimizing it away
390
405
let code = * self as u32 ;
@@ -412,6 +427,7 @@ impl Char for char {
412
427
}
413
428
414
429
#[ inline]
430
+ #[ unstable = "pending error conventions, trait organization" ]
415
431
fn encode_utf16 ( & self , dst : & mut [ u16 ] ) -> Option < uint > {
416
432
// Marked #[inline] to allow llvm optimizing it away
417
433
let mut ch = * self as u32 ;
0 commit comments