Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove gensym in format_args #63114

Merged
merged 3 commits into from
Aug 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,6 @@ pub(crate) mod builtin {
#[stable(feature = "rust1", since = "1.0.0")]
#[allow_internal_unstable(fmt_internals)]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
pub macro format_args {
($fmt:expr) => ({ /* compiler built-in */ }),
($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ })
Expand All @@ -779,7 +778,6 @@ pub(crate) mod builtin {
language use and is subject to change")]
#[allow_internal_unstable(fmt_internals)]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
pub macro format_args_nl {
($fmt:expr) => ({ /* compiler built-in */ }),
($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ })
Expand Down
32 changes: 16 additions & 16 deletions src/libcore/unicode/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ pub const UNICODE_VERSION: UnicodeVersion = UnicodeVersion {
micro: 0,
_priv: (),
};
pub mod general_category {
pub const Cc_table: &super::SmallBoolTrie = &super::SmallBoolTrie {
pub(crate) mod general_category {
const Cc_table: &super::SmallBoolTrie = &super::SmallBoolTrie {
r1: &[
0, 1, 0
],
Expand All @@ -28,7 +28,7 @@ pub mod general_category {
Cc_table.lookup(c)
}

pub const N_table: &super::BoolTrie = &super::BoolTrie {
const N_table: &super::BoolTrie = &super::BoolTrie {
r1: [
0x03ff000000000000, 0x0000000000000000, 0x720c000000000000, 0x0000000000000000,
0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
Expand Down Expand Up @@ -141,8 +141,8 @@ pub mod general_category {

}

pub mod derived_property {
pub const Alphabetic_table: &super::BoolTrie = &super::BoolTrie {
pub(crate) mod derived_property {
const Alphabetic_table: &super::BoolTrie = &super::BoolTrie {
r1: [
0x0000000000000000, 0x07fffffe07fffffe, 0x0420040000000000, 0xff7fffffff7fffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
Expand Down Expand Up @@ -327,7 +327,7 @@ pub mod derived_property {
Alphabetic_table.lookup(c)
}

pub const Case_Ignorable_table: &super::BoolTrie = &super::BoolTrie {
const Case_Ignorable_table: &super::BoolTrie = &super::BoolTrie {
r1: [
0x0400408000000000, 0x0000000140000000, 0x0190a10000000000, 0x0000000000000000,
0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
Expand Down Expand Up @@ -464,7 +464,7 @@ pub mod derived_property {
Case_Ignorable_table.lookup(c)
}

pub const Cased_table: &super::BoolTrie = &super::BoolTrie {
const Cased_table: &super::BoolTrie = &super::BoolTrie {
r1: [
0x0000000000000000, 0x07fffffe07fffffe, 0x0420040000000000, 0xff7fffffff7fffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xf7ffffffffffffff, 0xfffffffffffffff0,
Expand Down Expand Up @@ -565,7 +565,7 @@ pub mod derived_property {
Cased_table.lookup(c)
}

pub const Grapheme_Extend_table: &super::BoolTrie = &super::BoolTrie {
const Grapheme_Extend_table: &super::BoolTrie = &super::BoolTrie {
r1: [
0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
0x0000000000000000, 0x0000000000000000, 0x0000000000000000, 0x0000000000000000,
Expand Down Expand Up @@ -689,7 +689,7 @@ pub mod derived_property {
Grapheme_Extend_table.lookup(c)
}

pub const Lowercase_table: &super::BoolTrie = &super::BoolTrie {
const Lowercase_table: &super::BoolTrie = &super::BoolTrie {
r1: [
0x0000000000000000, 0x07fffffe00000000, 0x0420040000000000, 0xff7fffff80000000,
0x55aaaaaaaaaaaaaa, 0xd4aaaaaaaaaaab55, 0xe6512d2a4e243129, 0xaa29aaaab5555240,
Expand Down Expand Up @@ -789,7 +789,7 @@ pub mod derived_property {
Lowercase_table.lookup(c)
}

pub const Uppercase_table: &super::BoolTrie = &super::BoolTrie {
const Uppercase_table: &super::BoolTrie = &super::BoolTrie {
r1: [
0x0000000000000000, 0x0000000007fffffe, 0x0000000000000000, 0x000000007f7fffff,
0xaa55555555555555, 0x2b555555555554aa, 0x11aed2d5b1dbced6, 0x55d255554aaaa490,
Expand Down Expand Up @@ -890,7 +890,7 @@ pub mod derived_property {
Uppercase_table.lookup(c)
}

pub const XID_Continue_table: &super::BoolTrie = &super::BoolTrie {
const XID_Continue_table: &super::BoolTrie = &super::BoolTrie {
r1: [
0x03ff000000000000, 0x07fffffe87fffffe, 0x04a0040000000000, 0xff7fffffff7fffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
Expand Down Expand Up @@ -1068,7 +1068,7 @@ pub mod derived_property {
XID_Continue_table.lookup(c)
}

pub const XID_Start_table: &super::BoolTrie = &super::BoolTrie {
const XID_Start_table: &super::BoolTrie = &super::BoolTrie {
r1: [
0x0000000000000000, 0x07fffffe07fffffe, 0x0420040000000000, 0xff7fffffff7fffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
Expand Down Expand Up @@ -1250,8 +1250,8 @@ pub mod derived_property {

}

pub mod property {
pub const Pattern_White_Space_table: &super::SmallBoolTrie = &super::SmallBoolTrie {
pub(crate) mod property {
const Pattern_White_Space_table: &super::SmallBoolTrie = &super::SmallBoolTrie {
r1: &[
0, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Expand All @@ -1268,7 +1268,7 @@ pub mod property {
Pattern_White_Space_table.lookup(c)
}

pub const White_Space_table: &super::SmallBoolTrie = &super::SmallBoolTrie {
const White_Space_table: &super::SmallBoolTrie = &super::SmallBoolTrie {
r1: &[
0, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
Expand All @@ -1290,7 +1290,7 @@ pub mod property {

}

pub mod conversions {
pub(crate) mod conversions {
pub fn to_lower(c: char) -> [char; 3] {
match bsearch_case_table(c, to_lowercase_table) {
None => [c, '\0', '\0'],
Expand Down
8 changes: 4 additions & 4 deletions src/libcore/unicode/unicode.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ def compute_trie(raw_data, chunk_size):
return root, child_data


def generate_bool_trie(name, codepoint_ranges, is_pub=True):
def generate_bool_trie(name, codepoint_ranges, is_pub=False):
# type: (str, List[Tuple[int, int]], bool) -> Iterator[str]
"""
Generate Rust code for BoolTrie struct.
Expand Down Expand Up @@ -681,7 +681,7 @@ def generate_bool_trie(name, codepoint_ranges, is_pub=True):
yield " };\n\n"


def generate_small_bool_trie(name, codepoint_ranges, is_pub=True):
def generate_small_bool_trie(name, codepoint_ranges, is_pub=False):
# type: (str, List[Tuple[int, int]], bool) -> Iterator[str]
"""
Generate Rust code for `SmallBoolTrie` struct.
Expand Down Expand Up @@ -726,7 +726,7 @@ def generate_property_module(mod, grouped_categories, category_subset):
Generate Rust code for module defining properties.
"""

yield "pub mod %s {\n" % mod
yield "pub(crate) mod %s {\n" % mod
for cat in sorted(category_subset):
if cat in ("Cc", "White_Space", "Pattern_White_Space"):
generator = generate_small_bool_trie("%s_table" % cat, grouped_categories[cat])
Expand All @@ -749,7 +749,7 @@ def generate_conversions_module(unicode_data):
Generate Rust code for module defining conversions.
"""

yield "pub mod conversions {"
yield "pub(crate) mod conversions {"
yield """
pub fn to_lower(c: char) -> [char; 3] {
match bsearch_case_table(c, to_lowercase_table) {
Expand Down
Loading