@@ -228,8 +228,6 @@ impl str {
228
228
/// # Examples
229
229
///
230
230
/// ```
231
- /// #![feature(str_char)]
232
- ///
233
231
/// let s = "Löwe 老虎 Léopard";
234
232
/// assert!(s.is_char_boundary(0));
235
233
/// // start of `老`
@@ -242,12 +240,7 @@ impl str {
242
240
/// // third byte of `老`
243
241
/// assert!(!s.is_char_boundary(8));
244
242
/// ```
245
- #[ unstable( feature = "str_char" ,
246
- reason = "it is unclear whether this method pulls its weight \
247
- with the existence of the char_indices iterator or \
248
- this method may want to be replaced with checked \
249
- slicing",
250
- issue = "27754" ) ]
243
+ #[ stable( feature = "is_char_boundary" , since = "1.9.0" ) ]
251
244
#[ inline]
252
245
pub fn is_char_boundary ( & self , index : usize ) -> bool {
253
246
core_str:: StrExt :: is_char_boundary ( self , index)
@@ -374,6 +367,7 @@ impl str {
374
367
///
375
368
/// ```
376
369
/// #![feature(str_char)]
370
+ /// #![allow(deprecated)]
377
371
///
378
372
/// use std::str::CharRange;
379
373
///
@@ -408,6 +402,9 @@ impl str {
408
402
removed altogether",
409
403
issue = "27754" ) ]
410
404
#[ inline]
405
+ #[ rustc_deprecated( reason = "use slicing plus chars() plus len_utf8" ,
406
+ since = "1.9.0" ) ]
407
+ #[ allow( deprecated) ]
411
408
pub fn char_range_at ( & self , start : usize ) -> CharRange {
412
409
core_str:: StrExt :: char_range_at ( self , start)
413
410
}
@@ -432,6 +429,7 @@ impl str {
432
429
///
433
430
/// ```
434
431
/// #![feature(str_char)]
432
+ /// #![allow(deprecated)]
435
433
///
436
434
/// use std::str::CharRange;
437
435
///
@@ -466,6 +464,9 @@ impl str {
466
464
eventually removed altogether",
467
465
issue = "27754" ) ]
468
466
#[ inline]
467
+ #[ rustc_deprecated( reason = "use slicing plus chars().rev() plus len_utf8" ,
468
+ since = "1.9.0" ) ]
469
+ #[ allow( deprecated) ]
469
470
pub fn char_range_at_reverse ( & self , start : usize ) -> CharRange {
470
471
core_str:: StrExt :: char_range_at_reverse ( self , start)
471
472
}
@@ -481,6 +482,7 @@ impl str {
481
482
///
482
483
/// ```
483
484
/// #![feature(str_char)]
485
+ /// #![allow(deprecated)]
484
486
///
485
487
/// let s = "abπc";
486
488
/// assert_eq!(s.char_at(1), 'b');
@@ -495,6 +497,9 @@ impl str {
495
497
subslice",
496
498
issue = "27754" ) ]
497
499
#[ inline]
500
+ #[ allow( deprecated) ]
501
+ #[ rustc_deprecated( reason = "use slicing plus chars()" ,
502
+ since = "1.9.0" ) ]
498
503
pub fn char_at ( & self , i : usize ) -> char {
499
504
core_str:: StrExt :: char_at ( self , i)
500
505
}
@@ -511,6 +516,7 @@ impl str {
511
516
///
512
517
/// ```
513
518
/// #![feature(str_char)]
519
+ /// #![allow(deprecated)]
514
520
///
515
521
/// let s = "abπc";
516
522
/// assert_eq!(s.char_at_reverse(1), 'a');
@@ -523,6 +529,9 @@ impl str {
523
529
cases generate panics",
524
530
issue = "27754" ) ]
525
531
#[ inline]
532
+ #[ rustc_deprecated( reason = "use slicing plus chars().rev()" ,
533
+ since = "1.9.0" ) ]
534
+ #[ allow( deprecated) ]
526
535
pub fn char_at_reverse ( & self , i : usize ) -> char {
527
536
core_str:: StrExt :: char_at_reverse ( self , i)
528
537
}
@@ -541,6 +550,7 @@ impl str {
541
550
///
542
551
/// ```
543
552
/// #![feature(str_char)]
553
+ /// #![allow(deprecated)]
544
554
///
545
555
/// let s = "Łódź"; // \u{141}o\u{301}dz\u{301}
546
556
/// let (c, s1) = s.slice_shift_char().unwrap();
@@ -559,6 +569,9 @@ impl str {
559
569
and/or char_indices iterators",
560
570
issue = "27754" ) ]
561
571
#[ inline]
572
+ #[ rustc_deprecated( reason = "use chars() plus Chars::as_str" ,
573
+ since = "1.9.0" ) ]
574
+ #[ allow( deprecated) ]
562
575
pub fn slice_shift_char ( & self ) -> Option < ( char , & str ) > {
563
576
core_str:: StrExt :: slice_shift_char ( self )
564
577
}
0 commit comments