-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Move static code outside of unciode.py. #47088
Conversation
73cf9c3
to
57f5173
Compare
(rust_highfive has picked a reviewer for you, use r? to override) |
1a94ca7
to
157f58b
Compare
src/libstd_unicode/tables.rs
Outdated
pub mod general_category { | ||
pub const Cc_table: &'static super::SmallBoolTrie = &super::SmallBoolTrie { | ||
pub const Cc_table: &SmallBoolTrie = &super::SmallBoolTrie { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[00:04:03] error[E0412]: cannot find type `SmallBoolTrie` in this scope
[00:04:03] --> /checkout/src/libstd_unicode/tables.rs:29:26
[00:04:03] |
[00:04:03] 29 | pub const Cc_table: &SmallBoolTrie = &super::SmallBoolTrie {
[00:04:03] | ^^^^^^^^^^^^^ not found in this scope
[00:04:03] help: possible candidate is found in another module, you can import it into scope
[00:04:03] |
[00:04:03] 29 | use bool_trie::SmallBoolTrie;
[00:04:03] |
src/libstd_unicode/tables.rs
Outdated
@@ -120,7 +39,7 @@ pub mod general_category { | |||
Cc_table.lookup(c) | |||
} | |||
|
|||
pub const N_table: &'static super::BoolTrie = &super::BoolTrie { | |||
pub const N_table: &BoolTrie = &BoolTrie { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[00:04:03] error[E0412]: cannot find type `BoolTrie` in this scope
[00:04:03] --> /checkout/src/libstd_unicode/tables.rs:42:25
[00:04:03] |
[00:04:03] 42 | pub const N_table: &BoolTrie = &BoolTrie {
[00:04:03] | ^^^^^^^^ not found in this scope
[00:04:03] help: possible candidate is found in another module, you can import it into scope
[00:04:03] |
[00:04:03] 29 | use bool_trie::BoolTrie;
[00:04:03] |
[00:04:03]
[00:04:03] error[E0422]: cannot find struct, variant or union type `BoolTrie` in this scope
[00:04:03] --> /checkout/src/libstd_unicode/tables.rs:42:37
[00:04:03] |
[00:04:03] 42 | pub const N_table: &BoolTrie = &BoolTrie {
[00:04:03] | ^^^^^^^^ not found in this scope
[00:04:03] help: possible candidate is found in another module, you can import it into scope
[00:04:03] |
[00:04:03] 29 | use bool_trie::BoolTrie;
[00:04:03] |
src/libstd_unicode/tables.rs
Outdated
} | ||
|
||
} | ||
|
||
pub mod derived_property { | ||
pub const Alphabetic_table: &'static super::BoolTrie = &super::BoolTrie { | ||
pub const Alphabetic_table: &BoolTrie = &BoolTrie { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cannot find type BoolTrie
in this scope
src/libstd_unicode/tables.rs
Outdated
} | ||
|
||
pub const Case_Ignorable_table: &'static super::BoolTrie = &super::BoolTrie { | ||
pub const Case_Ignorable_table: &BoolTrie = &BoolTrie { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
etc.
_priv: (), | ||
} | ||
use version::UnicodeVersion; | ||
use bool_trie::{BoolTrie, SmallBoolTrie}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[00:04:03] error: unused import: `BoolTrie`
[00:04:03] --> /checkout/src/libstd_unicode/tables.rs:16:17
[00:04:03] |
[00:04:03] 16 | use bool_trie::{BoolTrie, SmallBoolTrie};
[00:04:03] | ^^^^^^^^
[00:04:03] |
@kennytm I actually just stumbled upon those errors this morning; I just pushed the fix. |
157f58b
to
bf7cf86
Compare
src/libstd_unicode/version.rs
Outdated
/// Represents a Unicode Version. | ||
/// | ||
/// See also: <http://www.unicode.org/versions/> | ||
#[non_exhaustive] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this be omitted? It seems like there's not really much need to pull in a new unstable feature to this library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will leave this to #47122 to fix and remove it from this PR.
src/libstd_unicode/bool_trie.rs
Outdated
/// non-BMP range of most Unicode sets. | ||
pub struct BoolTrie { | ||
// 0..0x800 (corresponding to 1 and 2 byte utf-8 sequences) | ||
pub(crate) r1: [u64; 32], // leaves |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these just be pub
as this module isn't exported anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do
60f9f98
to
c4dceb0
Compare
Requested changes have been made. |
c4dceb0
to
9413973
Compare
9413973
to
b4b3ddd
Compare
@bors: r+ |
📌 Commit b4b3ddd has been approved by |
Move static code outside of unciode.py. This script in libstd_unicode is a mess and also contains code that shouldn't be output by a script, and instead just put in modules. So, this change does that.
☀️ Test successful - status-appveyor, status-travis |
This script in libstd_unicode is a mess and also contains code that shouldn't be output by a script, and instead just put in modules. So, this change does that.