@@ -59,13 +59,13 @@ use core::result::Result;
5959use core:: str as core_str;
6060use core:: str:: pattern:: Pattern ;
6161use core:: str:: pattern:: { Searcher , ReverseSearcher , DoubleEndedSearcher } ;
62- use unicode :: str:: { UnicodeStr , Utf16Encoder } ;
62+ use rustc_unicode :: str:: { UnicodeStr , Utf16Encoder } ;
6363
6464use core:: convert:: AsRef ;
6565use vec_deque:: VecDeque ;
6666use borrow:: { Borrow , ToOwned } ;
6767use string:: String ;
68- use unicode ;
68+ use rustc_unicode ;
6969use vec:: Vec ;
7070use slice:: SliceConcatExt ;
7171
@@ -78,7 +78,7 @@ pub use core::str::{Matches, RMatches};
7878pub use core:: str:: { MatchIndices , RMatchIndices } ;
7979pub use core:: str:: { from_utf8, Chars , CharIndices , Bytes } ;
8080pub use core:: str:: { from_utf8_unchecked, ParseBoolError } ;
81- pub use unicode :: str:: { Words , Graphemes , GraphemeIndices } ;
81+ pub use rustc_unicode :: str:: { Words , Graphemes , GraphemeIndices } ;
8282pub use core:: str:: pattern;
8383
8484/*
@@ -161,6 +161,9 @@ enum DecompositionType {
161161/// External iterator for a string decomposition's characters.
162162///
163163/// For use with the `std::iter` module.
164+ #[ allow( deprecated) ]
165+ #[ deprecated( reason = "use the crates.io `unicode-normalization` library instead" ,
166+ since = "1.0.0" ) ]
164167#[ derive( Clone ) ]
165168#[ unstable( feature = "unicode" ,
166169 reason = "this functionality may be replaced with a more generic \
@@ -172,6 +175,7 @@ pub struct Decompositions<'a> {
172175 sorted : bool
173176}
174177
178+ #[ allow( deprecated) ]
175179#[ stable( feature = "rust1" , since = "1.0.0" ) ]
176180impl < ' a > Iterator for Decompositions < ' a > {
177181 type Item = char ;
@@ -198,7 +202,7 @@ impl<'a> Iterator for Decompositions<'a> {
198202 {
199203 let callback = |d| {
200204 let class =
201- unicode :: char:: canonical_combining_class ( d) ;
205+ rustc_unicode :: char:: canonical_combining_class ( d) ;
202206 if class == 0 && !* sorted {
203207 canonical_sort ( buffer) ;
204208 * sorted = true ;
@@ -207,10 +211,10 @@ impl<'a> Iterator for Decompositions<'a> {
207211 } ;
208212 match self . kind {
209213 Canonical => {
210- unicode :: char:: decompose_canonical ( ch, callback)
214+ rustc_unicode :: char:: decompose_canonical ( ch, callback)
211215 }
212216 Compatible => {
213- unicode :: char:: decompose_compatible ( ch, callback)
217+ rustc_unicode :: char:: decompose_compatible ( ch, callback)
214218 }
215219 }
216220 }
@@ -254,6 +258,9 @@ enum RecompositionState {
254258/// External iterator for a string recomposition's characters.
255259///
256260/// For use with the `std::iter` module.
261+ #[ allow( deprecated) ]
262+ #[ deprecated( reason = "use the crates.io `unicode-normalization` library instead" ,
263+ since = "1.0.0" ) ]
257264#[ derive( Clone ) ]
258265#[ unstable( feature = "unicode" ,
259266 reason = "this functionality may be replaced with a more generic \
@@ -266,6 +273,7 @@ pub struct Recompositions<'a> {
266273 last_ccc : Option < u8 >
267274}
268275
276+ #[ allow( deprecated) ]
269277#[ stable( feature = "rust1" , since = "1.0.0" ) ]
270278impl < ' a > Iterator for Recompositions < ' a > {
271279 type Item = char ;
@@ -276,7 +284,7 @@ impl<'a> Iterator for Recompositions<'a> {
276284 match self . state {
277285 Composing => {
278286 for ch in self . iter . by_ref ( ) {
279- let ch_class = unicode :: char:: canonical_combining_class ( ch) ;
287+ let ch_class = rustc_unicode :: char:: canonical_combining_class ( ch) ;
280288 if self . composee . is_none ( ) {
281289 if ch_class != 0 {
282290 return Some ( ch) ;
@@ -288,7 +296,7 @@ impl<'a> Iterator for Recompositions<'a> {
288296
289297 match self . last_ccc {
290298 None => {
291- match unicode :: char:: compose ( k, ch) {
299+ match rustc_unicode :: char:: compose ( k, ch) {
292300 Some ( r) => {
293301 self . composee = Some ( r) ;
294302 continue ;
@@ -316,7 +324,7 @@ impl<'a> Iterator for Recompositions<'a> {
316324 self . last_ccc = Some ( ch_class) ;
317325 continue ;
318326 }
319- match unicode :: char:: compose ( k, ch) {
327+ match rustc_unicode :: char:: compose ( k, ch) {
320328 Some ( r) => {
321329 self . composee = Some ( r) ;
322330 continue ;
@@ -465,6 +473,9 @@ impl str {
465473
466474 /// Returns an iterator over the string in Unicode Normalization Form D
467475 /// (canonical decomposition).
476+ #[ allow( deprecated) ]
477+ #[ deprecated( reason = "use the crates.io `unicode-normalization` library instead" ,
478+ since = "1.0.0" ) ]
468479 #[ inline]
469480 #[ unstable( feature = "unicode" ,
470481 reason = "this functionality may be replaced with a more generic \
@@ -480,6 +491,9 @@ impl str {
480491
481492 /// Returns an iterator over the string in Unicode Normalization Form KD
482493 /// (compatibility decomposition).
494+ #[ allow( deprecated) ]
495+ #[ deprecated( reason = "use the crates.io `unicode-normalization` library instead" ,
496+ since = "1.0.0" ) ]
483497 #[ inline]
484498 #[ unstable( feature = "unicode" ,
485499 reason = "this functionality may be replaced with a more generic \
@@ -495,6 +509,9 @@ impl str {
495509
496510 /// An Iterator over the string in Unicode Normalization Form C
497511 /// (canonical decomposition followed by canonical composition).
512+ #[ allow( deprecated) ]
513+ #[ deprecated( reason = "use the crates.io `unicode-normalization` library instead" ,
514+ since = "1.0.0" ) ]
498515 #[ inline]
499516 #[ unstable( feature = "unicode" ,
500517 reason = "this functionality may be replaced with a more generic \
@@ -511,6 +528,9 @@ impl str {
511528
512529 /// An Iterator over the string in Unicode Normalization Form KC
513530 /// (compatibility decomposition followed by canonical composition).
531+ #[ allow( deprecated) ]
532+ #[ deprecated( reason = "use the crates.io `unicode-normalization` library instead" ,
533+ since = "1.0.0" ) ]
514534 #[ inline]
515535 #[ unstable( feature = "unicode" ,
516536 reason = "this functionality may be replaced with a more generic \
@@ -1690,6 +1710,8 @@ impl str {
16901710 ///
16911711 /// assert_eq!(&gr2[..], b);
16921712 /// ```
1713+ #[ deprecated( reason = "use the crates.io `unicode-segmentation` library instead" ,
1714+ since = "1.0.0" ) ]
16931715 #[ unstable( feature = "unicode" ,
16941716 reason = "this functionality may only be provided by libunicode" ) ]
16951717 pub fn graphemes ( & self , is_extended : bool ) -> Graphemes {
@@ -1709,6 +1731,8 @@ impl str {
17091731 ///
17101732 /// assert_eq!(&gr_inds[..], b);
17111733 /// ```
1734+ #[ deprecated( reason = "use the crates.io `unicode-segmentation` library instead" ,
1735+ since = "1.0.0" ) ]
17121736 #[ unstable( feature = "unicode" ,
17131737 reason = "this functionality may only be provided by libunicode" ) ]
17141738 pub fn grapheme_indices ( & self , is_extended : bool ) -> GraphemeIndices {
@@ -1749,6 +1773,8 @@ impl str {
17491773 /// recommends that these
17501774 /// characters be treated as 1 column (i.e., `is_cjk = false`) if the
17511775 /// locale is unknown.
1776+ #[ deprecated( reason = "use the crates.io `unicode-width` library instead" ,
1777+ since = "1.0.0" ) ]
17521778 #[ unstable( feature = "unicode" ,
17531779 reason = "this functionality may only be provided by libunicode" ) ]
17541780 pub fn width ( & self , is_cjk : bool ) -> usize {
0 commit comments