diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-10-13 12:32:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-13 12:32:18 +0200 |
| commit | 84dd8cdb228d692bff83eef4b9f9483457ed8be1 (patch) | |
| tree | fbc22addeae8c14bcfa35b3075571b7248f4a5c0 /src | |
| parent | 29ef664763b599fd5f2388f8d705983fd135f379 (diff) | |
| parent | 90e4f10f6c40d8bcf290f2ea7bf9c9d310de9d65 (diff) | |
| download | rust-84dd8cdb228d692bff83eef4b9f9483457ed8be1.tar.gz rust-84dd8cdb228d692bff83eef4b9f9483457ed8be1.zip | |
Rollup merge of #131641 - RalfJung:unicode-bitset-static, r=dtolnay
switch unicode-data bitsets back to 'static' Back in https://github.com/rust-lang/rust/pull/101401, these were changed to `const` to make some functions `const fn`. However, `@dtolnay` was [not happy](https://github.com/rust-lang/rust/issues/101400#issuecomment-1742500968) about this. Meanwhile, `const fn` can access immutable statics like these, so we can change this back. Part of https://github.com/rust-lang/rust/issues/101400.
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/unicode-table-generator/src/raw_emitter.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tools/unicode-table-generator/src/raw_emitter.rs b/src/tools/unicode-table-generator/src/raw_emitter.rs index bfffa1eee60..8097d6a8caf 100644 --- a/src/tools/unicode-table-generator/src/raw_emitter.rs +++ b/src/tools/unicode-table-generator/src/raw_emitter.rs @@ -77,7 +77,7 @@ impl RawEmitter { writeln!( &mut self.file, - "const BITSET_CANONICAL: &'static [u64; {}] = &[{}];", + "static BITSET_CANONICAL: [u64; {}] = [{}];", canonicalized.canonical_words.len(), fmt_list(canonicalized.canonical_words.iter().map(|v| Bits(*v))), ) @@ -85,7 +85,7 @@ impl RawEmitter { self.bytes_used += 8 * canonicalized.canonical_words.len(); writeln!( &mut self.file, - "const BITSET_MAPPING: &'static [(u8, u8); {}] = &[{}];", + "static BITSET_MAPPING: [(u8, u8); {}] = [{}];", canonicalized.canonicalized_words.len(), fmt_list(&canonicalized.canonicalized_words), ) @@ -139,7 +139,7 @@ impl RawEmitter { writeln!( &mut self.file, - "const BITSET_CHUNKS_MAP: &'static [u8; {}] = &[{}];", + "static BITSET_CHUNKS_MAP: [u8; {}] = [{}];", chunk_indices.len(), fmt_list(&chunk_indices), ) @@ -147,7 +147,7 @@ impl RawEmitter { self.bytes_used += chunk_indices.len(); writeln!( &mut self.file, - "const BITSET_INDEX_CHUNKS: &'static [[u8; {}]; {}] = &[{}];", + "static BITSET_INDEX_CHUNKS: [[u8; {}]; {}] = [{}];", chunk_length, chunks.len(), fmt_list(chunks.iter()), |
