Reexport from core::unicode::char in core::char rather than vice versa

This commit is contained in:
Simon Sapin 2018-04-05 17:56:46 +02:00
parent 3613b0b52f
commit 939692409d
6 changed files with 19 additions and 26 deletions

View File

@ -56,6 +56,7 @@
#![stable(feature = "rust1", since = "1.0.0")]
use core::char::{decode_utf16, REPLACEMENT_CHARACTER};
use core::fmt;
use core::hash;
use core::iter::{FromIterator, FusedIterator};
@ -64,7 +65,6 @@ use core::ops::{self, Add, AddAssign, Index, IndexMut, RangeBounds};
use core::ptr;
use core::str::pattern::Pattern;
use core::str::lossy;
use core::unicode::char::{decode_utf16, REPLACEMENT_CHARACTER};
use borrow::{Cow, ToOwned};
use str::{self, from_boxed_utf8_unchecked, FromStr, Utf8Error, Chars};

View File

@ -132,7 +132,7 @@ fn test_from_utf16() {
let s_as_utf16 = s.encode_utf16().collect::<Vec<u16>>();
let u_as_string = String::from_utf16(&u).unwrap();
assert!(::core::unicode::char::decode_utf16(u.iter().cloned()).all(|r| r.is_ok()));
assert!(::core::char::decode_utf16(u.iter().cloned()).all(|r| r.is_ok()));
assert_eq!(s_as_utf16, u);
assert_eq!(u_as_string, s);

View File

@ -15,6 +15,18 @@
#![allow(non_snake_case)]
#![stable(feature = "core_char", since = "1.2.0")]
// stable re-exports
#[stable(feature = "rust1", since = "1.0.0")]
pub use unicode::char::{ToLowercase, ToUppercase};
#[stable(feature = "decode_utf16", since = "1.9.0")]
pub use unicode::char::{decode_utf16, DecodeUtf16, DecodeUtf16Error};
// unstable re-exports
#[unstable(feature = "unicode", issue = "27783")]
pub use unicode::tables::{UNICODE_VERSION};
#[unstable(feature = "unicode", issue = "27783")]
pub use unicode::version::UnicodeVersion;
mod printable;
use self::printable::is_printable;

View File

@ -28,31 +28,12 @@
#![stable(feature = "rust1", since = "1.0.0")]
use char::*;
use char::CharExt as C;
use iter::FusedIterator;
use fmt::{self, Write};
use unicode::tables::{conversions, derived_property, general_category, property};
// stable re-exports
#[stable(feature = "rust1", since = "1.0.0")]
pub use char::{MAX, from_digit, from_u32, from_u32_unchecked};
#[stable(feature = "rust1", since = "1.0.0")]
pub use char::{EscapeDebug, EscapeDefault, EscapeUnicode};
#[stable(feature = "decode_utf16", since = "1.9.0")]
pub use char::REPLACEMENT_CHARACTER;
#[stable(feature = "char_from_str", since = "1.20.0")]
pub use char::ParseCharError;
// unstable re-exports
#[stable(feature = "try_from", since = "1.26.0")]
pub use char::CharTryFromError;
#[unstable(feature = "decode_utf8", issue = "33906")]
pub use char::{DecodeUtf8, decode_utf8};
#[unstable(feature = "unicode", issue = "27783")]
pub use unicode::tables::{UNICODE_VERSION};
#[unstable(feature = "unicode", issue = "27783")]
pub use unicode::version::UnicodeVersion;
/// Returns an iterator that yields the lowercase equivalent of a `char`.
///
/// This `struct` is created by the [`to_lowercase`] method on [`char`]. See

View File

@ -12,11 +12,11 @@
#![allow(missing_docs)]
mod bool_trie;
mod tables;
mod version;
pub(crate) mod tables;
pub(crate) mod version;
pub mod str;
pub mod char;
pub(crate) mod char;
// For use in liballoc, not re-exported in libstd.
pub mod derived_property {

View File

@ -454,7 +454,7 @@ pub use alloc::string;
#[stable(feature = "rust1", since = "1.0.0")]
pub use alloc::vec;
#[stable(feature = "rust1", since = "1.0.0")]
pub use core::unicode::char;
pub use core::char;
#[stable(feature = "i128", since = "1.26.0")]
pub use core::u128;