From e71dab662046da3d4517fed47dd4468ba1a1ea8f Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Wed, 28 Sep 2016 17:55:15 +0000 Subject: [PATCH] Rename rustc_unicode to std_unicode All other cases of the rustc "namespace" identify crates that are part of the compiler, whereas this one is part of the standard library. By changing the name of this crate one can count on all "librustc" directories being part of the compiler. --- mk/crates.mk | 14 +++++++------- mk/tests.mk | 4 ++-- 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 +- src/rustc/std_shim/Cargo.lock | 18 +++++++++--------- 26 files changed, 45 insertions(+), 45 deletions(-) rename src/{librustc_unicode => libstd_unicode}/Cargo.toml (76%) 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 86bb3a8ca0ccc..141349c869a9b 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 +DEPS_syntax := std term serialize log arena libc rustc_bitflags std_unicode rustc_errors syntax_pos DEPS_syntax_ext := syntax syntax_pos rustc_errors fmt_macros rustc_macro DEPS_proc_macro := syntax syntax_pos rustc_plugin log DEPS_syntax_pos := serialize @@ -161,7 +161,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 @@ -172,7 +172,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 fc1f4b5561a78..fd1804b429049 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -15,14 +15,14 @@ # 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)) DEPS_collectionstest := $(eval $(call RUST_CRATE,collectionstest)) -TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system libc \ +TEST_TARGET_CRATES = $(filter-out core std_unicode alloc_system libc \ alloc_jemalloc panic_unwind \ panic_abort,$(TARGET_CRATES)) \ collectionstest coretest diff --git a/src/libcollections/Cargo.toml b/src/libcollections/Cargo.toml index 65d456e750f6f..d2f1937def633 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 c5a921693475a..d16730ccc8b45 100644 --- a/src/libcollections/lib.rs +++ b/src/libcollections/lib.rs @@ -57,7 +57,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 6a6b450e51863..d0d300460a2ed 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 cff0308d4af84..1d38b2a407637 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -62,8 +62,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 878581a4f296e..be0932b13f4a4 100644 --- a/src/libcollectionstest/lib.rs +++ b/src/libcollectionstest/lib.rs @@ -29,7 +29,7 @@ extern crate collections; extern crate test; -extern crate rustc_unicode; +extern crate std_unicode; use std::hash::{Hash, Hasher, SipHasher}; diff --git a/src/libcollectionstest/str.rs b/src/libcollectionstest/str.rs index 62e164a569aa6..bd10b4dee2964 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));)* } } @@ -1169,7 +1169,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 1652fb5a88d80..ede71e1d954ad 100644 --- a/src/libcollectionstest/string.rs +++ b/src/libcollectionstest/string.rs @@ -126,7 +126,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 a21d1229d358b..1d7ee6ab9bf0b 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 590bf478aa723..a825b1a624883 100644 --- a/src/libcoretest/lib.rs +++ b/src/libcoretest/lib.rs @@ -38,7 +38,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 bc599a8207656..44751f5ef3060 100644 --- a/src/librustc_errors/lib.rs +++ b/src/librustc_errors/lib.rs @@ -30,7 +30,7 @@ extern crate serialize; extern crate term; #[macro_use] 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 1ff84b95da6a4..2cacedaca4f83 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 1ab86cf7e8920..b0f2f56e7c4b0 100644 --- a/src/librustdoc/test.rs +++ b/src/librustdoc/test.rs @@ -367,7 +367,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 7cb02e2412c65..1fddae617d32f 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 21e6acc37f3d5..da9e4638d52b6 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 06609cfad152e..969aabda9bcd9 100644 --- a/src/libstd/io/mod.rs +++ b/src/libstd/io/mod.rs @@ -250,7 +250,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 912045453e086..1044fb3bd489c 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -314,7 +314,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 @@ -385,7 +385,7 @@ pub use core_collections::string; pub use core_collections::vec; #[stable(feature = "rust1", since = "1.0.0")] -pub use rustc_unicode::char; +pub use std_unicode::char; /* Exported macros */ diff --git a/src/librustc_unicode/Cargo.toml b/src/libstd_unicode/Cargo.toml similarity index 76% rename from src/librustc_unicode/Cargo.toml rename to src/libstd_unicode/Cargo.toml index 1f4213f0abe40..617ac8b074660 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 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 65bd717e01a82..b086658ee0d03 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 118ceb17ab4a4..ada13b52ee9c9 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -40,7 +40,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; diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs index 6c0e2425d37ad..f34f837505088 100644 --- a/src/libsyntax/parse/lexer/mod.rs +++ b/src/libsyntax/parse/lexer/mod.rs @@ -15,7 +15,7 @@ use errors::{FatalError, Handler, DiagnosticBuilder}; use ext::tt::transcribe::tt_next_token; use parse::token::{self, keywords, str_to_ident}; use str::char_at; -use rustc_unicode::property::Pattern_White_Space; +use std_unicode::property::Pattern_White_Space; use std::borrow::Cow; use std::char; diff --git a/src/rustc/std_shim/Cargo.lock b/src/rustc/std_shim/Cargo.lock index b460235545759..c713eb7b17f34 100644 --- a/src/rustc/std_shim/Cargo.lock +++ b/src/rustc/std_shim/Cargo.lock @@ -41,7 +41,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]] @@ -93,13 +93,6 @@ dependencies = [ "core 0.0.0", ] -[[package]] -name = "rustc_unicode" -version = "0.0.0" -dependencies = [ - "core 0.0.0", -] - [[package]] name = "std" version = "0.0.0" @@ -116,10 +109,17 @@ 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", ] +[[package]] +name = "std_unicode" +version = "0.0.0" +dependencies = [ + "core 0.0.0", +] + [[package]] name = "unwind" version = "0.0.0"