From 274777a1588660b11a278ef52366743d82eb63ab Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Tue, 29 Nov 2016 14:38:08 -0500 Subject: [PATCH] Rename 'librustc_unicode' crate to 'libstd_unicode'. Fixes #26554. --- mk/crates.mk | 14 +++++++------- mk/tests.mk | 2 +- src/Cargo.lock | 18 +++++++++--------- src/libcollections/Cargo.toml | 2 +- src/libcollections/lib.rs | 2 +- src/libcollections/str.rs | 8 ++++---- src/libcollections/string.rs | 4 ++-- src/libcollectionstest/lib.rs | 2 +- src/libcollectionstest/str.rs | 4 ++-- src/libcollectionstest/string.rs | 2 +- src/libcore/char.rs | 2 +- src/libcoretest/lib.rs | 2 +- src/librustc_errors/lib.rs | 2 +- src/librustdoc/lib.rs | 2 +- src/librustdoc/test.rs | 2 +- src/libserialize/lib.rs | 2 +- src/libstd/Cargo.toml | 2 +- src/libstd/io/mod.rs | 2 +- src/libstd/lib.rs | 4 ++-- .../Cargo.toml | 4 ++-- .../char.rs | 0 .../lib.rs | 2 +- .../tables.rs | 0 .../u_str.rs | 0 src/libsyntax/lib.rs | 2 +- src/libsyntax/parse/lexer/mod.rs | 2 +- 26 files changed, 44 insertions(+), 44 deletions(-) rename src/{librustc_unicode => libstd_unicode}/Cargo.toml (78%) rename src/{librustc_unicode => libstd_unicode}/char.rs (100%) rename src/{librustc_unicode => libstd_unicode}/lib.rs (98%) rename src/{librustc_unicode => libstd_unicode}/tables.rs (100%) rename src/{librustc_unicode => libstd_unicode}/u_str.rs (100%) diff --git a/mk/crates.mk b/mk/crates.mk index 7ae5846c54b..e871efa5b7c 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -52,7 +52,7 @@ TARGET_CRATES := libc std term \ getopts collections test rand \ compiler_builtins core alloc \ - rustc_unicode rustc_bitflags \ + std_unicode rustc_bitflags \ alloc_system alloc_jemalloc \ panic_abort panic_unwind unwind RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \ @@ -69,11 +69,11 @@ DEPS_compiler_builtins := core DEPS_alloc := core libc alloc_system DEPS_alloc_system := core libc DEPS_alloc_jemalloc := core libc native:jemalloc -DEPS_collections := core alloc rustc_unicode +DEPS_collections := core alloc std_unicode DEPS_libc := core DEPS_rand := core DEPS_rustc_bitflags := core -DEPS_rustc_unicode := core +DEPS_std_unicode := core DEPS_panic_abort := libc alloc DEPS_panic_unwind := libc alloc unwind DEPS_unwind := libc @@ -85,7 +85,7 @@ RUSTFLAGS1_panic_abort := -C panic=abort RUSTFLAGS2_panic_abort := -C panic=abort RUSTFLAGS3_panic_abort := -C panic=abort -DEPS_std := core libc rand alloc collections compiler_builtins rustc_unicode \ +DEPS_std := core libc rand alloc collections compiler_builtins std_unicode \ native:backtrace \ alloc_system panic_abort panic_unwind unwind DEPS_arena := std @@ -100,7 +100,7 @@ DEPS_serialize := std log DEPS_term := std DEPS_test := std getopts term native:rust_test_helpers -DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode rustc_errors syntax_pos rustc_data_structures +DEPS_syntax := std term serialize log arena libc rustc_bitflags std_unicode rustc_errors syntax_pos rustc_data_structures DEPS_syntax_ext := syntax syntax_pos rustc_errors fmt_macros proc_macro DEPS_syntax_pos := serialize DEPS_proc_macro_tokens := syntax syntax_pos log @@ -162,7 +162,7 @@ ONLY_RLIB_libc := 1 ONLY_RLIB_alloc := 1 ONLY_RLIB_rand := 1 ONLY_RLIB_collections := 1 -ONLY_RLIB_rustc_unicode := 1 +ONLY_RLIB_std_unicode := 1 ONLY_RLIB_rustc_bitflags := 1 ONLY_RLIB_alloc_system := 1 ONLY_RLIB_alloc_jemalloc := 1 @@ -173,7 +173,7 @@ ONLY_RLIB_unwind := 1 TARGET_SPECIFIC_alloc_jemalloc := 1 # Documented-by-default crates -DOC_CRATES := std alloc collections core libc rustc_unicode +DOC_CRATES := std alloc collections core libc std_unicode ifeq ($(CFG_DISABLE_JEMALLOC),) RUSTFLAGS_rustc_back := --cfg 'feature="jemalloc"' diff --git a/mk/tests.mk b/mk/tests.mk index 35ee7697a7a..345fc1679b0 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -15,7 +15,7 @@ # The names of crates that must be tested -# libcore/librustc_unicode tests are in a separate crate +# libcore/libstd_unicode tests are in a separate crate DEPS_coretest := $(eval $(call RUST_CRATE,coretest)) diff --git a/src/Cargo.lock b/src/Cargo.lock index ab1c1c453dd..5935ebc483a 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -73,7 +73,7 @@ version = "0.0.0" dependencies = [ "alloc 0.0.0", "core 0.0.0", - "rustc_unicode 0.0.0", + "std_unicode 0.0.0", ] [[package]] @@ -550,13 +550,6 @@ dependencies = [ "syntax_pos 0.0.0", ] -[[package]] -name = "rustc_unicode" -version = "0.0.0" -dependencies = [ - "core 0.0.0", -] - [[package]] name = "rustdoc" version = "0.0.0" @@ -604,7 +597,7 @@ dependencies = [ "panic_abort 0.0.0", "panic_unwind 0.0.0", "rand 0.0.0", - "rustc_unicode 0.0.0", + "std_unicode 0.0.0", "unwind 0.0.0", ] @@ -616,6 +609,13 @@ dependencies = [ "std 0.0.0", ] +[[package]] +name = "std_unicode" +version = "0.0.0" +dependencies = [ + "core 0.0.0", +] + [[package]] name = "syntax" version = "0.0.0" diff --git a/src/libcollections/Cargo.toml b/src/libcollections/Cargo.toml index 3056977d224..ab882fde9c2 100644 --- a/src/libcollections/Cargo.toml +++ b/src/libcollections/Cargo.toml @@ -10,7 +10,7 @@ path = "lib.rs" [dependencies] alloc = { path = "../liballoc" } core = { path = "../libcore" } -rustc_unicode = { path = "../librustc_unicode" } +std_unicode = { path = "../libstd_unicode" } [[test]] name = "collectionstest" diff --git a/src/libcollections/lib.rs b/src/libcollections/lib.rs index 08288b4de8b..17248214bae 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -59,7 +59,7 @@ #![no_std] -extern crate rustc_unicode; +extern crate std_unicode; extern crate alloc; #[cfg(test)] diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 48a74bdecbb..d4be0914f15 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -24,12 +24,12 @@ use core::str::pattern::Pattern; use core::str::pattern::{Searcher, ReverseSearcher, DoubleEndedSearcher}; use core::mem; use core::iter::FusedIterator; -use rustc_unicode::str::{UnicodeStr, Utf16Encoder}; +use std_unicode::str::{UnicodeStr, Utf16Encoder}; use vec_deque::VecDeque; use borrow::{Borrow, ToOwned}; use string::String; -use rustc_unicode; +use std_unicode; use vec::Vec; use slice::SliceConcatExt; use boxed::Box; @@ -54,7 +54,7 @@ pub use core::str::{from_utf8, Chars, CharIndices, Bytes}; #[stable(feature = "rust1", since = "1.0.0")] pub use core::str::{from_utf8_unchecked, ParseBoolError}; #[stable(feature = "rust1", since = "1.0.0")] -pub use rustc_unicode::str::SplitWhitespace; +pub use std_unicode::str::SplitWhitespace; #[stable(feature = "rust1", since = "1.0.0")] pub use core::str::pattern; @@ -1705,7 +1705,7 @@ impl str { } fn case_ignoreable_then_cased>(iter: I) -> bool { - use rustc_unicode::derived_property::{Cased, Case_Ignorable}; + use std_unicode::derived_property::{Cased, Case_Ignorable}; match iter.skip_while(|&c| Case_Ignorable(c)).next() { Some(c) => Cased(c), None => false, diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 348eb6fb5ff..a10fdde4315 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -63,8 +63,8 @@ use core::mem; use core::ops::{self, Add, AddAssign, Index, IndexMut}; use core::ptr; use core::str::pattern::Pattern; -use rustc_unicode::char::{decode_utf16, REPLACEMENT_CHARACTER}; -use rustc_unicode::str as unicode_str; +use std_unicode::char::{decode_utf16, REPLACEMENT_CHARACTER}; +use std_unicode::str as unicode_str; use borrow::{Cow, ToOwned}; use range::RangeArgument; diff --git a/src/libcollectionstest/lib.rs b/src/libcollectionstest/lib.rs index 1e08074b14d..7d696f2aebd 100644 --- a/src/libcollectionstest/lib.rs +++ b/src/libcollectionstest/lib.rs @@ -32,7 +32,7 @@ extern crate collections; extern crate test; -extern crate rustc_unicode; +extern crate std_unicode; use std::hash::{Hash, Hasher}; use std::collections::hash_map::DefaultHasher; diff --git a/src/libcollectionstest/str.rs b/src/libcollectionstest/str.rs index 14a0819d381..384579ce6b8 100644 --- a/src/libcollectionstest/str.rs +++ b/src/libcollectionstest/str.rs @@ -530,7 +530,7 @@ fn from_utf8_mostly_ascii() { #[test] fn test_is_utf16() { - use rustc_unicode::str::is_utf16; + use std_unicode::str::is_utf16; macro_rules! pos { ($($e:expr),*) => { { $(assert!(is_utf16($e));)* } } @@ -1186,7 +1186,7 @@ fn test_rev_split_char_iterator_no_trailing() { #[test] fn test_utf16_code_units() { - use rustc_unicode::str::Utf16Encoder; + use std_unicode::str::Utf16Encoder; assert_eq!(Utf16Encoder::new(vec!['é', '\u{1F4A9}'].into_iter()).collect::>(), [0xE9, 0xD83D, 0xDCA9]) } diff --git a/src/libcollectionstest/string.rs b/src/libcollectionstest/string.rs index 98de33bdaa8..4935e7a9ee9 100644 --- a/src/libcollectionstest/string.rs +++ b/src/libcollectionstest/string.rs @@ -132,7 +132,7 @@ fn test_from_utf16() { let s_as_utf16 = s.encode_utf16().collect::>(); let u_as_string = String::from_utf16(&u).unwrap(); - assert!(::rustc_unicode::str::is_utf16(&u)); + assert!(::std_unicode::str::is_utf16(&u)); assert_eq!(s_as_utf16, u); assert_eq!(u_as_string, s); diff --git a/src/libcore/char.rs b/src/libcore/char.rs index 966481e7b32..7f3ac13bac1 100644 --- a/src/libcore/char.rs +++ b/src/libcore/char.rs @@ -10,7 +10,7 @@ //! Character manipulation. //! -//! For more details, see ::rustc_unicode::char (a.k.a. std::char) +//! For more details, see ::std_unicode::char (a.k.a. std::char) #![allow(non_snake_case)] #![stable(feature = "core_char", since = "1.2.0")] diff --git a/src/libcoretest/lib.rs b/src/libcoretest/lib.rs index b8c01e570f5..92fb01e535c 100644 --- a/src/libcoretest/lib.rs +++ b/src/libcoretest/lib.rs @@ -40,7 +40,7 @@ extern crate core; extern crate test; extern crate libc; -extern crate rustc_unicode; +extern crate std_unicode; extern crate rand; mod any; diff --git a/src/librustc_errors/lib.rs b/src/librustc_errors/lib.rs index badee66b83d..ef472d0f059 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -32,7 +32,7 @@ extern crate term; extern crate log; #[macro_use] extern crate libc; -extern crate rustc_unicode; +extern crate std_unicode; extern crate serialize as rustc_serialize; // used by deriving extern crate syntax_pos; diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index 60ce7ea5395..35d14b3f8a6 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -47,7 +47,7 @@ extern crate serialize; #[macro_use] extern crate syntax; extern crate syntax_pos; extern crate test as testing; -extern crate rustc_unicode; +extern crate std_unicode; #[macro_use] extern crate log; extern crate rustc_errors as errors; diff --git a/src/librustdoc/test.rs b/src/librustdoc/test.rs index 009330065f3..13a793d3d4b 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -345,7 +345,7 @@ pub fn maketest(s: &str, cratename: Option<&str>, dont_insert_main: bool, } fn partition_source(s: &str) -> (String, String) { - use rustc_unicode::str::UnicodeStr; + use std_unicode::str::UnicodeStr; let mut after_header = false; let mut before = String::new(); diff --git a/src/libserialize/lib.rs b/src/libserialize/lib.rs index 884f24ddc4c..8d37c5e839b 100644 --- a/src/libserialize/lib.rs +++ b/src/libserialize/lib.rs @@ -42,7 +42,7 @@ Core encoding and decoding interfaces. #[cfg(test)] extern crate test; #[macro_use] extern crate log; -extern crate rustc_unicode; +extern crate std_unicode; extern crate collections; pub use self::serialize::{Decoder, Encoder, Decodable, Encodable}; diff --git a/src/libstd/Cargo.toml b/src/libstd/Cargo.toml index b9f52e20fdd..fcf84cb7169 100644 --- a/src/libstd/Cargo.toml +++ b/src/libstd/Cargo.toml @@ -20,7 +20,7 @@ core = { path = "../libcore" } libc = { path = "../rustc/libc_shim" } rand = { path = "../librand" } compiler_builtins = { path = "../libcompiler_builtins" } -rustc_unicode = { path = "../librustc_unicode" } +std_unicode = { path = "../libstd_unicode" } unwind = { path = "../libunwind" } [build-dependencies] diff --git a/src/libstd/io/mod.rs b/src/libstd/io/mod.rs index ad9ae5638b6..b3b89213df1 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -256,7 +256,7 @@ #![stable(feature = "rust1", since = "1.0.0")] use cmp; -use rustc_unicode::str as core_str; +use std_unicode::str as core_str; use error as std_error; use fmt; use result; diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 12dbbe3c469..a438eb6bea4 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -324,7 +324,7 @@ extern crate collections as core_collections; #[allow(deprecated)] extern crate rand as core_rand; extern crate alloc; -extern crate rustc_unicode; +extern crate std_unicode; extern crate libc; // We always need an unwinder currently for backtraces @@ -421,7 +421,7 @@ pub use core_collections::string; #[stable(feature = "rust1", since = "1.0.0")] pub use core_collections::vec; #[stable(feature = "rust1", since = "1.0.0")] -pub use rustc_unicode::char; +pub use std_unicode::char; pub mod f32; pub mod f64; diff --git a/src/librustc_unicode/Cargo.toml b/src/libstd_unicode/Cargo.toml similarity index 78% rename from src/librustc_unicode/Cargo.toml rename to src/libstd_unicode/Cargo.toml index e2b4afb2a51..28fbd3c1aa9 100644 --- a/src/librustc_unicode/Cargo.toml +++ b/src/libstd_unicode/Cargo.toml @@ -1,10 +1,10 @@ [package] authors = ["The Rust Project Developers"] -name = "rustc_unicode" +name = "std_unicode" version = "0.0.0" [lib] -name = "rustc_unicode" +name = "std_unicode" path = "lib.rs" test = false bench = false diff --git a/src/librustc_unicode/char.rs b/src/libstd_unicode/char.rs similarity index 100% rename from src/librustc_unicode/char.rs rename to src/libstd_unicode/char.rs diff --git a/src/librustc_unicode/lib.rs b/src/libstd_unicode/lib.rs similarity index 98% rename from src/librustc_unicode/lib.rs rename to src/libstd_unicode/lib.rs index 65bd717e01a..b086658ee0d 100644 --- a/src/librustc_unicode/lib.rs +++ b/src/libstd_unicode/lib.rs @@ -20,7 +20,7 @@ //! provide for basic string-related manipulations. This crate does not //! (yet) aim to provide a full set of Unicode tables. -#![crate_name = "rustc_unicode"] +#![crate_name = "std_unicode"] #![unstable(feature = "unicode", issue = "27783")] #![crate_type = "rlib"] #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", diff --git a/src/librustc_unicode/tables.rs b/src/libstd_unicode/tables.rs similarity index 100% rename from src/librustc_unicode/tables.rs rename to src/libstd_unicode/tables.rs diff --git a/src/librustc_unicode/u_str.rs b/src/libstd_unicode/u_str.rs similarity index 100% rename from src/librustc_unicode/u_str.rs rename to src/libstd_unicode/u_str.rs diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 5a1b0d4005e..8427a5005e2 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -43,7 +43,7 @@ extern crate term; extern crate libc; #[macro_use] extern crate log; #[macro_use] #[no_link] extern crate rustc_bitflags; -extern crate rustc_unicode; +extern crate std_unicode; pub extern crate rustc_errors as errors; extern crate syntax_pos; extern crate rustc_data_structures; diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 681dec0ab56..818742e4492 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -16,7 +16,7 @@ use ext::tt::transcribe::tt_next_token; use parse::token; use str::char_at; use symbol::{Symbol, keywords}; -use rustc_unicode::property::Pattern_White_Space; +use std_unicode::property::Pattern_White_Space; use std::borrow::Cow; use std::char;