Skip to content

Commit 5f1e903

Browse files
committed
switch unicode-data back to 'static'
1 parent ecf2d1f commit 5f1e903

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

library/core/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@
178178
// tidy-alphabetical-start
179179
#![cfg_attr(bootstrap, feature(const_mut_refs))]
180180
#![cfg_attr(bootstrap, feature(const_refs_to_cell))]
181+
#![cfg_attr(bootstrap, feature(const_refs_to_static))]
181182
#![feature(abi_unadjusted)]
182183
#![feature(adt_const_params)]
183184
#![feature(allow_internal_unsafe)]

library/core/src/unicode/unicode_data.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -331,14 +331,14 @@ pub mod grapheme_extend {
331331

332332
#[rustfmt::skip]
333333
pub mod lowercase {
334-
const BITSET_CHUNKS_MAP: &'static [u8; 123] = &[
334+
static BITSET_CHUNKS_MAP: &'static [u8; 123] = &[
335335
14, 17, 0, 0, 9, 0, 0, 12, 13, 10, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
336336
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
337337
0, 0, 0, 4, 1, 0, 15, 0, 8, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
338338
0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0,
339339
3, 18, 0, 7,
340340
];
341-
const BITSET_INDEX_CHUNKS: &'static [[u8; 16]; 20] = &[
341+
static BITSET_INDEX_CHUNKS: &'static [[u8; 16]; 20] = &[
342342
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
343343
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0],
344344
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 14, 56, 0],
@@ -360,7 +360,7 @@ pub mod lowercase {
360360
[16, 72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
361361
[65, 41, 55, 12, 77, 63, 18, 1, 7, 64, 76, 20, 73, 74, 4, 45],
362362
];
363-
const BITSET_CANONICAL: &'static [u64; 56] = &[
363+
static BITSET_CANONICAL: &'static [u64; 56] = &[
364364
0b0000000000000000000000000000000000000000000000000000000000000000,
365365
0b1111111111111111110000000000000000000000000011111111111111111111,
366366
0b1010101010101010101010101010101010101010101010101010100000000010,
@@ -418,7 +418,7 @@ pub mod lowercase {
418418
0b1110011001010001001011010010101001001110001001000011000100101001,
419419
0b1110101111000000000000000000000000001111111111111111111111111100,
420420
];
421-
const BITSET_MAPPING: &'static [(u8, u8); 22] = &[
421+
static BITSET_MAPPING: &'static [(u8, u8); 22] = &[
422422
(0, 64), (1, 188), (1, 186), (1, 183), (1, 176), (1, 109), (1, 124), (1, 126), (1, 66),
423423
(1, 70), (1, 77), (2, 146), (2, 144), (2, 83), (3, 93), (3, 147), (3, 133), (4, 12), (4, 6),
424424
(5, 187), (6, 78), (7, 132),
@@ -471,14 +471,14 @@ pub mod n {
471471

472472
#[rustfmt::skip]
473473
pub mod uppercase {
474-
const BITSET_CHUNKS_MAP: &'static [u8; 125] = &[
474+
static BITSET_CHUNKS_MAP: &'static [u8; 125] = &[
475475
12, 15, 6, 6, 0, 6, 6, 2, 4, 11, 6, 16, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
476476
6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
477477
6, 6, 6, 5, 6, 14, 6, 10, 6, 6, 1, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
478478
6, 7, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 13, 6, 6,
479479
6, 6, 9, 6, 3,
480480
];
481-
const BITSET_INDEX_CHUNKS: &'static [[u8; 16]; 17] = &[
481+
static BITSET_INDEX_CHUNKS: &'static [[u8; 16]; 17] = &[
482482
[44, 44, 5, 35, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 5, 1],
483483
[44, 44, 5, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44],
484484
[44, 44, 40, 44, 44, 44, 44, 44, 17, 17, 63, 17, 43, 29, 24, 23],
@@ -497,7 +497,7 @@ pub mod uppercase {
497497
[58, 19, 2, 18, 10, 48, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44],
498498
[58, 38, 17, 27, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44, 44],
499499
];
500-
const BITSET_CANONICAL: &'static [u64; 44] = &[
500+
static BITSET_CANONICAL: &'static [u64; 44] = &[
501501
0b0000011111111111111111111111111000000000000000000000000000000000,
502502
0b0000000000111111111111111111111111111111111111111111111111111111,
503503
0b0101010101010101010101010101010101010101010101010101010000000001,
@@ -543,7 +543,7 @@ pub mod uppercase {
543543
0b1111011111111111000000000000000000000000000000000000000000000000,
544544
0b1111111100000000111111110000000000111111000000001111111100000000,
545545
];
546-
const BITSET_MAPPING: &'static [(u8, u8); 25] = &[
546+
static BITSET_MAPPING: &'static [(u8, u8); 25] = &[
547547
(0, 187), (0, 177), (0, 171), (0, 167), (0, 164), (0, 32), (0, 47), (0, 51), (0, 121),
548548
(0, 117), (0, 109), (1, 150), (1, 148), (1, 142), (1, 134), (1, 131), (1, 64), (2, 164),
549549
(2, 146), (2, 20), (3, 146), (3, 140), (3, 134), (4, 178), (4, 171),

src/tools/unicode-table-generator/src/raw_emitter.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ impl RawEmitter {
7777

7878
writeln!(
7979
&mut self.file,
80-
"const BITSET_CANONICAL: &'static [u64; {}] = &[{}];",
80+
"static BITSET_CANONICAL: &'static [u64; {}] = &[{}];",
8181
canonicalized.canonical_words.len(),
8282
fmt_list(canonicalized.canonical_words.iter().map(|v| Bits(*v))),
8383
)
8484
.unwrap();
8585
self.bytes_used += 8 * canonicalized.canonical_words.len();
8686
writeln!(
8787
&mut self.file,
88-
"const BITSET_MAPPING: &'static [(u8, u8); {}] = &[{}];",
88+
"static BITSET_MAPPING: &'static [(u8, u8); {}] = &[{}];",
8989
canonicalized.canonicalized_words.len(),
9090
fmt_list(&canonicalized.canonicalized_words),
9191
)
@@ -139,15 +139,15 @@ impl RawEmitter {
139139

140140
writeln!(
141141
&mut self.file,
142-
"const BITSET_CHUNKS_MAP: &'static [u8; {}] = &[{}];",
142+
"static BITSET_CHUNKS_MAP: &'static [u8; {}] = &[{}];",
143143
chunk_indices.len(),
144144
fmt_list(&chunk_indices),
145145
)
146146
.unwrap();
147147
self.bytes_used += chunk_indices.len();
148148
writeln!(
149149
&mut self.file,
150-
"const BITSET_INDEX_CHUNKS: &'static [[u8; {}]; {}] = &[{}];",
150+
"static BITSET_INDEX_CHUNKS: &'static [[u8; {}]; {}] = &[{}];",
151151
chunk_length,
152152
chunks.len(),
153153
fmt_list(chunks.iter()),

0 commit comments

Comments
 (0)