From c1c02d9b0b1857136275b86e6064085a8278ce72 Mon Sep 17 00:00:00 2001 From: Ryan Prichard Date: Sat, 28 Feb 2015 19:30:06 -0800 Subject: [PATCH 01/16] Cleanup in the fmt::num module * Make num::UpperHex private. I was unable to determine why this struct is public. The num module itself is not public, and the UpperHex struct is not referenced anywhere in the core::fmt module. (Only the UpperHex trait is reference.) num::LowerHex is not public. * Remove the suffix parameters from the macros that generate integral display traits. The code to print the Debug::fmt suffixes was removed when Show was renamed to Debug. It was an intentional change. From RFC 0565: * Focus on the *runtime* aspects of a type; repeating information such as suffixes for integer literals is not generally useful since that data is readily available from the type definition. * Because Show was renamed to Debug, rename show! to debug!. --- src/libcore/fmt/num.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/libcore/fmt/num.rs b/src/libcore/fmt/num.rs index 0175e21c8da61..045442e28ac5d 100644 --- a/src/libcore/fmt/num.rs +++ b/src/libcore/fmt/num.rs @@ -84,7 +84,7 @@ struct LowerHex; /// A hexadecimal (base 16) radix, formatted with upper-case characters #[derive(Clone, PartialEq)] -pub struct UpperHex; +struct UpperHex; macro_rules! radix { ($T:ident, $base:expr, $prefix:expr, $($x:pat => $conv:expr),+) => { @@ -156,7 +156,7 @@ pub fn radix(x: T, base: u8) -> RadixFmt { } macro_rules! radix_fmt { - ($T:ty as $U:ty, $fmt:ident, $S:expr) => { + ($T:ty as $U:ty, $fmt:ident) => { #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Debug for RadixFmt<$T, Radix> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -182,8 +182,8 @@ macro_rules! int_base { } } -macro_rules! show { - ($T:ident with $S:expr) => { +macro_rules! debug { + ($T:ident) => { #[stable(feature = "rust1", since = "1.0.0")] impl fmt::Debug for $T { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { @@ -194,27 +194,24 @@ macro_rules! show { } macro_rules! integer { ($Int:ident, $Uint:ident) => { - integer! { $Int, $Uint, stringify!($Int), stringify!($Uint) } - }; - ($Int:ident, $Uint:ident, $SI:expr, $SU:expr) => { int_base! { Display for $Int as $Int -> Decimal } int_base! { Binary for $Int as $Uint -> Binary } int_base! { Octal for $Int as $Uint -> Octal } int_base! { LowerHex for $Int as $Uint -> LowerHex } int_base! { UpperHex for $Int as $Uint -> UpperHex } - radix_fmt! { $Int as $Int, fmt_int, $SI } - show! { $Int with $SI } + radix_fmt! { $Int as $Int, fmt_int } + debug! { $Int } int_base! { Display for $Uint as $Uint -> Decimal } int_base! { Binary for $Uint as $Uint -> Binary } int_base! { Octal for $Uint as $Uint -> Octal } int_base! { LowerHex for $Uint as $Uint -> LowerHex } int_base! { UpperHex for $Uint as $Uint -> UpperHex } - radix_fmt! { $Uint as $Uint, fmt_int, $SU } - show! { $Uint with $SU } + radix_fmt! { $Uint as $Uint, fmt_int } + debug! { $Uint } } } -integer! { isize, usize, "i", "u" } +integer! { isize, usize } integer! { i8, u8 } integer! { i16, u16 } integer! { i32, u32 } From a7fe94fc0cd5ebebe171da54b3804e97f8eb7aeb Mon Sep 17 00:00:00 2001 From: Eunji Jeong Date: Mon, 2 Mar 2015 14:07:07 +0900 Subject: [PATCH 02/16] Fix broken aarch64 build --- src/libstd/sys/unix/backtrace.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/sys/unix/backtrace.rs b/src/libstd/sys/unix/backtrace.rs index 3695b615f62b8..d78cfd0ca37fc 100644 --- a/src/libstd/sys/unix/backtrace.rs +++ b/src/libstd/sys/unix/backtrace.rs @@ -566,7 +566,7 @@ mod uw { // This function doesn't exist on Android or ARM/Linux, so make it same // to _Unwind_GetIP - #[cfg(any(target_os = "android", + #[cfg(any(all(target_os = "android", target_arch = "arm"), all(target_os = "linux", target_arch = "arm")))] pub unsafe fn _Unwind_GetIPInfo(ctx: *mut _Unwind_Context, ip_before_insn: *mut libc::c_int) From 25ad3ba3cb0e6f2efd14ff5199d29542e125a667 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Mon, 2 Mar 2015 17:50:47 +1100 Subject: [PATCH 03/16] Manual Clone for Windows/Chunks. `#[derive(Clone)]` unnecessarily requires the element type to also be `Clone`. --- src/libcore/slice.rs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 5b78da34eddde..f99cfbaab5d70 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -1167,13 +1167,23 @@ forward_iterator! { SplitNMut: T, &'a mut [T] } forward_iterator! { RSplitNMut: T, &'a mut [T] } /// An iterator over overlapping subslices of length `size`. -#[derive(Clone)] #[stable(feature = "rust1", since = "1.0.0")] pub struct Windows<'a, T:'a> { v: &'a [T], size: usize } +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` +#[stable(feature = "rust1", since = "1.0.0")] +impl<'a, T> Clone for Windows<'a, T> { + fn clone(&self) -> Windows<'a, T> { + Windows { + v: self.v, + size: self.size, + } + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T> Iterator for Windows<'a, T> { type Item = &'a [T]; @@ -1239,13 +1249,23 @@ impl<'a, T> RandomAccessIterator for Windows<'a, T> { /// /// When the slice len is not evenly divided by the chunk size, the last slice /// of the iteration will be the remainder. -#[derive(Clone)] #[stable(feature = "rust1", since = "1.0.0")] pub struct Chunks<'a, T:'a> { v: &'a [T], size: usize } +// FIXME(#19839) Remove in favor of `#[derive(Clone)]` +#[stable(feature = "rust1", since = "1.0.0")] +impl<'a, T> Clone for Chunks<'a, T> { + fn clone(&self) -> Chunks<'a, T> { + Chunks { + v: self.v, + size: self.size, + } + } +} + #[stable(feature = "rust1", since = "1.0.0")] impl<'a, T> Iterator for Chunks<'a, T> { type Item = &'a [T]; From b0e7c58bf020dde660af36f68eac8d0c1621d153 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Mon, 2 Mar 2015 18:04:11 +1100 Subject: [PATCH 04/16] Add missing stability attributes on struct fields. Unstable is the conservative choice. cc #22950. --- src/libcore/iter.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs index 88a729a3db09e..57a6613debd58 100644 --- a/src/libcore/iter.rs +++ b/src/libcore/iter.rs @@ -2061,6 +2061,7 @@ pub struct Scan { f: F, /// The current internal state to be passed to the closure next. + #[unstable(feature = "core")] pub state: St, } @@ -2338,6 +2339,7 @@ impl RandomAccessIterator for Inspect pub struct Unfold { f: F, /// Internal state that will be passed to the closure on the next iteration + #[unstable(feature = "core")] pub state: St, } From f35f973cb700c444d8c029ee13b37dc16d560225 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Fri, 27 Feb 2015 15:36:53 +0100 Subject: [PATCH 05/16] Use `const`s instead of `static`s where appropriate This changes the type of some public constants/statics in libunicode. Notably some `&'static &'static [(char, char)]` have changed to `&'static [(char, char)]`. The regexp crate seems to be the sole user of these, yet this is technically a [breaking-change] --- src/compiletest/runtest.rs | 4 +- src/compiletest/util.rs | 2 +- src/etc/unicode.py | 49 +- src/libcollections/bit.rs | 4 +- src/libcollections/slice.rs | 4 +- src/libcollections/string.rs | 4 +- src/libcollections/vec_deque.rs | 4 +- src/libcore/fmt/float.rs | 2 +- src/libcoretest/num/int_macros.rs | 10 +- src/libcoretest/num/uint_macros.rs | 10 +- src/libflate/lib.rs | 6 +- src/librand/distributions/mod.rs | 2 +- src/librand/isaac.rs | 2 +- src/librand/lib.rs | 4 +- src/librand/rand_impls.rs | 2 +- src/librand/reseeding.rs | 4 +- src/librbml/io.rs | 2 +- src/librbml/lib.rs | 4 +- src/librustc/metadata/filesearch.rs | 4 +- src/librustc/middle/liveness.rs | 6 +- src/librustc/middle/ty.rs | 36 +- src/librustc_back/archive.rs | 4 +- src/librustc_back/fs.rs | 2 +- src/librustc_borrowck/borrowck/mod.rs | 2 +- src/librustc_borrowck/borrowck/move_data.rs | 6 +- src/librustc_driver/lib.rs | 4 +- src/librustc_driver/test.rs | 2 +- src/librustc_lint/builtin.rs | 2 +- src/librustc_trans/back/link.rs | 2 +- src/librustc_trans/trans/adt.rs | 4 +- src/librustc_trans/trans/meth.rs | 2 +- src/librustdoc/flock.rs | 2 +- src/librustdoc/lib.rs | 4 +- src/libserialize/hex.rs | 2 +- src/libstd/net/tcp.rs | 2 +- src/libstd/num/strconv.rs | 4 +- src/libstd/rand/mod.rs | 9 +- src/libstd/rand/os.rs | 6 +- src/libstd/sync/mpsc/mod.rs | 8 +- src/libstd/sync/mpsc/select.rs | 2 +- src/libstd/sync/mutex.rs | 4 +- src/libstd/sync/rwlock.rs | 4 +- src/libstd/sys/common/wtf8.rs | 2 +- src/libstd/sys/windows/os.rs | 4 +- src/libstd/thread.rs | 2 +- src/libsyntax/abi.rs | 4 +- src/libsyntax/diagnostic.rs | 2 +- src/libsyntax/ext/asm.rs | 2 +- src/libsyntax/feature_gate.rs | 4 +- src/libsyntax/parse/lexer/comments.rs | 4 +- src/libsyntax/parse/token.rs | 8 +- src/libsyntax/print/pp.rs | 2 +- src/libunicode/tables.rs | 567 ++++++++++---------- 53 files changed, 419 insertions(+), 424 deletions(-) diff --git a/src/compiletest/runtest.rs b/src/compiletest/runtest.rs index 85bbd2cb42e69..7ac8a9b041c83 100644 --- a/src/compiletest/runtest.rs +++ b/src/compiletest/runtest.rs @@ -127,7 +127,7 @@ fn run_rfail_test(config: &Config, props: &TestProps, testfile: &Path) { }; // The value our Makefile configures valgrind to return on failure - static VALGRIND_ERR: int = 100; + const VALGRIND_ERR: int = 100; if proc_res.status.matches_exit_status(VALGRIND_ERR) { fatal_proc_rec("run-fail test isn't valgrind-clean!", &proc_res); } @@ -139,7 +139,7 @@ fn run_rfail_test(config: &Config, props: &TestProps, testfile: &Path) { fn check_correct_failure_status(proc_res: &ProcRes) { // The value the rust runtime returns on failure - static RUST_ERR: int = 101; + const RUST_ERR: int = 101; if !proc_res.status.matches_exit_status(RUST_ERR) { fatal_proc_rec( &format!("failure produced the wrong error: {:?}", diff --git a/src/compiletest/util.rs b/src/compiletest/util.rs index 778629dd2028f..c0d7c59ef6a1b 100644 --- a/src/compiletest/util.rs +++ b/src/compiletest/util.rs @@ -14,7 +14,7 @@ use common::Config; use std::env; /// Conversion table from triple OS name to Rust SYSNAME -static OS_TABLE: &'static [(&'static str, &'static str)] = &[ +const OS_TABLE: &'static [(&'static str, &'static str)] = &[ ("mingw32", "windows"), ("win32", "windows"), ("windows", "windows"), diff --git a/src/etc/unicode.py b/src/etc/unicode.py index dc8716d1378df..5472ba3c7eda1 100755 --- a/src/etc/unicode.py +++ b/src/etc/unicode.py @@ -290,11 +290,11 @@ def emit_bsearch_range_table(f): fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool { use core::cmp::Ordering::{Equal, Less, Greater}; use core::slice::SliceExt; - r.binary_search(|&(lo,hi)| { + r.binary_search_by(|&(lo,hi)| { if lo <= c && c <= hi { Equal } else if hi < c { Less } else { Greater } - }).found().is_some() + }).is_ok() }\n """) @@ -303,7 +303,7 @@ def emit_table(f, name, t_data, t_type = "&'static [(char, char)]", is_pub=True, pub_string = "" if is_pub: pub_string = "pub " - f.write(" %sstatic %s: %s = &[\n" % (pub_string, name, t_type)) + f.write(" %sconst %s: %s = &[\n" % (pub_string, name, t_type)) data = "" first = True for dat in t_data: @@ -329,14 +329,14 @@ def emit_property_module(f, mod, tbl, emit_fn): def emit_regex_module(f, cats, w_data): f.write("pub mod regex {\n") regex_class = "&'static [(char, char)]" - class_table = "&'static [(&'static str, &'static %s)]" % regex_class + class_table = "&'static [(&'static str, %s)]" % regex_class emit_table(f, "UNICODE_CLASSES", cats, class_table, - pfun=lambda x: "(\"%s\",&super::%s::%s_table)" % (x[0], x[1], x[0])) + pfun=lambda x: "(\"%s\",super::%s::%s_table)" % (x[0], x[1], x[0])) - f.write(" pub static PERLD: &'static %s = &super::general_category::Nd_table;\n\n" + f.write(" pub const PERLD: %s = super::general_category::Nd_table;\n\n" % regex_class) - f.write(" pub static PERLS: &'static %s = &super::property::White_Space_table;\n\n" + f.write(" pub const PERLS: %s = super::property::White_Space_table;\n\n" % regex_class) emit_table(f, "PERLW", w_data, regex_class) @@ -350,7 +350,7 @@ def emit_conversions_module(f, lowerupper, upperlower): use core::slice::SliceExt; use core::option::Option; use core::option::Option::{Some, None}; - use core::slice; + use core::result::Result::{Ok, Err}; pub fn to_lower(c: char) -> char { match bsearch_case_table(c, LuLl_table) { @@ -367,13 +367,13 @@ def emit_conversions_module(f, lowerupper, upperlower): } fn bsearch_case_table(c: char, table: &'static [(char, char)]) -> Option { - match table.binary_search(|&(key, _)| { + match table.binary_search_by(|&(key, _)| { if c == key { Equal } else if key < c { Less } else { Greater } }) { - slice::BinarySearchResult::Found(i) => Some(i), - slice::BinarySearchResult::NotFound(_) => None, + Ok(i) => Some(i), + Err(_) => None, } } @@ -386,10 +386,9 @@ def emit_conversions_module(f, lowerupper, upperlower): def emit_grapheme_module(f, grapheme_table, grapheme_cats): f.write("""pub mod grapheme { - use core::kinds::Copy; use core::slice::SliceExt; pub use self::GraphemeCat::*; - use core::slice; + use core::result::Result::{Ok, Err}; #[allow(non_camel_case_types)] #[derive(Clone, Copy)] @@ -401,16 +400,16 @@ def emit_grapheme_module(f, grapheme_table, grapheme_cats): fn bsearch_range_value_table(c: char, r: &'static [(char, char, GraphemeCat)]) -> GraphemeCat { use core::cmp::Ordering::{Equal, Less, Greater}; - match r.binary_search(|&(lo, hi, _)| { + match r.binary_search_by(|&(lo, hi, _)| { if lo <= c && c <= hi { Equal } else if hi < c { Less } else { Greater } }) { - slice::BinarySearchResult::Found(idx) => { + Ok(idx) => { let (_, _, cat) = r[idx]; cat } - slice::BinarySearchResult::NotFound(_) => GC_Any + Err(_) => GC_Any } } @@ -430,20 +429,20 @@ def emit_charwidth_module(f, width_table): f.write(" use core::option::Option;\n") f.write(" use core::option::Option::{Some, None};\n") f.write(" use core::slice::SliceExt;\n") - f.write(" use core::slice;\n") + f.write(" use core::result::Result::{Ok, Err};\n") f.write(""" fn bsearch_range_value_table(c: char, is_cjk: bool, r: &'static [(char, char, u8, u8)]) -> u8 { use core::cmp::Ordering::{Equal, Less, Greater}; - match r.binary_search(|&(lo, hi, _, _)| { + match r.binary_search_by(|&(lo, hi, _, _)| { if lo <= c && c <= hi { Equal } else if hi < c { Less } else { Greater } }) { - slice::BinarySearchResult::Found(idx) => { + Ok(idx) => { let (_, _, r_ncjk, r_cjk) = r[idx]; if is_cjk { r_cjk } else { r_ncjk } } - slice::BinarySearchResult::NotFound(_) => 1 + Err(_) => 1 } } """) @@ -530,17 +529,17 @@ def comp_pfun(char): fn bsearch_range_value_table(c: char, r: &'static [(char, char, u8)]) -> u8 { use core::cmp::Ordering::{Equal, Less, Greater}; use core::slice::SliceExt; - use core::slice; - match r.binary_search(|&(lo, hi, _)| { + use core::result::Result::{Ok, Err}; + match r.binary_search_by(|&(lo, hi, _)| { if lo <= c && c <= hi { Equal } else if hi < c { Less } else { Greater } }) { - slice::BinarySearchResult::Found(idx) => { + Ok(idx) => { let (_, _, result) = r[idx]; result } - slice::BinarySearchResult::NotFound(_) => 0 + Err(_) => 0 } }\n """) @@ -609,7 +608,7 @@ def optimize_width_table(wtable): unicode_version = re.search(pattern, readme.read()).groups() rf.write(""" /// The version of [Unicode](http://www.unicode.org/) -/// that the `UnicodeChar` and `UnicodeStrPrelude` traits are based on. +/// that the unicode parts of `CharExt` and `UnicodeStrPrelude` traits are based on. pub const UNICODE_VERSION: (u64, u64, u64) = (%s, %s, %s); """ % unicode_version) (canon_decomp, compat_decomp, gencats, combines, diff --git a/src/libcollections/bit.rs b/src/libcollections/bit.rs index 5b19de42ac919..e9b6ec22d6dae 100644 --- a/src/libcollections/bit.rs +++ b/src/libcollections/bit.rs @@ -2544,7 +2544,7 @@ mod bit_vec_bench { use super::BitVec; - static BENCH_BITS : usize = 1 << 14; + const BENCH_BITS : usize = 1 << 14; fn rng() -> rand::IsaacRng { let seed: &[_] = &[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]; @@ -3039,7 +3039,7 @@ mod bit_set_bench { use super::{BitVec, BitSet}; - static BENCH_BITS : usize = 1 << 14; + const BENCH_BITS : usize = 1 << 14; fn rng() -> rand::IsaacRng { let seed: &[_] = &[1, 2, 3, 4, 5, 6, 7, 8, 9, 0]; diff --git a/src/libcollections/slice.rs b/src/libcollections/slice.rs index a2924f8fe5308..f4c8abbcff131 100644 --- a/src/libcollections/slice.rs +++ b/src/libcollections/slice.rs @@ -1343,8 +1343,8 @@ fn insertion_sort(v: &mut [T], mut compare: F) where F: FnMut(&T, &T) -> O fn merge_sort(v: &mut [T], mut compare: F) where F: FnMut(&T, &T) -> Ordering { // warning: this wildly uses unsafe. - static BASE_INSERTION: usize = 32; - static LARGE_INSERTION: usize = 16; + const BASE_INSERTION: usize = 32; + const LARGE_INSERTION: usize = 16; // FIXME #12092: smaller insertion runs seems to make sorting // vectors of large elements a little faster on some platforms, diff --git a/src/libcollections/string.rs b/src/libcollections/string.rs index 94abffa3db61c..33189bd68bdc6 100644 --- a/src/libcollections/string.rs +++ b/src/libcollections/string.rs @@ -153,8 +153,8 @@ impl String { } } - static TAG_CONT_U8: u8 = 128u8; - static REPLACEMENT: &'static [u8] = b"\xEF\xBF\xBD"; // U+FFFD in UTF-8 + const TAG_CONT_U8: u8 = 128u8; + const REPLACEMENT: &'static [u8] = b"\xEF\xBF\xBD"; // U+FFFD in UTF-8 let total = v.len(); fn unsafe_get(xs: &[u8], i: usize) -> u8 { unsafe { *xs.get_unchecked(i) } diff --git a/src/libcollections/vec_deque.rs b/src/libcollections/vec_deque.rs index abcc0cef9f1fe..59ec066b83ed4 100644 --- a/src/libcollections/vec_deque.rs +++ b/src/libcollections/vec_deque.rs @@ -39,8 +39,8 @@ use alloc::heap; #[unstable(feature = "collections")] pub use VecDeque as RingBuf; -static INITIAL_CAPACITY: usize = 7; // 2^3 - 1 -static MINIMUM_CAPACITY: usize = 1; // 2 - 1 +const INITIAL_CAPACITY: usize = 7; // 2^3 - 1 +const MINIMUM_CAPACITY: usize = 1; // 2 - 1 /// `VecDeque` is a growable ring buffer, which can be used as a /// double-ended queue efficiently. diff --git a/src/libcore/fmt/float.rs b/src/libcore/fmt/float.rs index f92e631c1f25c..9b7c409ab5502 100644 --- a/src/libcore/fmt/float.rs +++ b/src/libcore/fmt/float.rs @@ -53,7 +53,7 @@ pub enum SignFormat { SignNeg } -static DIGIT_E_RADIX: u32 = ('e' as u32) - ('a' as u32) + 11; +const DIGIT_E_RADIX: u32 = ('e' as u32) - ('a' as u32) + 11; /// Converts a number to its string representation as a byte vector. /// This is meant to be a common base implementation for all numeric string diff --git a/src/libcoretest/num/int_macros.rs b/src/libcoretest/num/int_macros.rs index d1bfb475b074b..fa41167cae8a6 100644 --- a/src/libcoretest/num/int_macros.rs +++ b/src/libcoretest/num/int_macros.rs @@ -70,12 +70,12 @@ mod tests { assert!(-(0b11 as $T) - (1 as $T) == (0b11 as $T).not()); } - static A: $T = 0b0101100; - static B: $T = 0b0100001; - static C: $T = 0b1111001; + const A: $T = 0b0101100; + const B: $T = 0b0100001; + const C: $T = 0b1111001; - static _0: $T = 0; - static _1: $T = !0; + const _0: $T = 0; + const _1: $T = !0; #[test] fn test_count_ones() { diff --git a/src/libcoretest/num/uint_macros.rs b/src/libcoretest/num/uint_macros.rs index 5c6efc857f1f9..39e41a4fad3b7 100644 --- a/src/libcoretest/num/uint_macros.rs +++ b/src/libcoretest/num/uint_macros.rs @@ -38,12 +38,12 @@ mod tests { assert!(MAX - (0b1011 as $T) == (0b1011 as $T).not()); } - static A: $T = 0b0101100; - static B: $T = 0b0100001; - static C: $T = 0b1111001; + const A: $T = 0b0101100; + const B: $T = 0b0100001; + const C: $T = 0b1111001; - static _0: $T = 0; - static _1: $T = !0; + const _0: $T = 0; + const _1: $T = !0; #[test] fn test_count_ones() { diff --git a/src/libflate/lib.rs b/src/libflate/lib.rs index 2ce52cdec2560..585318300438b 100644 --- a/src/libflate/lib.rs +++ b/src/libflate/lib.rs @@ -73,9 +73,9 @@ extern { -> *mut c_void; } -static LZ_NORM : c_int = 0x80; // LZ with 128 probes, "normal" -static TINFL_FLAG_PARSE_ZLIB_HEADER : c_int = 0x1; // parse zlib header and adler32 checksum -static TDEFL_WRITE_ZLIB_HEADER : c_int = 0x01000; // write zlib header and adler32 checksum +const LZ_NORM: c_int = 0x80; // LZ with 128 probes, "normal" +const TINFL_FLAG_PARSE_ZLIB_HEADER: c_int = 0x1; // parse zlib header and adler32 checksum +const TDEFL_WRITE_ZLIB_HEADER: c_int = 0x01000; // write zlib header and adler32 checksum fn deflate_bytes_internal(bytes: &[u8], flags: c_int) -> Option { unsafe { diff --git a/src/librand/distributions/mod.rs b/src/librand/distributions/mod.rs index 5a85552dc384e..12794ed69be38 100644 --- a/src/librand/distributions/mod.rs +++ b/src/librand/distributions/mod.rs @@ -223,7 +223,7 @@ fn ziggurat( mut pdf: P, mut zero_case: Z) -> f64 where P: FnMut(f64) -> f64, Z: FnMut(&mut R, f64) -> f64 { - static SCALE: f64 = (1u64 << 53) as f64; + const SCALE: f64 = (1u64 << 53) as f64; loop { // reimplement the f64 generation as an optimisation suggested // by the Doornik paper: we have a lot of precision-space diff --git a/src/librand/isaac.rs b/src/librand/isaac.rs index 701749ff3443f..51d54f27f0912 100644 --- a/src/librand/isaac.rs +++ b/src/librand/isaac.rs @@ -127,7 +127,7 @@ impl IsaacRng { let mut a = self.a; let mut b = self.b + self.c; - static MIDPOINT: uint = (RAND_SIZE / 2) as uint; + const MIDPOINT: uint = (RAND_SIZE / 2) as uint; macro_rules! ind { ($x:expr) => ( self.mem[(($x >> 2) as uint & ((RAND_SIZE - 1) as uint))] ) diff --git a/src/librand/lib.rs b/src/librand/lib.rs index 583c658dfe058..3458d519af5cd 100644 --- a/src/librand/lib.rs +++ b/src/librand/lib.rs @@ -52,7 +52,7 @@ use distributions::{Range, IndependentSample}; use distributions::range::SampleRange; #[cfg(test)] -static RAND_BENCH_N: u64 = 100; +const RAND_BENCH_N: u64 = 100; pub mod distributions; pub mod isaac; @@ -342,7 +342,7 @@ impl<'a, R: Rng> Iterator for AsciiGenerator<'a, R> { type Item = char; fn next(&mut self) -> Option { - static GEN_ASCII_STR_CHARSET: &'static [u8] = + const GEN_ASCII_STR_CHARSET: &'static [u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ\ abcdefghijklmnopqrstuvwxyz\ 0123456789"; diff --git a/src/librand/rand_impls.rs b/src/librand/rand_impls.rs index 74d2c408060cb..c8a757079c348 100644 --- a/src/librand/rand_impls.rs +++ b/src/librand/rand_impls.rs @@ -141,7 +141,7 @@ impl Rand for char { #[inline] fn rand(rng: &mut R) -> char { // a char is 21 bits - static CHAR_MASK: u32 = 0x001f_ffff; + const CHAR_MASK: u32 = 0x001f_ffff; loop { // Rejection sampling. About 0.2% of numbers with at most // 21-bits are invalid codepoints (surrogates), so this diff --git a/src/librand/reseeding.rs b/src/librand/reseeding.rs index 0682891147146..0072c555d1412 100644 --- a/src/librand/reseeding.rs +++ b/src/librand/reseeding.rs @@ -18,7 +18,7 @@ use core::default::Default; /// How many bytes of entropy the underling RNG is allowed to generate /// before it is reseeded. -static DEFAULT_GENERATION_THRESHOLD: uint = 32 * 1024; +const DEFAULT_GENERATION_THRESHOLD: uint = 32 * 1024; /// A wrapper around any RNG which reseeds the underlying RNG after it /// has generated a certain number of random bytes. @@ -212,7 +212,7 @@ mod test { assert_eq!(string1, string2); } - static FILL_BYTES_V_LEN: uint = 13579; + const FILL_BYTES_V_LEN: uint = 13579; #[test] fn test_rng_fill_bytes() { let mut v = repeat(0u8).take(FILL_BYTES_V_LEN).collect::>(); diff --git a/src/librbml/io.rs b/src/librbml/io.rs index c52465a889907..4ef3c5bc20634 100644 --- a/src/librbml/io.rs +++ b/src/librbml/io.rs @@ -13,7 +13,7 @@ use std::old_io; use std::slice; use std::iter::repeat; -static BUF_CAPACITY: uint = 128; +const BUF_CAPACITY: uint = 128; fn combine(seek: SeekStyle, cur: uint, end: uint, offset: i64) -> IoResult { // compute offset as signed and clamp to prevent overflow diff --git a/src/librbml/lib.rs b/src/librbml/lib.rs index 05cd24de7368c..fed22236fc8bc 100644 --- a/src/librbml/lib.rs +++ b/src/librbml/lib.rs @@ -856,9 +856,9 @@ pub mod writer { // Set to true to generate more debugging in EBML code. // Totally lame approach. #[cfg(not(ndebug))] - static DEBUG: bool = true; + const DEBUG: bool = true; #[cfg(ndebug)] - static DEBUG: bool = false; + const DEBUG: bool = false; impl<'a, W: Writer + Seek> Encoder<'a, W> { // used internally to emit things like the vector length and so on diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs index a8d39f9573932..d1091b1d3f76a 100644 --- a/src/librustc/metadata/filesearch.rs +++ b/src/librustc/metadata/filesearch.rs @@ -202,9 +202,9 @@ pub fn get_or_default_sysroot() -> Path { } #[cfg(windows)] -static PATH_ENTRY_SEPARATOR: &'static str = ";"; +const PATH_ENTRY_SEPARATOR: char = ';'; #[cfg(not(windows))] -static PATH_ENTRY_SEPARATOR: &'static str = ":"; +const PATH_ENTRY_SEPARATOR: char = ':'; /// Returns RUST_PATH as a string, without default paths added pub fn get_rust_path() -> Option { diff --git a/src/librustc/middle/liveness.rs b/src/librustc/middle/liveness.rs index 5cb034667cc64..fa4f4350f363d 100644 --- a/src/librustc/middle/liveness.rs +++ b/src/librustc/middle/liveness.rs @@ -540,9 +540,9 @@ struct Specials { clean_exit_var: Variable } -static ACC_READ: u32 = 1; -static ACC_WRITE: u32 = 2; -static ACC_USE: u32 = 4; +const ACC_READ: u32 = 1; +const ACC_WRITE: u32 = 2; +const ACC_USE: u32 = 4; struct Liveness<'a, 'tcx: 'a> { ir: &'a mut IrMaps<'a, 'tcx>, diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 635ec09d3394c..51a724f916ddd 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -5757,22 +5757,22 @@ pub fn closure_upvars<'tcx>(typer: &mc::Typer<'tcx>, pub fn is_binopable<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>, op: ast::BinOp) -> bool { #![allow(non_upper_case_globals)] - static tycat_other: int = 0; - static tycat_bool: int = 1; - static tycat_char: int = 2; - static tycat_int: int = 3; - static tycat_float: int = 4; - static tycat_raw_ptr: int = 6; - - static opcat_add: int = 0; - static opcat_sub: int = 1; - static opcat_mult: int = 2; - static opcat_shift: int = 3; - static opcat_rel: int = 4; - static opcat_eq: int = 5; - static opcat_bit: int = 6; - static opcat_logic: int = 7; - static opcat_mod: int = 8; + const tycat_other: int = 0; + const tycat_bool: int = 1; + const tycat_char: int = 2; + const tycat_int: int = 3; + const tycat_float: int = 4; + const tycat_raw_ptr: int = 6; + + const opcat_add: int = 0; + const opcat_sub: int = 1; + const opcat_mult: int = 2; + const opcat_shift: int = 3; + const opcat_rel: int = 4; + const opcat_eq: int = 5; + const opcat_bit: int = 6; + const opcat_logic: int = 7; + const opcat_mod: int = 8; fn opcat(op: ast::BinOp) -> int { match op.node { @@ -5811,8 +5811,8 @@ pub fn is_binopable<'tcx>(cx: &ctxt<'tcx>, ty: Ty<'tcx>, op: ast::BinOp) -> bool } } - static t: bool = true; - static f: bool = false; + const t: bool = true; + const f: bool = false; let tbl = [ // +, -, *, shift, rel, ==, bit, logic, mod diff --git a/src/librustc_back/archive.rs b/src/librustc_back/archive.rs index 3fcae6a8034c2..97b1a8aaaba03 100644 --- a/src/librustc_back/archive.rs +++ b/src/librustc_back/archive.rs @@ -18,7 +18,7 @@ use std::os; use std::str; use syntax::diagnostic::Handler as ErrorHandler; -pub static METADATA_FILENAME: &'static str = "rust.metadata.bin"; +pub const METADATA_FILENAME: &'static str = "rust.metadata.bin"; pub struct ArchiveConfig<'a> { pub handler: &'a ErrorHandler, @@ -242,7 +242,7 @@ impl<'a> ArchiveBuilder<'a> { // Don't allow the total size of `args` to grow beyond 32,000 bytes. // Windows will raise an error if the argument string is longer than // 32,768, and we leave a bit of extra space for the program name. - static ARG_LENGTH_LIMIT: uint = 32000; + const ARG_LENGTH_LIMIT: uint = 32_000; for member_name in &self.members { let len = member_name.as_vec().len(); diff --git a/src/librustc_back/fs.rs b/src/librustc_back/fs.rs index 99a1df95a80cd..56d71820176b4 100644 --- a/src/librustc_back/fs.rs +++ b/src/librustc_back/fs.rs @@ -15,7 +15,7 @@ use std::os; /// Returns an absolute path in the filesystem that `path` points to. The /// returned path does not contain any symlinks in its hierarchy. pub fn realpath(original: &Path) -> old_io::IoResult { - static MAX_LINKS_FOLLOWED: uint = 256; + const MAX_LINKS_FOLLOWED: uint = 256; let original = try!(os::getcwd()).join(original); // Right now lstat on windows doesn't work quite well diff --git a/src/librustc_borrowck/borrowck/mod.rs b/src/librustc_borrowck/borrowck/mod.rs index 67462ab01003e..f6df2acce597b 100644 --- a/src/librustc_borrowck/borrowck/mod.rs +++ b/src/librustc_borrowck/borrowck/mod.rs @@ -312,7 +312,7 @@ impl<'tcx> LoanPath<'tcx> { // FIXME (pnkfelix): See discussion here // https://github.com/pnkfelix/rust/commit/ // b2b39e8700e37ad32b486b9a8409b50a8a53aa51#commitcomment-7892003 -static DOWNCAST_PRINTED_OPERATOR : &'static str = " as "; +const DOWNCAST_PRINTED_OPERATOR: &'static str = " as "; // A local, "cleaned" version of `mc::InteriorKind` that drops // information that is not relevant to loan-path analysis. (In diff --git a/src/librustc_borrowck/borrowck/move_data.rs b/src/librustc_borrowck/borrowck/move_data.rs index 0f7f8e61e37e0..8846f70fbd335 100644 --- a/src/librustc_borrowck/borrowck/move_data.rs +++ b/src/librustc_borrowck/borrowck/move_data.rs @@ -91,8 +91,7 @@ impl Clone for MovePathIndex { } #[allow(non_upper_case_globals)] -static InvalidMovePathIndex: MovePathIndex = - MovePathIndex(usize::MAX); +const InvalidMovePathIndex: MovePathIndex = MovePathIndex(usize::MAX); /// Index into `MoveData.moves`, used like a pointer #[derive(Copy, PartialEq)] @@ -105,8 +104,7 @@ impl MoveIndex { } #[allow(non_upper_case_globals)] -static InvalidMoveIndex: MoveIndex = - MoveIndex(usize::MAX); +const InvalidMoveIndex: MoveIndex = MoveIndex(usize::MAX); pub struct MovePath<'tcx> { /// Loan path corresponding to this move path diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index d08fb2b313ef6..15fae351ddbf2 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -93,7 +93,7 @@ pub mod driver; pub mod pretty; -static BUG_REPORT_URL: &'static str = +const BUG_REPORT_URL: &'static str = "https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports"; @@ -770,7 +770,7 @@ fn parse_crate_attrs(sess: &Session, input: &Input) -> /// The diagnostic emitter yielded to the procedure should be used for reporting /// errors of the compiler. pub fn monitor(f: F) { - static STACK_SIZE: uint = 8 * 1024 * 1024; // 8MB + const STACK_SIZE: uint = 8 * 1024 * 1024; // 8MB let (tx, rx) = channel(); let w = old_io::ChanWriter::new(tx); diff --git a/src/librustc_driver/test.rs b/src/librustc_driver/test.rs index cdbee9da33422..23f07c8e25c11 100644 --- a/src/librustc_driver/test.rs +++ b/src/librustc_driver/test.rs @@ -44,7 +44,7 @@ struct RH<'a> { sub: &'a [RH<'a>] } -static EMPTY_SOURCE_STR: &'static str = "#![feature(no_std)] #![no_std]"; +const EMPTY_SOURCE_STR: &'static str = "#![feature(no_std)] #![no_std]"; struct ExpectErrorEmitter { messages: Vec diff --git a/src/librustc_lint/builtin.rs b/src/librustc_lint/builtin.rs index fe047d2334eec..22311a7158378 100644 --- a/src/librustc_lint/builtin.rs +++ b/src/librustc_lint/builtin.rs @@ -571,7 +571,7 @@ struct RawPtrDeriveVisitor<'a, 'tcx: 'a> { impl<'a, 'tcx, 'v> Visitor<'v> for RawPtrDeriveVisitor<'a, 'tcx> { fn visit_ty(&mut self, ty: &ast::Ty) { - static MSG: &'static str = "use of `#[derive]` with a raw pointer"; + const MSG: &'static str = "use of `#[derive]` with a raw pointer"; if let ast::TyPtr(..) = ty.node { self.cx.span_lint(RAW_POINTER_DERIVE, ty.span, MSG); } diff --git a/src/librustc_trans/back/link.rs b/src/librustc_trans/back/link.rs index ea5001aa814b4..7b377ac3611b6 100644 --- a/src/librustc_trans/back/link.rs +++ b/src/librustc_trans/back/link.rs @@ -317,7 +317,7 @@ pub fn mangle_exported_name<'a, 'tcx>(ccx: &CrateContext<'a, 'tcx>, path: PathEl // e.g. `fn foo() { { fn a() {} } { fn a() {} } }`, so we // generate unique characters from the node id. For now // hopefully 3 characters is enough to avoid collisions. - static EXTRA_CHARS: &'static str = + const EXTRA_CHARS: &'static str = "abcdefghijklmnopqrstuvwxyz\ ABCDEFGHIJKLMNOPQRSTUVWXYZ\ 0123456789"; diff --git a/src/librustc_trans/trans/adt.rs b/src/librustc_trans/trans/adt.rs index 3ea14d3c58929..692d41dd0b772 100644 --- a/src/librustc_trans/trans/adt.rs +++ b/src/librustc_trans/trans/adt.rs @@ -487,12 +487,12 @@ fn range_to_inttype(cx: &CrateContext, hint: Hint, bounds: &IntBounds) -> IntTyp debug!("range_to_inttype: {:?} {:?}", hint, bounds); // Lists of sizes to try. u64 is always allowed as a fallback. #[allow(non_upper_case_globals)] - static choose_shortest: &'static[IntType] = &[ + const choose_shortest: &'static [IntType] = &[ attr::UnsignedInt(ast::TyU8), attr::SignedInt(ast::TyI8), attr::UnsignedInt(ast::TyU16), attr::SignedInt(ast::TyI16), attr::UnsignedInt(ast::TyU32), attr::SignedInt(ast::TyI32)]; #[allow(non_upper_case_globals)] - static at_least_32: &'static[IntType] = &[ + const at_least_32: &'static [IntType] = &[ attr::UnsignedInt(ast::TyU32), attr::SignedInt(ast::TyI32)]; let attempts; diff --git a/src/librustc_trans/trans/meth.rs b/src/librustc_trans/trans/meth.rs index 67f1c39c6e094..c07de3a87ec27 100644 --- a/src/librustc_trans/trans/meth.rs +++ b/src/librustc_trans/trans/meth.rs @@ -45,7 +45,7 @@ use syntax::ast_util::PostExpansionMethod; use syntax::codemap::DUMMY_SP; // drop_glue pointer, size, align. -static VTABLE_OFFSET: uint = 3; +const VTABLE_OFFSET: uint = 3; /// The main "translation" pass for methods. Generates code /// for non-monomorphized methods only. Other methods will diff --git a/src/librustdoc/flock.rs b/src/librustdoc/flock.rs index 6b2676eca3d02..79e348cb03e49 100644 --- a/src/librustdoc/flock.rs +++ b/src/librustdoc/flock.rs @@ -167,7 +167,7 @@ mod imp { use std::os; use std::ptr; - static LOCKFILE_EXCLUSIVE_LOCK: libc::DWORD = 0x00000002; + const LOCKFILE_EXCLUSIVE_LOCK: libc::DWORD = 0x00000002; #[allow(non_snake_case)] extern "system" { diff --git a/src/librustdoc/lib.rs b/src/librustdoc/lib.rs index e58239a82c603..fc304884ec9d8 100644 --- a/src/librustdoc/lib.rs +++ b/src/librustdoc/lib.rs @@ -94,7 +94,7 @@ type Pass = (&'static str, // name fn(clean::Crate) -> plugins::PluginResult, // fn &'static str); // description -static PASSES: &'static [Pass] = &[ +const PASSES: &'static [Pass] = &[ ("strip-hidden", passes::strip_hidden, "strips all doc(hidden) items from the output"), ("unindent-comments", passes::unindent_comments, @@ -105,7 +105,7 @@ static PASSES: &'static [Pass] = &[ "strips all private items from a crate which cannot be seen externally"), ]; -static DEFAULT_PASSES: &'static [&'static str] = &[ +const DEFAULT_PASSES: &'static [&'static str] = &[ "strip-hidden", "strip-private", "collapse-docs", diff --git a/src/libserialize/hex.rs b/src/libserialize/hex.rs index a3cc2d6b935d9..970ae06763c70 100644 --- a/src/libserialize/hex.rs +++ b/src/libserialize/hex.rs @@ -24,7 +24,7 @@ pub trait ToHex { fn to_hex(&self) -> String; } -static CHARS: &'static[u8] = b"0123456789abcdef"; +const CHARS: &'static [u8] = b"0123456789abcdef"; impl ToHex for [u8] { /// Turn a vector of `u8` bytes into a hexadecimal string. diff --git a/src/libstd/net/tcp.rs b/src/libstd/net/tcp.rs index f99cd2b1d1be9..6ce3a939c6a49 100644 --- a/src/libstd/net/tcp.rs +++ b/src/libstd/net/tcp.rs @@ -425,7 +425,7 @@ mod tests { #[test] fn multiple_connect_interleaved_lazy_schedule_ip4() { - static MAX: usize = 10; + const MAX: usize = 10; each_ip(&mut |addr| { let acceptor = t!(TcpListener::bind(&addr)); diff --git a/src/libstd/num/strconv.rs b/src/libstd/num/strconv.rs index f6d05f961e173..90813fe723051 100644 --- a/src/libstd/num/strconv.rs +++ b/src/libstd/num/strconv.rs @@ -422,8 +422,8 @@ pub fn float_to_str_common( // Some constants for from_str_bytes_common's input validation, // they define minimum radix values for which the character is a valid digit. -static DIGIT_P_RADIX: u32 = ('p' as u32) - ('a' as u32) + 11; -static DIGIT_E_RADIX: u32 = ('e' as u32) - ('a' as u32) + 11; +const DIGIT_P_RADIX: u32 = ('p' as u32) - ('a' as u32) + 11; +const DIGIT_E_RADIX: u32 = ('e' as u32) - ('a' as u32) + 11; #[cfg(test)] mod tests { diff --git a/src/libstd/rand/mod.rs b/src/libstd/rand/mod.rs index 5c89144119803..7fe20c37c6cd9 100644 --- a/src/libstd/rand/mod.rs +++ b/src/libstd/rand/mod.rs @@ -321,7 +321,7 @@ impl reseeding::Reseeder for ThreadRngReseeder { } } } -static THREAD_RNG_RESEED_THRESHOLD: usize = 32_768; +const THREAD_RNG_RESEED_THRESHOLD: usize = 32_768; type ThreadRngInner = reseeding::ReseedingRng; /// The thread-local RNG. @@ -638,19 +638,18 @@ mod test { } } -#[cfg(test)] -static RAND_BENCH_N: u64 = 100; - #[cfg(test)] mod bench { extern crate test; use prelude::v1::*; use self::test::Bencher; - use super::{XorShiftRng, StdRng, IsaacRng, Isaac64Rng, Rng, RAND_BENCH_N}; + use super::{XorShiftRng, StdRng, IsaacRng, Isaac64Rng, Rng}; use super::{OsRng, weak_rng}; use mem::size_of; + const RAND_BENCH_N: u64 = 100; + #[bench] fn rand_xorshift(b: &mut Bencher) { let mut rng: XorShiftRng = OsRng::new().unwrap().gen(); diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs index 1a13405633d2e..c2ead2675787b 100644 --- a/src/libstd/rand/os.rs +++ b/src/libstd/rand/os.rs @@ -281,9 +281,9 @@ mod imp { hcryptprov: HCRYPTPROV } - static PROV_RSA_FULL: DWORD = 1; - static CRYPT_SILENT: DWORD = 64; - static CRYPT_VERIFYCONTEXT: DWORD = 0xF0000000; + const PROV_RSA_FULL: DWORD = 1; + const CRYPT_SILENT: DWORD = 64; + const CRYPT_VERIFYCONTEXT: DWORD = 0xF0000000; #[allow(non_snake_case)] extern "system" { diff --git a/src/libstd/sync/mpsc/mod.rs b/src/libstd/sync/mpsc/mod.rs index 1310d476f8ee2..ee8bef50d8999 100644 --- a/src/libstd/sync/mpsc/mod.rs +++ b/src/libstd/sync/mpsc/mod.rs @@ -1157,8 +1157,8 @@ mod test { #[test] fn stress_shared() { - static AMT: u32 = 10000; - static NTHREADS: u32 = 8; + const AMT: u32 = 10000; + const NTHREADS: u32 = 8; let (tx, rx) = channel::(); let t = thread::spawn(move|| { @@ -1663,8 +1663,8 @@ mod sync_tests { #[test] fn stress_shared() { - static AMT: u32 = 1000; - static NTHREADS: u32 = 8; + const AMT: u32 = 1000; + const NTHREADS: u32 = 8; let (tx, rx) = sync_channel::(0); let (dtx, drx) = sync_channel::<()>(0); diff --git a/src/libstd/sync/mpsc/select.rs b/src/libstd/sync/mpsc/select.rs index 8de5bbc620665..2c14c9fe3f199 100644 --- a/src/libstd/sync/mpsc/select.rs +++ b/src/libstd/sync/mpsc/select.rs @@ -473,7 +473,7 @@ mod test { #[test] fn stress() { - static AMT: i32 = 10000; + const AMT: i32 = 10000; let (tx1, rx1) = channel::(); let (tx2, rx2) = channel::(); let (tx3, rx3) = channel::<()>(); diff --git a/src/libstd/sync/mutex.rs b/src/libstd/sync/mutex.rs index 4c3b5d98a3cb1..6f0febd61e803 100644 --- a/src/libstd/sync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -390,8 +390,8 @@ mod test { fn lots_and_lots() { static M: StaticMutex = MUTEX_INIT; static mut CNT: u32 = 0; - static J: u32 = 1000; - static K: u32 = 3; + const J: u32 = 1000; + const K: u32 = 3; fn inc() { for _ in 0..J { diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 454c5b4f0cf7b..e9ff6c0bf9df0 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -436,8 +436,8 @@ mod tests { #[test] fn frob() { static R: StaticRwLock = RW_LOCK_INIT; - static N: usize = 10; - static M: usize = 1000; + const N: usize = 10; + const M: usize = 1000; let (tx, rx) = channel::<()>(); for _ in 0..N { diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index fb9d6fef1faa7..6cae127441ccb 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -43,7 +43,7 @@ use sys_common::AsInner; use unicode::str::{Utf16Item, utf16_items}; use vec::Vec; -static UTF8_REPLACEMENT_CHARACTER: &'static [u8] = b"\xEF\xBF\xBD"; +const UTF8_REPLACEMENT_CHARACTER: &'static [u8] = b"\xEF\xBF\xBD"; /// A Unicode code point: from U+0000 to U+10FFFF. /// diff --git a/src/libstd/sys/windows/os.rs b/src/libstd/sys/windows/os.rs index 587ab7924fd1d..89cf8a08a68f9 100644 --- a/src/libstd/sys/windows/os.rs +++ b/src/libstd/sys/windows/os.rs @@ -59,8 +59,8 @@ pub fn error_string(errnum: i32) -> String { -> DWORD; } - static FORMAT_MESSAGE_FROM_SYSTEM: DWORD = 0x00001000; - static FORMAT_MESSAGE_IGNORE_INSERTS: DWORD = 0x00000200; + const FORMAT_MESSAGE_FROM_SYSTEM: DWORD = 0x00001000; + const FORMAT_MESSAGE_IGNORE_INSERTS: DWORD = 0x00000200; // This value is calculated from the macro // MAKELANGID(LANG_SYSTEM_DEFAULT, SUBLANG_SYS_DEFAULT) diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs index 5dd4be336ec25..b0e79f2498db8 100644 --- a/src/libstd/thread.rs +++ b/src/libstd/thread.rs @@ -853,7 +853,7 @@ mod test { // climbing the task tree to dereference each ancestor. (See #1789) // (well, it would if the constant were 8000+ - I lowered it to be more // valgrind-friendly. try this at home, instead..!) - static GENERATIONS: usize = 16; + const GENERATIONS: usize = 16; fn child_no(x: usize) -> Thunk<'static> { return Thunk::new(move|| { if x < GENERATIONS { diff --git a/src/libsyntax/abi.rs b/src/libsyntax/abi.rs index 2cf157bd24522..896e638deb465 100644 --- a/src/libsyntax/abi.rs +++ b/src/libsyntax/abi.rs @@ -77,11 +77,11 @@ pub enum AbiArchitecture { } #[allow(non_upper_case_globals)] -static AbiDatas: &'static [AbiData] = &[ +const AbiDatas: &'static [AbiData] = &[ // Platform-specific ABIs AbiData {abi: Cdecl, name: "cdecl" }, AbiData {abi: Stdcall, name: "stdcall" }, - AbiData {abi: Fastcall, name:"fastcall" }, + AbiData {abi: Fastcall, name: "fastcall" }, AbiData {abi: Aapcs, name: "aapcs" }, AbiData {abi: Win64, name: "win64" }, diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs index 27219774cf148..a6f4974502c21 100644 --- a/src/libsyntax/diagnostic.rs +++ b/src/libsyntax/diagnostic.rs @@ -25,7 +25,7 @@ use term::WriterWrapper; use term; /// maximum number of lines we will print for each error; arbitrary. -static MAX_LINES: usize = 6; +const MAX_LINES: usize = 6; #[derive(Clone, Copy)] pub enum RenderSpan { diff --git a/src/libsyntax/ext/asm.rs b/src/libsyntax/ext/asm.rs index ae48084947e43..e58a3de41c05c 100644 --- a/src/libsyntax/ext/asm.rs +++ b/src/libsyntax/ext/asm.rs @@ -45,7 +45,7 @@ impl State { } } -static OPTIONS: &'static [&'static str] = &["volatile", "alignstack", "intel"]; +const OPTIONS: &'static [&'static str] = &["volatile", "alignstack", "intel"]; pub fn expand_asm<'cx>(cx: &'cx mut ExtCtxt, sp: Span, tts: &[ast::TokenTree]) -> Box { diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index ffc136d5a1d1a..cf0591365ae3b 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -45,7 +45,7 @@ use std::ascii::AsciiExt; // stable (active). // NB: The featureck.py script parses this information directly out of the source // so take care when modifying it. -static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ +const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ ("globs", "1.0.0", Accepted), ("macro_rules", "1.0.0", Accepted), ("struct_variant", "1.0.0", Accepted), @@ -159,7 +159,7 @@ enum Status { } // Attributes that have a special meaning to rustc or rustdoc -pub static KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[ +pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[ // Normal attributes ("warn", Normal), diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs index 7a5d75581a511..3ad1d96a45da7 100644 --- a/src/libsyntax/parse/lexer/comments.rs +++ b/src/libsyntax/parse/lexer/comments.rs @@ -124,8 +124,8 @@ pub fn strip_doc_comment_decoration(comment: &str) -> String { } // one-line comments lose their prefix - static ONLINERS: &'static [&'static str] = &["///!", "///", "//!", "//"]; - for prefix in ONLINERS { + const ONELINERS: &'static [&'static str] = &["///!", "///", "//!", "//"]; + for prefix in ONELINERS { if comment.starts_with(*prefix) { return (&comment[prefix.len()..]).to_string(); } diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 2797ef084d9ca..61a3a5ca82a32 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -425,10 +425,10 @@ macro_rules! declare_special_idents_and_keywords {( $( ($rk_name:expr, $rk_variant:ident, $rk_str:expr); )* } ) => { - static STRICT_KEYWORD_START: ast::Name = first!($( ast::Name($sk_name), )*); - static STRICT_KEYWORD_FINAL: ast::Name = last!($( ast::Name($sk_name), )*); - static RESERVED_KEYWORD_START: ast::Name = first!($( ast::Name($rk_name), )*); - static RESERVED_KEYWORD_FINAL: ast::Name = last!($( ast::Name($rk_name), )*); + const STRICT_KEYWORD_START: ast::Name = first!($( ast::Name($sk_name), )*); + const STRICT_KEYWORD_FINAL: ast::Name = last!($( ast::Name($sk_name), )*); + const RESERVED_KEYWORD_START: ast::Name = first!($( ast::Name($rk_name), )*); + const RESERVED_KEYWORD_FINAL: ast::Name = last!($( ast::Name($rk_name), )*); pub mod special_idents { use ast; diff --git a/src/libsyntax/print/pp.rs b/src/libsyntax/print/pp.rs index 5b3fde8535b3d..4cef7ed469faf 100644 --- a/src/libsyntax/print/pp.rs +++ b/src/libsyntax/print/pp.rs @@ -159,7 +159,7 @@ pub struct PrintStackElem { pbreak: PrintStackBreak } -static SIZE_INFINITY: isize = 0xffff; +const SIZE_INFINITY: isize = 0xffff; pub fn mk_printer(out: Box, linewidth: usize) -> Printer { // Yes 3, it makes the ring buffers big enough to never diff --git a/src/libunicode/tables.rs b/src/libunicode/tables.rs index 61f447a3dd3b6..99a6b6aa1806f 100644 --- a/src/libunicode/tables.rs +++ b/src/libunicode/tables.rs @@ -27,7 +27,7 @@ fn bsearch_range_table(c: char, r: &'static [(char,char)]) -> bool { } pub mod general_category { - pub static C_table: &'static [(char, char)] = &[ + pub const C_table: &'static [(char, char)] = &[ ('\u{0}', '\u{1f}'), ('\u{7f}', '\u{9f}'), ('\u{ad}', '\u{ad}'), ('\u{378}', '\u{379}'), ('\u{380}', '\u{383}'), ('\u{38b}', '\u{38b}'), ('\u{38d}', '\u{38d}'), ('\u{3a2}', '\u{3a2}'), ('\u{530}', '\u{530}'), ('\u{557}', '\u{558}'), ('\u{560}', '\u{560}'), @@ -216,7 +216,7 @@ pub mod general_category { ('\u{e01f0}', '\u{10ffff}') ]; - pub static Cc_table: &'static [(char, char)] = &[ + pub const Cc_table: &'static [(char, char)] = &[ ('\u{0}', '\u{1f}'), ('\u{7f}', '\u{9f}') ]; @@ -224,7 +224,7 @@ pub mod general_category { super::bsearch_range_table(c, Cc_table) } - pub static Cf_table: &'static [(char, char)] = &[ + pub const Cf_table: &'static [(char, char)] = &[ ('\u{ad}', '\u{ad}'), ('\u{600}', '\u{605}'), ('\u{61c}', '\u{61c}'), ('\u{6dd}', '\u{6dd}'), ('\u{70f}', '\u{70f}'), ('\u{180e}', '\u{180e}'), ('\u{200b}', '\u{200f}'), ('\u{202a}', '\u{202e}'), ('\u{2060}', '\u{2064}'), ('\u{2066}', '\u{206f}'), ('\u{feff}', @@ -233,7 +233,7 @@ pub mod general_category { '\u{e007f}') ]; - pub static Cn_table: &'static [(char, char)] = &[ + pub const Cn_table: &'static [(char, char)] = &[ ('\u{378}', '\u{379}'), ('\u{380}', '\u{383}'), ('\u{38b}', '\u{38b}'), ('\u{38d}', '\u{38d}'), ('\u{3a2}', '\u{3a2}'), ('\u{530}', '\u{530}'), ('\u{557}', '\u{558}'), ('\u{560}', '\u{560}'), ('\u{588}', '\u{588}'), ('\u{58b}', '\u{58c}'), ('\u{590}', @@ -422,12 +422,12 @@ pub mod general_category { ('\u{10fffe}', '\u{10ffff}') ]; - pub static Co_table: &'static [(char, char)] = &[ + pub const Co_table: &'static [(char, char)] = &[ ('\u{e000}', '\u{e000}'), ('\u{f8ff}', '\u{f8ff}'), ('\u{f0000}', '\u{f0000}'), ('\u{ffffd}', '\u{ffffd}'), ('\u{100000}', '\u{100000}'), ('\u{10fffd}', '\u{10fffd}') ]; - pub static L_table: &'static [(char, char)] = &[ + pub const L_table: &'static [(char, char)] = &[ ('\u{41}', '\u{5a}'), ('\u{61}', '\u{7a}'), ('\u{aa}', '\u{aa}'), ('\u{b5}', '\u{b5}'), ('\u{ba}', '\u{ba}'), ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{2c1}'), ('\u{2c6}', '\u{2d1}'), ('\u{2e0}', '\u{2e4}'), ('\u{2ec}', '\u{2ec}'), ('\u{2ee}', @@ -593,7 +593,7 @@ pub mod general_category { ('\u{2b81d}', '\u{2b81d}'), ('\u{2f800}', '\u{2fa1d}') ]; - pub static LC_table: &'static [(char, char)] = &[ + pub const LC_table: &'static [(char, char)] = &[ ('\u{41}', '\u{5a}'), ('\u{61}', '\u{7a}'), ('\u{b5}', '\u{b5}'), ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{1ba}'), ('\u{1bc}', '\u{1bf}'), ('\u{1c4}', '\u{293}'), ('\u{295}', '\u{2af}'), ('\u{370}', '\u{373}'), ('\u{376}', '\u{377}'), ('\u{37b}', @@ -631,7 +631,7 @@ pub mod general_category { ('\u{1d7aa}', '\u{1d7c2}'), ('\u{1d7c4}', '\u{1d7cb}') ]; - pub static Ll_table: &'static [(char, char)] = &[ + pub const Ll_table: &'static [(char, char)] = &[ ('\u{61}', '\u{7a}'), ('\u{b5}', '\u{b5}'), ('\u{df}', '\u{f6}'), ('\u{f8}', '\u{ff}'), ('\u{101}', '\u{101}'), ('\u{103}', '\u{103}'), ('\u{105}', '\u{105}'), ('\u{107}', '\u{107}'), ('\u{109}', '\u{109}'), ('\u{10b}', '\u{10b}'), ('\u{10d}', '\u{10d}'), @@ -814,7 +814,7 @@ pub mod general_category { '\u{1d7c2}'), ('\u{1d7c4}', '\u{1d7c9}'), ('\u{1d7cb}', '\u{1d7cb}') ]; - pub static Lm_table: &'static [(char, char)] = &[ + pub const Lm_table: &'static [(char, char)] = &[ ('\u{2b0}', '\u{2c1}'), ('\u{2c6}', '\u{2d1}'), ('\u{2e0}', '\u{2e4}'), ('\u{2ec}', '\u{2ec}'), ('\u{2ee}', '\u{2ee}'), ('\u{374}', '\u{374}'), ('\u{37a}', '\u{37a}'), ('\u{559}', '\u{559}'), ('\u{640}', '\u{640}'), ('\u{6e5}', '\u{6e6}'), ('\u{7f4}', @@ -834,7 +834,7 @@ pub mod general_category { '\u{16f9f}') ]; - pub static Lo_table: &'static [(char, char)] = &[ + pub const Lo_table: &'static [(char, char)] = &[ ('\u{aa}', '\u{aa}'), ('\u{ba}', '\u{ba}'), ('\u{1bb}', '\u{1bb}'), ('\u{1c0}', '\u{1c3}'), ('\u{294}', '\u{294}'), ('\u{5d0}', '\u{5ea}'), ('\u{5f0}', '\u{5f2}'), ('\u{620}', '\u{63f}'), ('\u{641}', '\u{64a}'), ('\u{66e}', '\u{66f}'), ('\u{671}', '\u{6d3}'), @@ -964,13 +964,13 @@ pub mod general_category { ('\u{2b740}', '\u{2b740}'), ('\u{2b81d}', '\u{2b81d}'), ('\u{2f800}', '\u{2fa1d}') ]; - pub static Lt_table: &'static [(char, char)] = &[ + pub const Lt_table: &'static [(char, char)] = &[ ('\u{1c5}', '\u{1c5}'), ('\u{1c8}', '\u{1c8}'), ('\u{1cb}', '\u{1cb}'), ('\u{1f2}', '\u{1f2}'), ('\u{1f88}', '\u{1f8f}'), ('\u{1f98}', '\u{1f9f}'), ('\u{1fa8}', '\u{1faf}'), ('\u{1fbc}', '\u{1fbc}'), ('\u{1fcc}', '\u{1fcc}'), ('\u{1ffc}', '\u{1ffc}') ]; - pub static Lu_table: &'static [(char, char)] = &[ + pub const Lu_table: &'static [(char, char)] = &[ ('\u{41}', '\u{5a}'), ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{de}'), ('\u{100}', '\u{100}'), ('\u{102}', '\u{102}'), ('\u{104}', '\u{104}'), ('\u{106}', '\u{106}'), ('\u{108}', '\u{108}'), ('\u{10a}', '\u{10a}'), ('\u{10c}', '\u{10c}'), ('\u{10e}', '\u{10e}'), @@ -1153,7 +1153,7 @@ pub mod general_category { '\u{1d7ca}') ]; - pub static M_table: &'static [(char, char)] = &[ + pub const M_table: &'static [(char, char)] = &[ ('\u{300}', '\u{36f}'), ('\u{483}', '\u{489}'), ('\u{591}', '\u{5bd}'), ('\u{5bf}', '\u{5bf}'), ('\u{5c1}', '\u{5c2}'), ('\u{5c4}', '\u{5c5}'), ('\u{5c7}', '\u{5c7}'), ('\u{610}', '\u{61a}'), ('\u{64b}', '\u{65f}'), ('\u{670}', '\u{670}'), ('\u{6d6}', @@ -1224,7 +1224,7 @@ pub mod general_category { ('\u{1e8d0}', '\u{1e8d6}'), ('\u{e0100}', '\u{e01ef}') ]; - pub static Mc_table: &'static [(char, char)] = &[ + pub const Mc_table: &'static [(char, char)] = &[ ('\u{903}', '\u{903}'), ('\u{93b}', '\u{93b}'), ('\u{93e}', '\u{940}'), ('\u{949}', '\u{94c}'), ('\u{94e}', '\u{94f}'), ('\u{982}', '\u{983}'), ('\u{9be}', '\u{9c0}'), ('\u{9c7}', '\u{9c8}'), ('\u{9cb}', '\u{9cc}'), ('\u{9d7}', '\u{9d7}'), ('\u{a03}', @@ -1271,12 +1271,12 @@ pub mod general_category { ('\u{1d165}', '\u{1d166}'), ('\u{1d16d}', '\u{1d172}') ]; - pub static Me_table: &'static [(char, char)] = &[ + pub const Me_table: &'static [(char, char)] = &[ ('\u{488}', '\u{489}'), ('\u{1abe}', '\u{1abe}'), ('\u{20dd}', '\u{20e0}'), ('\u{20e2}', '\u{20e4}'), ('\u{a670}', '\u{a672}') ]; - pub static Mn_table: &'static [(char, char)] = &[ + pub const Mn_table: &'static [(char, char)] = &[ ('\u{300}', '\u{36f}'), ('\u{483}', '\u{487}'), ('\u{591}', '\u{5bd}'), ('\u{5bf}', '\u{5bf}'), ('\u{5c1}', '\u{5c2}'), ('\u{5c4}', '\u{5c5}'), ('\u{5c7}', '\u{5c7}'), ('\u{610}', '\u{61a}'), ('\u{64b}', '\u{65f}'), ('\u{670}', '\u{670}'), ('\u{6d6}', @@ -1355,7 +1355,7 @@ pub mod general_category { '\u{1e8d6}'), ('\u{e0100}', '\u{e01ef}') ]; - pub static N_table: &'static [(char, char)] = &[ + pub const N_table: &'static [(char, char)] = &[ ('\u{30}', '\u{39}'), ('\u{660}', '\u{669}'), ('\u{6f0}', '\u{6f9}'), ('\u{7c0}', '\u{7c9}'), ('\u{966}', '\u{96f}'), ('\u{9e6}', '\u{9ef}'), ('\u{a66}', '\u{a6f}'), ('\u{ae6}', '\u{aef}'), ('\u{b66}', '\u{b6f}'), ('\u{be6}', '\u{bef}'), ('\u{c66}', @@ -1381,7 +1381,7 @@ pub mod general_category { super::bsearch_range_table(c, N_table) } - pub static Nd_table: &'static [(char, char)] = &[ + pub const Nd_table: &'static [(char, char)] = &[ ('\u{30}', '\u{39}'), ('\u{660}', '\u{669}'), ('\u{6f0}', '\u{6f9}'), ('\u{7c0}', '\u{7c9}'), ('\u{966}', '\u{96f}'), ('\u{9e6}', '\u{9ef}'), ('\u{a66}', '\u{a6f}'), ('\u{ae6}', '\u{aef}'), ('\u{b66}', '\u{b6f}'), ('\u{be6}', '\u{bef}'), ('\u{c66}', @@ -1399,14 +1399,14 @@ pub mod general_category { ('\u{16a60}', '\u{16a69}'), ('\u{16b50}', '\u{16b59}'), ('\u{1d7ce}', '\u{1d7ff}') ]; - pub static Nl_table: &'static [(char, char)] = &[ + pub const Nl_table: &'static [(char, char)] = &[ ('\u{16ee}', '\u{16f0}'), ('\u{2160}', '\u{2182}'), ('\u{2185}', '\u{2188}'), ('\u{3007}', '\u{3007}'), ('\u{3021}', '\u{3029}'), ('\u{3038}', '\u{303a}'), ('\u{a6e6}', '\u{a6ef}'), ('\u{10140}', '\u{10174}'), ('\u{10341}', '\u{10341}'), ('\u{1034a}', '\u{1034a}'), ('\u{103d1}', '\u{103d5}'), ('\u{12400}', '\u{1246e}') ]; - pub static No_table: &'static [(char, char)] = &[ + pub const No_table: &'static [(char, char)] = &[ ('\u{b2}', '\u{b3}'), ('\u{b9}', '\u{b9}'), ('\u{bc}', '\u{be}'), ('\u{9f4}', '\u{9f9}'), ('\u{b72}', '\u{b77}'), ('\u{bf0}', '\u{bf2}'), ('\u{c78}', '\u{c7e}'), ('\u{d70}', '\u{d75}'), ('\u{f2a}', '\u{f33}'), ('\u{1369}', '\u{137c}'), ('\u{17f0}', '\u{17f9}'), @@ -1425,7 +1425,7 @@ pub mod general_category { '\u{1d371}'), ('\u{1e8c7}', '\u{1e8cf}'), ('\u{1f100}', '\u{1f10c}') ]; - pub static P_table: &'static [(char, char)] = &[ + pub const P_table: &'static [(char, char)] = &[ ('\u{21}', '\u{23}'), ('\u{25}', '\u{2a}'), ('\u{2c}', '\u{2f}'), ('\u{3a}', '\u{3b}'), ('\u{3f}', '\u{40}'), ('\u{5b}', '\u{5d}'), ('\u{5f}', '\u{5f}'), ('\u{7b}', '\u{7b}'), ('\u{7d}', '\u{7d}'), ('\u{a1}', '\u{a1}'), ('\u{a7}', '\u{a7}'), ('\u{ab}', '\u{ab}'), @@ -1474,12 +1474,12 @@ pub mod general_category { '\u{1bc9f}') ]; - pub static Pc_table: &'static [(char, char)] = &[ + pub const Pc_table: &'static [(char, char)] = &[ ('\u{5f}', '\u{5f}'), ('\u{203f}', '\u{2040}'), ('\u{2054}', '\u{2054}'), ('\u{fe33}', '\u{fe34}'), ('\u{fe4d}', '\u{fe4f}'), ('\u{ff3f}', '\u{ff3f}') ]; - pub static Pd_table: &'static [(char, char)] = &[ + pub const Pd_table: &'static [(char, char)] = &[ ('\u{2d}', '\u{2d}'), ('\u{58a}', '\u{58a}'), ('\u{5be}', '\u{5be}'), ('\u{1400}', '\u{1400}'), ('\u{1806}', '\u{1806}'), ('\u{2010}', '\u{2015}'), ('\u{2e17}', '\u{2e17}'), ('\u{2e1a}', '\u{2e1a}'), ('\u{2e3a}', '\u{2e3b}'), ('\u{2e40}', '\u{2e40}'), ('\u{301c}', @@ -1487,7 +1487,7 @@ pub mod general_category { ('\u{fe58}', '\u{fe58}'), ('\u{fe63}', '\u{fe63}'), ('\u{ff0d}', '\u{ff0d}') ]; - pub static Pe_table: &'static [(char, char)] = &[ + pub const Pe_table: &'static [(char, char)] = &[ ('\u{29}', '\u{29}'), ('\u{5d}', '\u{5d}'), ('\u{7d}', '\u{7d}'), ('\u{f3b}', '\u{f3b}'), ('\u{f3d}', '\u{f3d}'), ('\u{169c}', '\u{169c}'), ('\u{2046}', '\u{2046}'), ('\u{207e}', '\u{207e}'), ('\u{208e}', '\u{208e}'), ('\u{2309}', '\u{2309}'), ('\u{230b}', '\u{230b}'), @@ -1511,20 +1511,20 @@ pub mod general_category { '\u{ff60}'), ('\u{ff63}', '\u{ff63}') ]; - pub static Pf_table: &'static [(char, char)] = &[ + pub const Pf_table: &'static [(char, char)] = &[ ('\u{bb}', '\u{bb}'), ('\u{2019}', '\u{2019}'), ('\u{201d}', '\u{201d}'), ('\u{203a}', '\u{203a}'), ('\u{2e03}', '\u{2e03}'), ('\u{2e05}', '\u{2e05}'), ('\u{2e0a}', '\u{2e0a}'), ('\u{2e0d}', '\u{2e0d}'), ('\u{2e1d}', '\u{2e1d}'), ('\u{2e21}', '\u{2e21}') ]; - pub static Pi_table: &'static [(char, char)] = &[ + pub const Pi_table: &'static [(char, char)] = &[ ('\u{ab}', '\u{ab}'), ('\u{2018}', '\u{2018}'), ('\u{201b}', '\u{201c}'), ('\u{201f}', '\u{201f}'), ('\u{2039}', '\u{2039}'), ('\u{2e02}', '\u{2e02}'), ('\u{2e04}', '\u{2e04}'), ('\u{2e09}', '\u{2e09}'), ('\u{2e0c}', '\u{2e0c}'), ('\u{2e1c}', '\u{2e1c}'), ('\u{2e20}', '\u{2e20}') ]; - pub static Po_table: &'static [(char, char)] = &[ + pub const Po_table: &'static [(char, char)] = &[ ('\u{21}', '\u{23}'), ('\u{25}', '\u{27}'), ('\u{2a}', '\u{2a}'), ('\u{2c}', '\u{2c}'), ('\u{2e}', '\u{2f}'), ('\u{3a}', '\u{3b}'), ('\u{3f}', '\u{40}'), ('\u{5c}', '\u{5c}'), ('\u{a1}', '\u{a1}'), ('\u{a7}', '\u{a7}'), ('\u{b6}', '\u{b7}'), ('\u{bf}', '\u{bf}'), @@ -1572,7 +1572,7 @@ pub mod general_category { '\u{1bc9f}') ]; - pub static Ps_table: &'static [(char, char)] = &[ + pub const Ps_table: &'static [(char, char)] = &[ ('\u{28}', '\u{28}'), ('\u{5b}', '\u{5b}'), ('\u{7b}', '\u{7b}'), ('\u{f3a}', '\u{f3a}'), ('\u{f3c}', '\u{f3c}'), ('\u{169b}', '\u{169b}'), ('\u{201a}', '\u{201a}'), ('\u{201e}', '\u{201e}'), ('\u{2045}', '\u{2045}'), ('\u{207d}', '\u{207d}'), ('\u{208d}', '\u{208d}'), @@ -1597,7 +1597,7 @@ pub mod general_category { ('\u{ff62}', '\u{ff62}') ]; - pub static S_table: &'static [(char, char)] = &[ + pub const S_table: &'static [(char, char)] = &[ ('\u{24}', '\u{24}'), ('\u{2b}', '\u{2b}'), ('\u{3c}', '\u{3e}'), ('\u{5e}', '\u{5e}'), ('\u{60}', '\u{60}'), ('\u{7c}', '\u{7c}'), ('\u{7e}', '\u{7e}'), ('\u{a2}', '\u{a6}'), ('\u{a8}', '\u{a9}'), ('\u{ac}', '\u{ac}'), ('\u{ae}', '\u{b1}'), ('\u{b4}', '\u{b4}'), @@ -1663,7 +1663,7 @@ pub mod general_category { '\u{1f887}'), ('\u{1f890}', '\u{1f8ad}') ]; - pub static Sc_table: &'static [(char, char)] = &[ + pub const Sc_table: &'static [(char, char)] = &[ ('\u{24}', '\u{24}'), ('\u{a2}', '\u{a5}'), ('\u{58f}', '\u{58f}'), ('\u{60b}', '\u{60b}'), ('\u{9f2}', '\u{9f3}'), ('\u{9fb}', '\u{9fb}'), ('\u{af1}', '\u{af1}'), ('\u{bf9}', '\u{bf9}'), ('\u{e3f}', '\u{e3f}'), ('\u{17db}', '\u{17db}'), ('\u{20a0}', '\u{20bd}'), @@ -1671,7 +1671,7 @@ pub mod general_category { '\u{ff04}'), ('\u{ffe0}', '\u{ffe1}'), ('\u{ffe5}', '\u{ffe6}') ]; - pub static Sk_table: &'static [(char, char)] = &[ + pub const Sk_table: &'static [(char, char)] = &[ ('\u{5e}', '\u{5e}'), ('\u{60}', '\u{60}'), ('\u{a8}', '\u{a8}'), ('\u{af}', '\u{af}'), ('\u{b4}', '\u{b4}'), ('\u{b8}', '\u{b8}'), ('\u{2c2}', '\u{2c5}'), ('\u{2d2}', '\u{2df}'), ('\u{2e5}', '\u{2eb}'), ('\u{2ed}', '\u{2ed}'), ('\u{2ef}', '\u{2ff}'), ('\u{375}', @@ -1682,7 +1682,7 @@ pub mod general_category { '\u{ff3e}'), ('\u{ff40}', '\u{ff40}'), ('\u{ffe3}', '\u{ffe3}') ]; - pub static Sm_table: &'static [(char, char)] = &[ + pub const Sm_table: &'static [(char, char)] = &[ ('\u{2b}', '\u{2b}'), ('\u{3c}', '\u{3e}'), ('\u{7c}', '\u{7c}'), ('\u{7e}', '\u{7e}'), ('\u{ac}', '\u{ac}'), ('\u{b1}', '\u{b1}'), ('\u{d7}', '\u{d7}'), ('\u{f7}', '\u{f7}'), ('\u{3f6}', '\u{3f6}'), ('\u{606}', '\u{608}'), ('\u{2044}', '\u{2044}'), ('\u{2052}', @@ -1704,7 +1704,7 @@ pub mod general_category { '\u{1d7c3}'), ('\u{1eef0}', '\u{1eef1}') ]; - pub static So_table: &'static [(char, char)] = &[ + pub const So_table: &'static [(char, char)] = &[ ('\u{a6}', '\u{a6}'), ('\u{a9}', '\u{a9}'), ('\u{ae}', '\u{ae}'), ('\u{b0}', '\u{b0}'), ('\u{482}', '\u{482}'), ('\u{58d}', '\u{58e}'), ('\u{60e}', '\u{60f}'), ('\u{6de}', '\u{6de}'), ('\u{6e9}', '\u{6e9}'), ('\u{6fd}', '\u{6fe}'), ('\u{7f6}', '\u{7f6}'), @@ -1757,21 +1757,21 @@ pub mod general_category { '\u{1f887}'), ('\u{1f890}', '\u{1f8ad}') ]; - pub static Z_table: &'static [(char, char)] = &[ + pub const Z_table: &'static [(char, char)] = &[ ('\u{20}', '\u{20}'), ('\u{a0}', '\u{a0}'), ('\u{1680}', '\u{1680}'), ('\u{2000}', '\u{200a}'), ('\u{2028}', '\u{2029}'), ('\u{202f}', '\u{202f}'), ('\u{205f}', '\u{205f}'), ('\u{3000}', '\u{3000}') ]; - pub static Zl_table: &'static [(char, char)] = &[ + pub const Zl_table: &'static [(char, char)] = &[ ('\u{2028}', '\u{2028}') ]; - pub static Zp_table: &'static [(char, char)] = &[ + pub const Zp_table: &'static [(char, char)] = &[ ('\u{2029}', '\u{2029}') ]; - pub static Zs_table: &'static [(char, char)] = &[ + pub const Zs_table: &'static [(char, char)] = &[ ('\u{20}', '\u{20}'), ('\u{a0}', '\u{a0}'), ('\u{1680}', '\u{1680}'), ('\u{2000}', '\u{200a}'), ('\u{202f}', '\u{202f}'), ('\u{205f}', '\u{205f}'), ('\u{3000}', '\u{3000}') ]; @@ -1779,7 +1779,7 @@ pub mod general_category { } pub mod derived_property { - pub static Alphabetic_table: &'static [(char, char)] = &[ + pub const Alphabetic_table: &'static [(char, char)] = &[ ('\u{41}', '\u{5a}'), ('\u{61}', '\u{7a}'), ('\u{aa}', '\u{aa}'), ('\u{b5}', '\u{b5}'), ('\u{ba}', '\u{ba}'), ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{1ba}'), ('\u{1bb}', '\u{1bb}'), ('\u{1bc}', '\u{1bf}'), ('\u{1c0}', '\u{1c3}'), ('\u{1c4}', @@ -2057,7 +2057,7 @@ pub mod derived_property { super::bsearch_range_table(c, Alphabetic_table) } - pub static Default_Ignorable_Code_Point_table: &'static [(char, char)] = &[ + pub const Default_Ignorable_Code_Point_table: &'static [(char, char)] = &[ ('\u{ad}', '\u{ad}'), ('\u{34f}', '\u{34f}'), ('\u{61c}', '\u{61c}'), ('\u{115f}', '\u{1160}'), ('\u{17b4}', '\u{17b5}'), ('\u{180b}', '\u{180d}'), ('\u{180e}', '\u{180e}'), ('\u{200b}', '\u{200f}'), ('\u{202a}', '\u{202e}'), ('\u{2060}', '\u{2064}'), ('\u{2065}', @@ -2068,7 +2068,7 @@ pub mod derived_property { '\u{e00ff}'), ('\u{e0100}', '\u{e01ef}'), ('\u{e01f0}', '\u{e0fff}') ]; - pub static Lowercase_table: &'static [(char, char)] = &[ + pub const Lowercase_table: &'static [(char, char)] = &[ ('\u{61}', '\u{7a}'), ('\u{aa}', '\u{aa}'), ('\u{b5}', '\u{b5}'), ('\u{ba}', '\u{ba}'), ('\u{df}', '\u{f6}'), ('\u{f8}', '\u{ff}'), ('\u{101}', '\u{101}'), ('\u{103}', '\u{103}'), ('\u{105}', '\u{105}'), ('\u{107}', '\u{107}'), ('\u{109}', '\u{109}'), ('\u{10b}', @@ -2261,7 +2261,7 @@ pub mod derived_property { super::bsearch_range_table(c, Lowercase_table) } - pub static Uppercase_table: &'static [(char, char)] = &[ + pub const Uppercase_table: &'static [(char, char)] = &[ ('\u{41}', '\u{5a}'), ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{de}'), ('\u{100}', '\u{100}'), ('\u{102}', '\u{102}'), ('\u{104}', '\u{104}'), ('\u{106}', '\u{106}'), ('\u{108}', '\u{108}'), ('\u{10a}', '\u{10a}'), ('\u{10c}', '\u{10c}'), ('\u{10e}', '\u{10e}'), @@ -2449,7 +2449,7 @@ pub mod derived_property { super::bsearch_range_table(c, Uppercase_table) } - pub static XID_Continue_table: &'static [(char, char)] = &[ + pub const XID_Continue_table: &'static [(char, char)] = &[ ('\u{30}', '\u{39}'), ('\u{41}', '\u{5a}'), ('\u{5f}', '\u{5f}'), ('\u{61}', '\u{7a}'), ('\u{aa}', '\u{aa}'), ('\u{b5}', '\u{b5}'), ('\u{b7}', '\u{b7}'), ('\u{ba}', '\u{ba}'), ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{1ba}'), ('\u{1bb}', '\u{1bb}'), @@ -2775,7 +2775,7 @@ pub mod derived_property { super::bsearch_range_table(c, XID_Continue_table) } - pub static XID_Start_table: &'static [(char, char)] = &[ + pub const XID_Start_table: &'static [(char, char)] = &[ ('\u{41}', '\u{5a}'), ('\u{61}', '\u{7a}'), ('\u{aa}', '\u{aa}'), ('\u{b5}', '\u{b5}'), ('\u{ba}', '\u{ba}'), ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{1ba}'), ('\u{1bb}', '\u{1bb}'), ('\u{1bc}', '\u{1bf}'), ('\u{1c0}', '\u{1c3}'), ('\u{1c4}', @@ -2967,7 +2967,7 @@ pub mod derived_property { } pub mod script { - pub static Arabic_table: &'static [(char, char)] = &[ + pub const Arabic_table: &'static [(char, char)] = &[ ('\u{600}', '\u{604}'), ('\u{606}', '\u{608}'), ('\u{609}', '\u{60a}'), ('\u{60b}', '\u{60b}'), ('\u{60d}', '\u{60d}'), ('\u{60e}', '\u{60f}'), ('\u{610}', '\u{61a}'), ('\u{61e}', '\u{61e}'), ('\u{620}', '\u{63f}'), ('\u{641}', '\u{64a}'), ('\u{656}', @@ -2994,17 +2994,17 @@ pub mod script { ('\u{1eef0}', '\u{1eef1}') ]; - pub static Armenian_table: &'static [(char, char)] = &[ + pub const Armenian_table: &'static [(char, char)] = &[ ('\u{531}', '\u{556}'), ('\u{559}', '\u{559}'), ('\u{55a}', '\u{55f}'), ('\u{561}', '\u{587}'), ('\u{58a}', '\u{58a}'), ('\u{58d}', '\u{58e}'), ('\u{58f}', '\u{58f}'), ('\u{fb13}', '\u{fb17}') ]; - pub static Avestan_table: &'static [(char, char)] = &[ + pub const Avestan_table: &'static [(char, char)] = &[ ('\u{10b00}', '\u{10b35}'), ('\u{10b39}', '\u{10b3f}') ]; - pub static Balinese_table: &'static [(char, char)] = &[ + pub const Balinese_table: &'static [(char, char)] = &[ ('\u{1b00}', '\u{1b03}'), ('\u{1b04}', '\u{1b04}'), ('\u{1b05}', '\u{1b33}'), ('\u{1b34}', '\u{1b34}'), ('\u{1b35}', '\u{1b35}'), ('\u{1b36}', '\u{1b3a}'), ('\u{1b3b}', '\u{1b3b}'), ('\u{1b3c}', '\u{1b3c}'), ('\u{1b3d}', '\u{1b41}'), ('\u{1b42}', '\u{1b42}'), ('\u{1b43}', @@ -3012,22 +3012,22 @@ pub mod script { ('\u{1b61}', '\u{1b6a}'), ('\u{1b6b}', '\u{1b73}'), ('\u{1b74}', '\u{1b7c}') ]; - pub static Bamum_table: &'static [(char, char)] = &[ + pub const Bamum_table: &'static [(char, char)] = &[ ('\u{a6a0}', '\u{a6e5}'), ('\u{a6e6}', '\u{a6ef}'), ('\u{a6f0}', '\u{a6f1}'), ('\u{a6f2}', '\u{a6f7}'), ('\u{16800}', '\u{16a38}') ]; - pub static Bassa_Vah_table: &'static [(char, char)] = &[ + pub const Bassa_Vah_table: &'static [(char, char)] = &[ ('\u{16ad0}', '\u{16aed}'), ('\u{16af0}', '\u{16af4}'), ('\u{16af5}', '\u{16af5}') ]; - pub static Batak_table: &'static [(char, char)] = &[ + pub const Batak_table: &'static [(char, char)] = &[ ('\u{1bc0}', '\u{1be5}'), ('\u{1be6}', '\u{1be6}'), ('\u{1be7}', '\u{1be7}'), ('\u{1be8}', '\u{1be9}'), ('\u{1bea}', '\u{1bec}'), ('\u{1bed}', '\u{1bed}'), ('\u{1bee}', '\u{1bee}'), ('\u{1bef}', '\u{1bf1}'), ('\u{1bf2}', '\u{1bf3}'), ('\u{1bfc}', '\u{1bff}') ]; - pub static Bengali_table: &'static [(char, char)] = &[ + pub const Bengali_table: &'static [(char, char)] = &[ ('\u{980}', '\u{980}'), ('\u{981}', '\u{981}'), ('\u{982}', '\u{983}'), ('\u{985}', '\u{98c}'), ('\u{98f}', '\u{990}'), ('\u{993}', '\u{9a8}'), ('\u{9aa}', '\u{9b0}'), ('\u{9b2}', '\u{9b2}'), ('\u{9b6}', '\u{9b9}'), ('\u{9bc}', '\u{9bc}'), ('\u{9bd}', @@ -3038,60 +3038,60 @@ pub mod script { '\u{9f9}'), ('\u{9fa}', '\u{9fa}'), ('\u{9fb}', '\u{9fb}') ]; - pub static Bopomofo_table: &'static [(char, char)] = &[ + pub const Bopomofo_table: &'static [(char, char)] = &[ ('\u{2ea}', '\u{2eb}'), ('\u{3105}', '\u{312d}'), ('\u{31a0}', '\u{31ba}') ]; - pub static Brahmi_table: &'static [(char, char)] = &[ + pub const Brahmi_table: &'static [(char, char)] = &[ ('\u{11000}', '\u{11000}'), ('\u{11001}', '\u{11001}'), ('\u{11002}', '\u{11002}'), ('\u{11003}', '\u{11037}'), ('\u{11038}', '\u{11046}'), ('\u{11047}', '\u{1104d}'), ('\u{11052}', '\u{11065}'), ('\u{11066}', '\u{1106f}'), ('\u{1107f}', '\u{1107f}') ]; - pub static Braille_table: &'static [(char, char)] = &[ + pub const Braille_table: &'static [(char, char)] = &[ ('\u{2800}', '\u{28ff}') ]; - pub static Buginese_table: &'static [(char, char)] = &[ + pub const Buginese_table: &'static [(char, char)] = &[ ('\u{1a00}', '\u{1a16}'), ('\u{1a17}', '\u{1a18}'), ('\u{1a19}', '\u{1a1a}'), ('\u{1a1b}', '\u{1a1b}'), ('\u{1a1e}', '\u{1a1f}') ]; - pub static Buhid_table: &'static [(char, char)] = &[ + pub const Buhid_table: &'static [(char, char)] = &[ ('\u{1740}', '\u{1751}'), ('\u{1752}', '\u{1753}') ]; - pub static Canadian_Aboriginal_table: &'static [(char, char)] = &[ + pub const Canadian_Aboriginal_table: &'static [(char, char)] = &[ ('\u{1400}', '\u{1400}'), ('\u{1401}', '\u{166c}'), ('\u{166d}', '\u{166e}'), ('\u{166f}', '\u{167f}'), ('\u{18b0}', '\u{18f5}') ]; - pub static Carian_table: &'static [(char, char)] = &[ + pub const Carian_table: &'static [(char, char)] = &[ ('\u{102a0}', '\u{102d0}') ]; - pub static Caucasian_Albanian_table: &'static [(char, char)] = &[ + pub const Caucasian_Albanian_table: &'static [(char, char)] = &[ ('\u{10530}', '\u{10563}'), ('\u{1056f}', '\u{1056f}') ]; - pub static Chakma_table: &'static [(char, char)] = &[ + pub const Chakma_table: &'static [(char, char)] = &[ ('\u{11100}', '\u{11102}'), ('\u{11103}', '\u{11126}'), ('\u{11127}', '\u{1112b}'), ('\u{1112c}', '\u{1112c}'), ('\u{1112d}', '\u{11134}'), ('\u{11136}', '\u{1113f}'), ('\u{11140}', '\u{11143}') ]; - pub static Cham_table: &'static [(char, char)] = &[ + pub const Cham_table: &'static [(char, char)] = &[ ('\u{aa00}', '\u{aa28}'), ('\u{aa29}', '\u{aa2e}'), ('\u{aa2f}', '\u{aa30}'), ('\u{aa31}', '\u{aa32}'), ('\u{aa33}', '\u{aa34}'), ('\u{aa35}', '\u{aa36}'), ('\u{aa40}', '\u{aa42}'), ('\u{aa43}', '\u{aa43}'), ('\u{aa44}', '\u{aa4b}'), ('\u{aa4c}', '\u{aa4c}'), ('\u{aa4d}', '\u{aa4d}'), ('\u{aa50}', '\u{aa59}'), ('\u{aa5c}', '\u{aa5f}') ]; - pub static Cherokee_table: &'static [(char, char)] = &[ + pub const Cherokee_table: &'static [(char, char)] = &[ ('\u{13a0}', '\u{13f4}') ]; - pub static Common_table: &'static [(char, char)] = &[ + pub const Common_table: &'static [(char, char)] = &[ ('\u{0}', '\u{1f}'), ('\u{20}', '\u{20}'), ('\u{21}', '\u{23}'), ('\u{24}', '\u{24}'), ('\u{25}', '\u{27}'), ('\u{28}', '\u{28}'), ('\u{29}', '\u{29}'), ('\u{2a}', '\u{2a}'), ('\u{2b}', '\u{2b}'), ('\u{2c}', '\u{2c}'), ('\u{2d}', '\u{2d}'), ('\u{2e}', '\u{2f}'), @@ -3261,22 +3261,22 @@ pub mod script { ('\u{1f890}', '\u{1f8ad}'), ('\u{e0001}', '\u{e0001}'), ('\u{e0020}', '\u{e007f}') ]; - pub static Coptic_table: &'static [(char, char)] = &[ + pub const Coptic_table: &'static [(char, char)] = &[ ('\u{3e2}', '\u{3ef}'), ('\u{2c80}', '\u{2ce4}'), ('\u{2ce5}', '\u{2cea}'), ('\u{2ceb}', '\u{2cee}'), ('\u{2cef}', '\u{2cf1}'), ('\u{2cf2}', '\u{2cf3}'), ('\u{2cf9}', '\u{2cfc}'), ('\u{2cfd}', '\u{2cfd}'), ('\u{2cfe}', '\u{2cff}') ]; - pub static Cuneiform_table: &'static [(char, char)] = &[ + pub const Cuneiform_table: &'static [(char, char)] = &[ ('\u{12000}', '\u{12398}'), ('\u{12400}', '\u{1246e}'), ('\u{12470}', '\u{12474}') ]; - pub static Cypriot_table: &'static [(char, char)] = &[ + pub const Cypriot_table: &'static [(char, char)] = &[ ('\u{10800}', '\u{10805}'), ('\u{10808}', '\u{10808}'), ('\u{1080a}', '\u{10835}'), ('\u{10837}', '\u{10838}'), ('\u{1083c}', '\u{1083c}'), ('\u{1083f}', '\u{1083f}') ]; - pub static Cyrillic_table: &'static [(char, char)] = &[ + pub const Cyrillic_table: &'static [(char, char)] = &[ ('\u{400}', '\u{481}'), ('\u{482}', '\u{482}'), ('\u{483}', '\u{484}'), ('\u{487}', '\u{487}'), ('\u{488}', '\u{489}'), ('\u{48a}', '\u{52f}'), ('\u{1d2b}', '\u{1d2b}'), ('\u{1d78}', '\u{1d78}'), ('\u{2de0}', '\u{2dff}'), ('\u{a640}', '\u{a66d}'), ('\u{a66e}', @@ -3285,11 +3285,11 @@ pub mod script { '\u{a69b}'), ('\u{a69c}', '\u{a69d}'), ('\u{a69f}', '\u{a69f}') ]; - pub static Deseret_table: &'static [(char, char)] = &[ + pub const Deseret_table: &'static [(char, char)] = &[ ('\u{10400}', '\u{1044f}') ]; - pub static Devanagari_table: &'static [(char, char)] = &[ + pub const Devanagari_table: &'static [(char, char)] = &[ ('\u{900}', '\u{902}'), ('\u{903}', '\u{903}'), ('\u{904}', '\u{939}'), ('\u{93a}', '\u{93a}'), ('\u{93b}', '\u{93b}'), ('\u{93c}', '\u{93c}'), ('\u{93d}', '\u{93d}'), ('\u{93e}', '\u{940}'), ('\u{941}', '\u{948}'), ('\u{949}', '\u{94c}'), ('\u{94d}', @@ -3299,21 +3299,21 @@ pub mod script { ('\u{a8f2}', '\u{a8f7}'), ('\u{a8f8}', '\u{a8fa}'), ('\u{a8fb}', '\u{a8fb}') ]; - pub static Duployan_table: &'static [(char, char)] = &[ + pub const Duployan_table: &'static [(char, char)] = &[ ('\u{1bc00}', '\u{1bc6a}'), ('\u{1bc70}', '\u{1bc7c}'), ('\u{1bc80}', '\u{1bc88}'), ('\u{1bc90}', '\u{1bc99}'), ('\u{1bc9c}', '\u{1bc9c}'), ('\u{1bc9d}', '\u{1bc9e}'), ('\u{1bc9f}', '\u{1bc9f}') ]; - pub static Egyptian_Hieroglyphs_table: &'static [(char, char)] = &[ + pub const Egyptian_Hieroglyphs_table: &'static [(char, char)] = &[ ('\u{13000}', '\u{1342e}') ]; - pub static Elbasan_table: &'static [(char, char)] = &[ + pub const Elbasan_table: &'static [(char, char)] = &[ ('\u{10500}', '\u{10527}') ]; - pub static Ethiopic_table: &'static [(char, char)] = &[ + pub const Ethiopic_table: &'static [(char, char)] = &[ ('\u{1200}', '\u{1248}'), ('\u{124a}', '\u{124d}'), ('\u{1250}', '\u{1256}'), ('\u{1258}', '\u{1258}'), ('\u{125a}', '\u{125d}'), ('\u{1260}', '\u{1288}'), ('\u{128a}', '\u{128d}'), ('\u{1290}', '\u{12b0}'), ('\u{12b2}', '\u{12b5}'), ('\u{12b8}', '\u{12be}'), ('\u{12c0}', @@ -3326,22 +3326,22 @@ pub mod script { '\u{ab0e}'), ('\u{ab11}', '\u{ab16}'), ('\u{ab20}', '\u{ab26}'), ('\u{ab28}', '\u{ab2e}') ]; - pub static Georgian_table: &'static [(char, char)] = &[ + pub const Georgian_table: &'static [(char, char)] = &[ ('\u{10a0}', '\u{10c5}'), ('\u{10c7}', '\u{10c7}'), ('\u{10cd}', '\u{10cd}'), ('\u{10d0}', '\u{10fa}'), ('\u{10fc}', '\u{10fc}'), ('\u{10fd}', '\u{10ff}'), ('\u{2d00}', '\u{2d25}'), ('\u{2d27}', '\u{2d27}'), ('\u{2d2d}', '\u{2d2d}') ]; - pub static Glagolitic_table: &'static [(char, char)] = &[ + pub const Glagolitic_table: &'static [(char, char)] = &[ ('\u{2c00}', '\u{2c2e}'), ('\u{2c30}', '\u{2c5e}') ]; - pub static Gothic_table: &'static [(char, char)] = &[ + pub const Gothic_table: &'static [(char, char)] = &[ ('\u{10330}', '\u{10340}'), ('\u{10341}', '\u{10341}'), ('\u{10342}', '\u{10349}'), ('\u{1034a}', '\u{1034a}') ]; - pub static Grantha_table: &'static [(char, char)] = &[ + pub const Grantha_table: &'static [(char, char)] = &[ ('\u{11301}', '\u{11301}'), ('\u{11302}', '\u{11303}'), ('\u{11305}', '\u{1130c}'), ('\u{1130f}', '\u{11310}'), ('\u{11313}', '\u{11328}'), ('\u{1132a}', '\u{11330}'), ('\u{11332}', '\u{11333}'), ('\u{11335}', '\u{11339}'), ('\u{1133c}', '\u{1133c}'), @@ -3351,7 +3351,7 @@ pub mod script { ('\u{11366}', '\u{1136c}'), ('\u{11370}', '\u{11374}') ]; - pub static Greek_table: &'static [(char, char)] = &[ + pub const Greek_table: &'static [(char, char)] = &[ ('\u{370}', '\u{373}'), ('\u{375}', '\u{375}'), ('\u{376}', '\u{377}'), ('\u{37a}', '\u{37a}'), ('\u{37b}', '\u{37d}'), ('\u{37f}', '\u{37f}'), ('\u{384}', '\u{384}'), ('\u{386}', '\u{386}'), ('\u{388}', '\u{38a}'), ('\u{38c}', '\u{38c}'), ('\u{38e}', @@ -3371,7 +3371,7 @@ pub mod script { '\u{1d245}') ]; - pub static Gujarati_table: &'static [(char, char)] = &[ + pub const Gujarati_table: &'static [(char, char)] = &[ ('\u{a81}', '\u{a82}'), ('\u{a83}', '\u{a83}'), ('\u{a85}', '\u{a8d}'), ('\u{a8f}', '\u{a91}'), ('\u{a93}', '\u{aa8}'), ('\u{aaa}', '\u{ab0}'), ('\u{ab2}', '\u{ab3}'), ('\u{ab5}', '\u{ab9}'), ('\u{abc}', '\u{abc}'), ('\u{abd}', '\u{abd}'), ('\u{abe}', @@ -3381,7 +3381,7 @@ pub mod script { ('\u{af1}', '\u{af1}') ]; - pub static Gurmukhi_table: &'static [(char, char)] = &[ + pub const Gurmukhi_table: &'static [(char, char)] = &[ ('\u{a01}', '\u{a02}'), ('\u{a03}', '\u{a03}'), ('\u{a05}', '\u{a0a}'), ('\u{a0f}', '\u{a10}'), ('\u{a13}', '\u{a28}'), ('\u{a2a}', '\u{a30}'), ('\u{a32}', '\u{a33}'), ('\u{a35}', '\u{a36}'), ('\u{a38}', '\u{a39}'), ('\u{a3c}', '\u{a3c}'), ('\u{a3e}', @@ -3390,7 +3390,7 @@ pub mod script { '\u{a6f}'), ('\u{a70}', '\u{a71}'), ('\u{a72}', '\u{a74}'), ('\u{a75}', '\u{a75}') ]; - pub static Han_table: &'static [(char, char)] = &[ + pub const Han_table: &'static [(char, char)] = &[ ('\u{2e80}', '\u{2e99}'), ('\u{2e9b}', '\u{2ef3}'), ('\u{2f00}', '\u{2fd5}'), ('\u{3005}', '\u{3005}'), ('\u{3007}', '\u{3007}'), ('\u{3021}', '\u{3029}'), ('\u{3038}', '\u{303a}'), ('\u{303b}', '\u{303b}'), ('\u{3400}', '\u{4db5}'), ('\u{4e00}', '\u{9fcc}'), ('\u{f900}', @@ -3398,18 +3398,18 @@ pub mod script { '\u{2b734}'), ('\u{2b740}', '\u{2b81d}'), ('\u{2f800}', '\u{2fa1d}') ]; - pub static Hangul_table: &'static [(char, char)] = &[ + pub const Hangul_table: &'static [(char, char)] = &[ ('\u{1100}', '\u{11ff}'), ('\u{302e}', '\u{302f}'), ('\u{3131}', '\u{318e}'), ('\u{3200}', '\u{321e}'), ('\u{3260}', '\u{327e}'), ('\u{a960}', '\u{a97c}'), ('\u{ac00}', '\u{d7a3}'), ('\u{d7b0}', '\u{d7c6}'), ('\u{d7cb}', '\u{d7fb}'), ('\u{ffa0}', '\u{ffbe}'), ('\u{ffc2}', '\u{ffc7}'), ('\u{ffca}', '\u{ffcf}'), ('\u{ffd2}', '\u{ffd7}'), ('\u{ffda}', '\u{ffdc}') ]; - pub static Hanunoo_table: &'static [(char, char)] = &[ + pub const Hanunoo_table: &'static [(char, char)] = &[ ('\u{1720}', '\u{1731}'), ('\u{1732}', '\u{1734}') ]; - pub static Hebrew_table: &'static [(char, char)] = &[ + pub const Hebrew_table: &'static [(char, char)] = &[ ('\u{591}', '\u{5bd}'), ('\u{5be}', '\u{5be}'), ('\u{5bf}', '\u{5bf}'), ('\u{5c0}', '\u{5c0}'), ('\u{5c1}', '\u{5c2}'), ('\u{5c3}', '\u{5c3}'), ('\u{5c4}', '\u{5c5}'), ('\u{5c6}', '\u{5c6}'), ('\u{5c7}', '\u{5c7}'), ('\u{5d0}', '\u{5ea}'), ('\u{5f0}', @@ -3419,16 +3419,16 @@ pub mod script { ('\u{fb46}', '\u{fb4f}') ]; - pub static Hiragana_table: &'static [(char, char)] = &[ + pub const Hiragana_table: &'static [(char, char)] = &[ ('\u{3041}', '\u{3096}'), ('\u{309d}', '\u{309e}'), ('\u{309f}', '\u{309f}'), ('\u{1b001}', '\u{1b001}'), ('\u{1f200}', '\u{1f200}') ]; - pub static Imperial_Aramaic_table: &'static [(char, char)] = &[ + pub const Imperial_Aramaic_table: &'static [(char, char)] = &[ ('\u{10840}', '\u{10855}'), ('\u{10857}', '\u{10857}'), ('\u{10858}', '\u{1085f}') ]; - pub static Inherited_table: &'static [(char, char)] = &[ + pub const Inherited_table: &'static [(char, char)] = &[ ('\u{300}', '\u{36f}'), ('\u{485}', '\u{486}'), ('\u{64b}', '\u{655}'), ('\u{670}', '\u{670}'), ('\u{951}', '\u{952}'), ('\u{1ab0}', '\u{1abd}'), ('\u{1abe}', '\u{1abe}'), ('\u{1cd0}', '\u{1cd2}'), ('\u{1cd4}', '\u{1ce0}'), ('\u{1ce2}', '\u{1ce8}'), ('\u{1ced}', @@ -3441,29 +3441,29 @@ pub mod script { '\u{1d1ad}'), ('\u{e0100}', '\u{e01ef}') ]; - pub static Inscriptional_Pahlavi_table: &'static [(char, char)] = &[ + pub const Inscriptional_Pahlavi_table: &'static [(char, char)] = &[ ('\u{10b60}', '\u{10b72}'), ('\u{10b78}', '\u{10b7f}') ]; - pub static Inscriptional_Parthian_table: &'static [(char, char)] = &[ + pub const Inscriptional_Parthian_table: &'static [(char, char)] = &[ ('\u{10b40}', '\u{10b55}'), ('\u{10b58}', '\u{10b5f}') ]; - pub static Javanese_table: &'static [(char, char)] = &[ + pub const Javanese_table: &'static [(char, char)] = &[ ('\u{a980}', '\u{a982}'), ('\u{a983}', '\u{a983}'), ('\u{a984}', '\u{a9b2}'), ('\u{a9b3}', '\u{a9b3}'), ('\u{a9b4}', '\u{a9b5}'), ('\u{a9b6}', '\u{a9b9}'), ('\u{a9ba}', '\u{a9bb}'), ('\u{a9bc}', '\u{a9bc}'), ('\u{a9bd}', '\u{a9c0}'), ('\u{a9c1}', '\u{a9cd}'), ('\u{a9d0}', '\u{a9d9}'), ('\u{a9de}', '\u{a9df}') ]; - pub static Kaithi_table: &'static [(char, char)] = &[ + pub const Kaithi_table: &'static [(char, char)] = &[ ('\u{11080}', '\u{11081}'), ('\u{11082}', '\u{11082}'), ('\u{11083}', '\u{110af}'), ('\u{110b0}', '\u{110b2}'), ('\u{110b3}', '\u{110b6}'), ('\u{110b7}', '\u{110b8}'), ('\u{110b9}', '\u{110ba}'), ('\u{110bb}', '\u{110bc}'), ('\u{110bd}', '\u{110bd}'), ('\u{110be}', '\u{110c1}') ]; - pub static Kannada_table: &'static [(char, char)] = &[ + pub const Kannada_table: &'static [(char, char)] = &[ ('\u{c81}', '\u{c81}'), ('\u{c82}', '\u{c83}'), ('\u{c85}', '\u{c8c}'), ('\u{c8e}', '\u{c90}'), ('\u{c92}', '\u{ca8}'), ('\u{caa}', '\u{cb3}'), ('\u{cb5}', '\u{cb9}'), ('\u{cbc}', '\u{cbc}'), ('\u{cbd}', '\u{cbd}'), ('\u{cbe}', '\u{cbe}'), ('\u{cbf}', @@ -3473,25 +3473,25 @@ pub mod script { ('\u{cf1}', '\u{cf2}') ]; - pub static Katakana_table: &'static [(char, char)] = &[ + pub const Katakana_table: &'static [(char, char)] = &[ ('\u{30a1}', '\u{30fa}'), ('\u{30fd}', '\u{30fe}'), ('\u{30ff}', '\u{30ff}'), ('\u{31f0}', '\u{31ff}'), ('\u{32d0}', '\u{32fe}'), ('\u{3300}', '\u{3357}'), ('\u{ff66}', '\u{ff6f}'), ('\u{ff71}', '\u{ff9d}'), ('\u{1b000}', '\u{1b000}') ]; - pub static Kayah_Li_table: &'static [(char, char)] = &[ + pub const Kayah_Li_table: &'static [(char, char)] = &[ ('\u{a900}', '\u{a909}'), ('\u{a90a}', '\u{a925}'), ('\u{a926}', '\u{a92d}'), ('\u{a92f}', '\u{a92f}') ]; - pub static Kharoshthi_table: &'static [(char, char)] = &[ + pub const Kharoshthi_table: &'static [(char, char)] = &[ ('\u{10a00}', '\u{10a00}'), ('\u{10a01}', '\u{10a03}'), ('\u{10a05}', '\u{10a06}'), ('\u{10a0c}', '\u{10a0f}'), ('\u{10a10}', '\u{10a13}'), ('\u{10a15}', '\u{10a17}'), ('\u{10a19}', '\u{10a33}'), ('\u{10a38}', '\u{10a3a}'), ('\u{10a3f}', '\u{10a3f}'), ('\u{10a40}', '\u{10a47}'), ('\u{10a50}', '\u{10a58}') ]; - pub static Khmer_table: &'static [(char, char)] = &[ + pub const Khmer_table: &'static [(char, char)] = &[ ('\u{1780}', '\u{17b3}'), ('\u{17b4}', '\u{17b5}'), ('\u{17b6}', '\u{17b6}'), ('\u{17b7}', '\u{17bd}'), ('\u{17be}', '\u{17c5}'), ('\u{17c6}', '\u{17c6}'), ('\u{17c7}', '\u{17c8}'), ('\u{17c9}', '\u{17d3}'), ('\u{17d4}', '\u{17d6}'), ('\u{17d7}', '\u{17d7}'), ('\u{17d8}', @@ -3499,18 +3499,18 @@ pub mod script { ('\u{17e0}', '\u{17e9}'), ('\u{17f0}', '\u{17f9}'), ('\u{19e0}', '\u{19ff}') ]; - pub static Khojki_table: &'static [(char, char)] = &[ + pub const Khojki_table: &'static [(char, char)] = &[ ('\u{11200}', '\u{11211}'), ('\u{11213}', '\u{1122b}'), ('\u{1122c}', '\u{1122e}'), ('\u{1122f}', '\u{11231}'), ('\u{11232}', '\u{11233}'), ('\u{11234}', '\u{11234}'), ('\u{11235}', '\u{11235}'), ('\u{11236}', '\u{11237}'), ('\u{11238}', '\u{1123d}') ]; - pub static Khudawadi_table: &'static [(char, char)] = &[ + pub const Khudawadi_table: &'static [(char, char)] = &[ ('\u{112b0}', '\u{112de}'), ('\u{112df}', '\u{112df}'), ('\u{112e0}', '\u{112e2}'), ('\u{112e3}', '\u{112ea}'), ('\u{112f0}', '\u{112f9}') ]; - pub static Lao_table: &'static [(char, char)] = &[ + pub const Lao_table: &'static [(char, char)] = &[ ('\u{e81}', '\u{e82}'), ('\u{e84}', '\u{e84}'), ('\u{e87}', '\u{e88}'), ('\u{e8a}', '\u{e8a}'), ('\u{e8d}', '\u{e8d}'), ('\u{e94}', '\u{e97}'), ('\u{e99}', '\u{e9f}'), ('\u{ea1}', '\u{ea3}'), ('\u{ea5}', '\u{ea5}'), ('\u{ea7}', '\u{ea7}'), ('\u{eaa}', @@ -3520,7 +3520,7 @@ pub mod script { ('\u{edc}', '\u{edf}') ]; - pub static Latin_table: &'static [(char, char)] = &[ + pub const Latin_table: &'static [(char, char)] = &[ ('\u{41}', '\u{5a}'), ('\u{61}', '\u{7a}'), ('\u{aa}', '\u{aa}'), ('\u{ba}', '\u{ba}'), ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{1ba}'), ('\u{1bb}', '\u{1bb}'), ('\u{1bc}', '\u{1bf}'), ('\u{1c0}', '\u{1c3}'), ('\u{1c4}', '\u{293}'), ('\u{294}', @@ -3537,47 +3537,47 @@ pub mod script { '\u{ab64}'), ('\u{fb00}', '\u{fb06}'), ('\u{ff21}', '\u{ff3a}'), ('\u{ff41}', '\u{ff5a}') ]; - pub static Lepcha_table: &'static [(char, char)] = &[ + pub const Lepcha_table: &'static [(char, char)] = &[ ('\u{1c00}', '\u{1c23}'), ('\u{1c24}', '\u{1c2b}'), ('\u{1c2c}', '\u{1c33}'), ('\u{1c34}', '\u{1c35}'), ('\u{1c36}', '\u{1c37}'), ('\u{1c3b}', '\u{1c3f}'), ('\u{1c40}', '\u{1c49}'), ('\u{1c4d}', '\u{1c4f}') ]; - pub static Limbu_table: &'static [(char, char)] = &[ + pub const Limbu_table: &'static [(char, char)] = &[ ('\u{1900}', '\u{191e}'), ('\u{1920}', '\u{1922}'), ('\u{1923}', '\u{1926}'), ('\u{1927}', '\u{1928}'), ('\u{1929}', '\u{192b}'), ('\u{1930}', '\u{1931}'), ('\u{1932}', '\u{1932}'), ('\u{1933}', '\u{1938}'), ('\u{1939}', '\u{193b}'), ('\u{1940}', '\u{1940}'), ('\u{1944}', '\u{1945}'), ('\u{1946}', '\u{194f}') ]; - pub static Linear_A_table: &'static [(char, char)] = &[ + pub const Linear_A_table: &'static [(char, char)] = &[ ('\u{10600}', '\u{10736}'), ('\u{10740}', '\u{10755}'), ('\u{10760}', '\u{10767}') ]; - pub static Linear_B_table: &'static [(char, char)] = &[ + pub const Linear_B_table: &'static [(char, char)] = &[ ('\u{10000}', '\u{1000b}'), ('\u{1000d}', '\u{10026}'), ('\u{10028}', '\u{1003a}'), ('\u{1003c}', '\u{1003d}'), ('\u{1003f}', '\u{1004d}'), ('\u{10050}', '\u{1005d}'), ('\u{10080}', '\u{100fa}') ]; - pub static Lisu_table: &'static [(char, char)] = &[ + pub const Lisu_table: &'static [(char, char)] = &[ ('\u{a4d0}', '\u{a4f7}'), ('\u{a4f8}', '\u{a4fd}'), ('\u{a4fe}', '\u{a4ff}') ]; - pub static Lycian_table: &'static [(char, char)] = &[ + pub const Lycian_table: &'static [(char, char)] = &[ ('\u{10280}', '\u{1029c}') ]; - pub static Lydian_table: &'static [(char, char)] = &[ + pub const Lydian_table: &'static [(char, char)] = &[ ('\u{10920}', '\u{10939}'), ('\u{1093f}', '\u{1093f}') ]; - pub static Mahajani_table: &'static [(char, char)] = &[ + pub const Mahajani_table: &'static [(char, char)] = &[ ('\u{11150}', '\u{11172}'), ('\u{11173}', '\u{11173}'), ('\u{11174}', '\u{11175}'), ('\u{11176}', '\u{11176}') ]; - pub static Malayalam_table: &'static [(char, char)] = &[ + pub const Malayalam_table: &'static [(char, char)] = &[ ('\u{d01}', '\u{d01}'), ('\u{d02}', '\u{d03}'), ('\u{d05}', '\u{d0c}'), ('\u{d0e}', '\u{d10}'), ('\u{d12}', '\u{d3a}'), ('\u{d3d}', '\u{d3d}'), ('\u{d3e}', '\u{d40}'), ('\u{d41}', '\u{d44}'), ('\u{d46}', '\u{d48}'), ('\u{d4a}', '\u{d4c}'), ('\u{d4d}', @@ -3586,16 +3586,16 @@ pub mod script { '\u{d79}'), ('\u{d7a}', '\u{d7f}') ]; - pub static Mandaic_table: &'static [(char, char)] = &[ + pub const Mandaic_table: &'static [(char, char)] = &[ ('\u{840}', '\u{858}'), ('\u{859}', '\u{85b}'), ('\u{85e}', '\u{85e}') ]; - pub static Manichaean_table: &'static [(char, char)] = &[ + pub const Manichaean_table: &'static [(char, char)] = &[ ('\u{10ac0}', '\u{10ac7}'), ('\u{10ac8}', '\u{10ac8}'), ('\u{10ac9}', '\u{10ae4}'), ('\u{10ae5}', '\u{10ae6}'), ('\u{10aeb}', '\u{10aef}'), ('\u{10af0}', '\u{10af6}') ]; - pub static Meetei_Mayek_table: &'static [(char, char)] = &[ + pub const Meetei_Mayek_table: &'static [(char, char)] = &[ ('\u{aae0}', '\u{aaea}'), ('\u{aaeb}', '\u{aaeb}'), ('\u{aaec}', '\u{aaed}'), ('\u{aaee}', '\u{aaef}'), ('\u{aaf0}', '\u{aaf1}'), ('\u{aaf2}', '\u{aaf2}'), ('\u{aaf3}', '\u{aaf4}'), ('\u{aaf5}', '\u{aaf5}'), ('\u{aaf6}', '\u{aaf6}'), ('\u{abc0}', '\u{abe2}'), ('\u{abe3}', @@ -3604,42 +3604,42 @@ pub mod script { '\u{abed}'), ('\u{abf0}', '\u{abf9}') ]; - pub static Mende_Kikakui_table: &'static [(char, char)] = &[ + pub const Mende_Kikakui_table: &'static [(char, char)] = &[ ('\u{1e800}', '\u{1e8c4}'), ('\u{1e8c7}', '\u{1e8cf}'), ('\u{1e8d0}', '\u{1e8d6}') ]; - pub static Meroitic_Cursive_table: &'static [(char, char)] = &[ + pub const Meroitic_Cursive_table: &'static [(char, char)] = &[ ('\u{109a0}', '\u{109b7}'), ('\u{109be}', '\u{109bf}') ]; - pub static Meroitic_Hieroglyphs_table: &'static [(char, char)] = &[ + pub const Meroitic_Hieroglyphs_table: &'static [(char, char)] = &[ ('\u{10980}', '\u{1099f}') ]; - pub static Miao_table: &'static [(char, char)] = &[ + pub const Miao_table: &'static [(char, char)] = &[ ('\u{16f00}', '\u{16f44}'), ('\u{16f50}', '\u{16f50}'), ('\u{16f51}', '\u{16f7e}'), ('\u{16f8f}', '\u{16f92}'), ('\u{16f93}', '\u{16f9f}') ]; - pub static Modi_table: &'static [(char, char)] = &[ + pub const Modi_table: &'static [(char, char)] = &[ ('\u{11600}', '\u{1162f}'), ('\u{11630}', '\u{11632}'), ('\u{11633}', '\u{1163a}'), ('\u{1163b}', '\u{1163c}'), ('\u{1163d}', '\u{1163d}'), ('\u{1163e}', '\u{1163e}'), ('\u{1163f}', '\u{11640}'), ('\u{11641}', '\u{11643}'), ('\u{11644}', '\u{11644}'), ('\u{11650}', '\u{11659}') ]; - pub static Mongolian_table: &'static [(char, char)] = &[ + pub const Mongolian_table: &'static [(char, char)] = &[ ('\u{1800}', '\u{1801}'), ('\u{1804}', '\u{1804}'), ('\u{1806}', '\u{1806}'), ('\u{1807}', '\u{180a}'), ('\u{180b}', '\u{180d}'), ('\u{180e}', '\u{180e}'), ('\u{1810}', '\u{1819}'), ('\u{1820}', '\u{1842}'), ('\u{1843}', '\u{1843}'), ('\u{1844}', '\u{1877}'), ('\u{1880}', '\u{18a8}'), ('\u{18a9}', '\u{18a9}'), ('\u{18aa}', '\u{18aa}') ]; - pub static Mro_table: &'static [(char, char)] = &[ + pub const Mro_table: &'static [(char, char)] = &[ ('\u{16a40}', '\u{16a5e}'), ('\u{16a60}', '\u{16a69}'), ('\u{16a6e}', '\u{16a6f}') ]; - pub static Myanmar_table: &'static [(char, char)] = &[ + pub const Myanmar_table: &'static [(char, char)] = &[ ('\u{1000}', '\u{102a}'), ('\u{102b}', '\u{102c}'), ('\u{102d}', '\u{1030}'), ('\u{1031}', '\u{1031}'), ('\u{1032}', '\u{1037}'), ('\u{1038}', '\u{1038}'), ('\u{1039}', '\u{103a}'), ('\u{103b}', '\u{103c}'), ('\u{103d}', '\u{103e}'), ('\u{103f}', '\u{103f}'), ('\u{1040}', @@ -3657,56 +3657,56 @@ pub mod script { ('\u{aa7e}', '\u{aa7f}') ]; - pub static Nabataean_table: &'static [(char, char)] = &[ + pub const Nabataean_table: &'static [(char, char)] = &[ ('\u{10880}', '\u{1089e}'), ('\u{108a7}', '\u{108af}') ]; - pub static New_Tai_Lue_table: &'static [(char, char)] = &[ + pub const New_Tai_Lue_table: &'static [(char, char)] = &[ ('\u{1980}', '\u{19ab}'), ('\u{19b0}', '\u{19c0}'), ('\u{19c1}', '\u{19c7}'), ('\u{19c8}', '\u{19c9}'), ('\u{19d0}', '\u{19d9}'), ('\u{19da}', '\u{19da}'), ('\u{19de}', '\u{19df}') ]; - pub static Nko_table: &'static [(char, char)] = &[ + pub const Nko_table: &'static [(char, char)] = &[ ('\u{7c0}', '\u{7c9}'), ('\u{7ca}', '\u{7ea}'), ('\u{7eb}', '\u{7f3}'), ('\u{7f4}', '\u{7f5}'), ('\u{7f6}', '\u{7f6}'), ('\u{7f7}', '\u{7f9}'), ('\u{7fa}', '\u{7fa}') ]; - pub static Ogham_table: &'static [(char, char)] = &[ + pub const Ogham_table: &'static [(char, char)] = &[ ('\u{1680}', '\u{1680}'), ('\u{1681}', '\u{169a}'), ('\u{169b}', '\u{169b}'), ('\u{169c}', '\u{169c}') ]; - pub static Ol_Chiki_table: &'static [(char, char)] = &[ + pub const Ol_Chiki_table: &'static [(char, char)] = &[ ('\u{1c50}', '\u{1c59}'), ('\u{1c5a}', '\u{1c77}'), ('\u{1c78}', '\u{1c7d}'), ('\u{1c7e}', '\u{1c7f}') ]; - pub static Old_Italic_table: &'static [(char, char)] = &[ + pub const Old_Italic_table: &'static [(char, char)] = &[ ('\u{10300}', '\u{1031f}'), ('\u{10320}', '\u{10323}') ]; - pub static Old_North_Arabian_table: &'static [(char, char)] = &[ + pub const Old_North_Arabian_table: &'static [(char, char)] = &[ ('\u{10a80}', '\u{10a9c}'), ('\u{10a9d}', '\u{10a9f}') ]; - pub static Old_Permic_table: &'static [(char, char)] = &[ + pub const Old_Permic_table: &'static [(char, char)] = &[ ('\u{10350}', '\u{10375}'), ('\u{10376}', '\u{1037a}') ]; - pub static Old_Persian_table: &'static [(char, char)] = &[ + pub const Old_Persian_table: &'static [(char, char)] = &[ ('\u{103a0}', '\u{103c3}'), ('\u{103c8}', '\u{103cf}'), ('\u{103d0}', '\u{103d0}'), ('\u{103d1}', '\u{103d5}') ]; - pub static Old_South_Arabian_table: &'static [(char, char)] = &[ + pub const Old_South_Arabian_table: &'static [(char, char)] = &[ ('\u{10a60}', '\u{10a7c}'), ('\u{10a7d}', '\u{10a7e}'), ('\u{10a7f}', '\u{10a7f}') ]; - pub static Old_Turkic_table: &'static [(char, char)] = &[ + pub const Old_Turkic_table: &'static [(char, char)] = &[ ('\u{10c00}', '\u{10c48}') ]; - pub static Oriya_table: &'static [(char, char)] = &[ + pub const Oriya_table: &'static [(char, char)] = &[ ('\u{b01}', '\u{b01}'), ('\u{b02}', '\u{b03}'), ('\u{b05}', '\u{b0c}'), ('\u{b0f}', '\u{b10}'), ('\u{b13}', '\u{b28}'), ('\u{b2a}', '\u{b30}'), ('\u{b32}', '\u{b33}'), ('\u{b35}', '\u{b39}'), ('\u{b3c}', '\u{b3c}'), ('\u{b3d}', '\u{b3d}'), ('\u{b3e}', @@ -3717,75 +3717,75 @@ pub mod script { '\u{b71}'), ('\u{b72}', '\u{b77}') ]; - pub static Osmanya_table: &'static [(char, char)] = &[ + pub const Osmanya_table: &'static [(char, char)] = &[ ('\u{10480}', '\u{1049d}'), ('\u{104a0}', '\u{104a9}') ]; - pub static Pahawh_Hmong_table: &'static [(char, char)] = &[ + pub const Pahawh_Hmong_table: &'static [(char, char)] = &[ ('\u{16b00}', '\u{16b2f}'), ('\u{16b30}', '\u{16b36}'), ('\u{16b37}', '\u{16b3b}'), ('\u{16b3c}', '\u{16b3f}'), ('\u{16b40}', '\u{16b43}'), ('\u{16b44}', '\u{16b44}'), ('\u{16b45}', '\u{16b45}'), ('\u{16b50}', '\u{16b59}'), ('\u{16b5b}', '\u{16b61}'), ('\u{16b63}', '\u{16b77}'), ('\u{16b7d}', '\u{16b8f}') ]; - pub static Palmyrene_table: &'static [(char, char)] = &[ + pub const Palmyrene_table: &'static [(char, char)] = &[ ('\u{10860}', '\u{10876}'), ('\u{10877}', '\u{10878}'), ('\u{10879}', '\u{1087f}') ]; - pub static Pau_Cin_Hau_table: &'static [(char, char)] = &[ + pub const Pau_Cin_Hau_table: &'static [(char, char)] = &[ ('\u{11ac0}', '\u{11af8}') ]; - pub static Phags_Pa_table: &'static [(char, char)] = &[ + pub const Phags_Pa_table: &'static [(char, char)] = &[ ('\u{a840}', '\u{a873}'), ('\u{a874}', '\u{a877}') ]; - pub static Phoenician_table: &'static [(char, char)] = &[ + pub const Phoenician_table: &'static [(char, char)] = &[ ('\u{10900}', '\u{10915}'), ('\u{10916}', '\u{1091b}'), ('\u{1091f}', '\u{1091f}') ]; - pub static Psalter_Pahlavi_table: &'static [(char, char)] = &[ + pub const Psalter_Pahlavi_table: &'static [(char, char)] = &[ ('\u{10b80}', '\u{10b91}'), ('\u{10b99}', '\u{10b9c}'), ('\u{10ba9}', '\u{10baf}') ]; - pub static Rejang_table: &'static [(char, char)] = &[ + pub const Rejang_table: &'static [(char, char)] = &[ ('\u{a930}', '\u{a946}'), ('\u{a947}', '\u{a951}'), ('\u{a952}', '\u{a953}'), ('\u{a95f}', '\u{a95f}') ]; - pub static Runic_table: &'static [(char, char)] = &[ + pub const Runic_table: &'static [(char, char)] = &[ ('\u{16a0}', '\u{16ea}'), ('\u{16ee}', '\u{16f0}'), ('\u{16f1}', '\u{16f8}') ]; - pub static Samaritan_table: &'static [(char, char)] = &[ + pub const Samaritan_table: &'static [(char, char)] = &[ ('\u{800}', '\u{815}'), ('\u{816}', '\u{819}'), ('\u{81a}', '\u{81a}'), ('\u{81b}', '\u{823}'), ('\u{824}', '\u{824}'), ('\u{825}', '\u{827}'), ('\u{828}', '\u{828}'), ('\u{829}', '\u{82d}'), ('\u{830}', '\u{83e}') ]; - pub static Saurashtra_table: &'static [(char, char)] = &[ + pub const Saurashtra_table: &'static [(char, char)] = &[ ('\u{a880}', '\u{a881}'), ('\u{a882}', '\u{a8b3}'), ('\u{a8b4}', '\u{a8c3}'), ('\u{a8c4}', '\u{a8c4}'), ('\u{a8ce}', '\u{a8cf}'), ('\u{a8d0}', '\u{a8d9}') ]; - pub static Sharada_table: &'static [(char, char)] = &[ + pub const Sharada_table: &'static [(char, char)] = &[ ('\u{11180}', '\u{11181}'), ('\u{11182}', '\u{11182}'), ('\u{11183}', '\u{111b2}'), ('\u{111b3}', '\u{111b5}'), ('\u{111b6}', '\u{111be}'), ('\u{111bf}', '\u{111c0}'), ('\u{111c1}', '\u{111c4}'), ('\u{111c5}', '\u{111c8}'), ('\u{111cd}', '\u{111cd}'), ('\u{111d0}', '\u{111d9}'), ('\u{111da}', '\u{111da}') ]; - pub static Shavian_table: &'static [(char, char)] = &[ + pub const Shavian_table: &'static [(char, char)] = &[ ('\u{10450}', '\u{1047f}') ]; - pub static Siddham_table: &'static [(char, char)] = &[ + pub const Siddham_table: &'static [(char, char)] = &[ ('\u{11580}', '\u{115ae}'), ('\u{115af}', '\u{115b1}'), ('\u{115b2}', '\u{115b5}'), ('\u{115b8}', '\u{115bb}'), ('\u{115bc}', '\u{115bd}'), ('\u{115be}', '\u{115be}'), ('\u{115bf}', '\u{115c0}'), ('\u{115c1}', '\u{115c9}') ]; - pub static Sinhala_table: &'static [(char, char)] = &[ + pub const Sinhala_table: &'static [(char, char)] = &[ ('\u{d82}', '\u{d83}'), ('\u{d85}', '\u{d96}'), ('\u{d9a}', '\u{db1}'), ('\u{db3}', '\u{dbb}'), ('\u{dbd}', '\u{dbd}'), ('\u{dc0}', '\u{dc6}'), ('\u{dca}', '\u{dca}'), ('\u{dcf}', '\u{dd1}'), ('\u{dd2}', '\u{dd4}'), ('\u{dd6}', '\u{dd6}'), ('\u{dd8}', @@ -3793,42 +3793,42 @@ pub mod script { ('\u{111e1}', '\u{111f4}') ]; - pub static Sora_Sompeng_table: &'static [(char, char)] = &[ + pub const Sora_Sompeng_table: &'static [(char, char)] = &[ ('\u{110d0}', '\u{110e8}'), ('\u{110f0}', '\u{110f9}') ]; - pub static Sundanese_table: &'static [(char, char)] = &[ + pub const Sundanese_table: &'static [(char, char)] = &[ ('\u{1b80}', '\u{1b81}'), ('\u{1b82}', '\u{1b82}'), ('\u{1b83}', '\u{1ba0}'), ('\u{1ba1}', '\u{1ba1}'), ('\u{1ba2}', '\u{1ba5}'), ('\u{1ba6}', '\u{1ba7}'), ('\u{1ba8}', '\u{1ba9}'), ('\u{1baa}', '\u{1baa}'), ('\u{1bab}', '\u{1bad}'), ('\u{1bae}', '\u{1baf}'), ('\u{1bb0}', '\u{1bb9}'), ('\u{1bba}', '\u{1bbf}'), ('\u{1cc0}', '\u{1cc7}') ]; - pub static Syloti_Nagri_table: &'static [(char, char)] = &[ + pub const Syloti_Nagri_table: &'static [(char, char)] = &[ ('\u{a800}', '\u{a801}'), ('\u{a802}', '\u{a802}'), ('\u{a803}', '\u{a805}'), ('\u{a806}', '\u{a806}'), ('\u{a807}', '\u{a80a}'), ('\u{a80b}', '\u{a80b}'), ('\u{a80c}', '\u{a822}'), ('\u{a823}', '\u{a824}'), ('\u{a825}', '\u{a826}'), ('\u{a827}', '\u{a827}'), ('\u{a828}', '\u{a82b}') ]; - pub static Syriac_table: &'static [(char, char)] = &[ + pub const Syriac_table: &'static [(char, char)] = &[ ('\u{700}', '\u{70d}'), ('\u{70f}', '\u{70f}'), ('\u{710}', '\u{710}'), ('\u{711}', '\u{711}'), ('\u{712}', '\u{72f}'), ('\u{730}', '\u{74a}'), ('\u{74d}', '\u{74f}') ]; - pub static Tagalog_table: &'static [(char, char)] = &[ + pub const Tagalog_table: &'static [(char, char)] = &[ ('\u{1700}', '\u{170c}'), ('\u{170e}', '\u{1711}'), ('\u{1712}', '\u{1714}') ]; - pub static Tagbanwa_table: &'static [(char, char)] = &[ + pub const Tagbanwa_table: &'static [(char, char)] = &[ ('\u{1760}', '\u{176c}'), ('\u{176e}', '\u{1770}'), ('\u{1772}', '\u{1773}') ]; - pub static Tai_Le_table: &'static [(char, char)] = &[ + pub const Tai_Le_table: &'static [(char, char)] = &[ ('\u{1950}', '\u{196d}'), ('\u{1970}', '\u{1974}') ]; - pub static Tai_Tham_table: &'static [(char, char)] = &[ + pub const Tai_Tham_table: &'static [(char, char)] = &[ ('\u{1a20}', '\u{1a54}'), ('\u{1a55}', '\u{1a55}'), ('\u{1a56}', '\u{1a56}'), ('\u{1a57}', '\u{1a57}'), ('\u{1a58}', '\u{1a5e}'), ('\u{1a60}', '\u{1a60}'), ('\u{1a61}', '\u{1a61}'), ('\u{1a62}', '\u{1a62}'), ('\u{1a63}', '\u{1a64}'), ('\u{1a65}', '\u{1a6c}'), ('\u{1a6d}', @@ -3837,20 +3837,20 @@ pub mod script { '\u{1aad}') ]; - pub static Tai_Viet_table: &'static [(char, char)] = &[ + pub const Tai_Viet_table: &'static [(char, char)] = &[ ('\u{aa80}', '\u{aaaf}'), ('\u{aab0}', '\u{aab0}'), ('\u{aab1}', '\u{aab1}'), ('\u{aab2}', '\u{aab4}'), ('\u{aab5}', '\u{aab6}'), ('\u{aab7}', '\u{aab8}'), ('\u{aab9}', '\u{aabd}'), ('\u{aabe}', '\u{aabf}'), ('\u{aac0}', '\u{aac0}'), ('\u{aac1}', '\u{aac1}'), ('\u{aac2}', '\u{aac2}'), ('\u{aadb}', '\u{aadc}'), ('\u{aadd}', '\u{aadd}'), ('\u{aade}', '\u{aadf}') ]; - pub static Takri_table: &'static [(char, char)] = &[ + pub const Takri_table: &'static [(char, char)] = &[ ('\u{11680}', '\u{116aa}'), ('\u{116ab}', '\u{116ab}'), ('\u{116ac}', '\u{116ac}'), ('\u{116ad}', '\u{116ad}'), ('\u{116ae}', '\u{116af}'), ('\u{116b0}', '\u{116b5}'), ('\u{116b6}', '\u{116b6}'), ('\u{116b7}', '\u{116b7}'), ('\u{116c0}', '\u{116c9}') ]; - pub static Tamil_table: &'static [(char, char)] = &[ + pub const Tamil_table: &'static [(char, char)] = &[ ('\u{b82}', '\u{b82}'), ('\u{b83}', '\u{b83}'), ('\u{b85}', '\u{b8a}'), ('\u{b8e}', '\u{b90}'), ('\u{b92}', '\u{b95}'), ('\u{b99}', '\u{b9a}'), ('\u{b9c}', '\u{b9c}'), ('\u{b9e}', '\u{b9f}'), ('\u{ba3}', '\u{ba4}'), ('\u{ba8}', '\u{baa}'), ('\u{bae}', @@ -3860,7 +3860,7 @@ pub mod script { ('\u{bf3}', '\u{bf8}'), ('\u{bf9}', '\u{bf9}'), ('\u{bfa}', '\u{bfa}') ]; - pub static Telugu_table: &'static [(char, char)] = &[ + pub const Telugu_table: &'static [(char, char)] = &[ ('\u{c00}', '\u{c00}'), ('\u{c01}', '\u{c03}'), ('\u{c05}', '\u{c0c}'), ('\u{c0e}', '\u{c10}'), ('\u{c12}', '\u{c28}'), ('\u{c2a}', '\u{c39}'), ('\u{c3d}', '\u{c3d}'), ('\u{c3e}', '\u{c40}'), ('\u{c41}', '\u{c44}'), ('\u{c46}', '\u{c48}'), ('\u{c4a}', @@ -3869,17 +3869,17 @@ pub mod script { '\u{c7f}') ]; - pub static Thaana_table: &'static [(char, char)] = &[ + pub const Thaana_table: &'static [(char, char)] = &[ ('\u{780}', '\u{7a5}'), ('\u{7a6}', '\u{7b0}'), ('\u{7b1}', '\u{7b1}') ]; - pub static Thai_table: &'static [(char, char)] = &[ + pub const Thai_table: &'static [(char, char)] = &[ ('\u{e01}', '\u{e30}'), ('\u{e31}', '\u{e31}'), ('\u{e32}', '\u{e33}'), ('\u{e34}', '\u{e3a}'), ('\u{e40}', '\u{e45}'), ('\u{e46}', '\u{e46}'), ('\u{e47}', '\u{e4e}'), ('\u{e4f}', '\u{e4f}'), ('\u{e50}', '\u{e59}'), ('\u{e5a}', '\u{e5b}') ]; - pub static Tibetan_table: &'static [(char, char)] = &[ + pub const Tibetan_table: &'static [(char, char)] = &[ ('\u{f00}', '\u{f00}'), ('\u{f01}', '\u{f03}'), ('\u{f04}', '\u{f12}'), ('\u{f13}', '\u{f13}'), ('\u{f14}', '\u{f14}'), ('\u{f15}', '\u{f17}'), ('\u{f18}', '\u{f19}'), ('\u{f1a}', '\u{f1f}'), ('\u{f20}', '\u{f29}'), ('\u{f2a}', '\u{f33}'), ('\u{f34}', @@ -3893,12 +3893,12 @@ pub mod script { ('\u{fd0}', '\u{fd4}'), ('\u{fd9}', '\u{fda}') ]; - pub static Tifinagh_table: &'static [(char, char)] = &[ + pub const Tifinagh_table: &'static [(char, char)] = &[ ('\u{2d30}', '\u{2d67}'), ('\u{2d6f}', '\u{2d6f}'), ('\u{2d70}', '\u{2d70}'), ('\u{2d7f}', '\u{2d7f}') ]; - pub static Tirhuta_table: &'static [(char, char)] = &[ + pub const Tirhuta_table: &'static [(char, char)] = &[ ('\u{11480}', '\u{114af}'), ('\u{114b0}', '\u{114b2}'), ('\u{114b3}', '\u{114b8}'), ('\u{114b9}', '\u{114b9}'), ('\u{114ba}', '\u{114ba}'), ('\u{114bb}', '\u{114be}'), ('\u{114bf}', '\u{114c0}'), ('\u{114c1}', '\u{114c1}'), ('\u{114c2}', '\u{114c3}'), @@ -3906,21 +3906,21 @@ pub mod script { ('\u{114d0}', '\u{114d9}') ]; - pub static Ugaritic_table: &'static [(char, char)] = &[ + pub const Ugaritic_table: &'static [(char, char)] = &[ ('\u{10380}', '\u{1039d}'), ('\u{1039f}', '\u{1039f}') ]; - pub static Vai_table: &'static [(char, char)] = &[ + pub const Vai_table: &'static [(char, char)] = &[ ('\u{a500}', '\u{a60b}'), ('\u{a60c}', '\u{a60c}'), ('\u{a60d}', '\u{a60f}'), ('\u{a610}', '\u{a61f}'), ('\u{a620}', '\u{a629}'), ('\u{a62a}', '\u{a62b}') ]; - pub static Warang_Citi_table: &'static [(char, char)] = &[ + pub const Warang_Citi_table: &'static [(char, char)] = &[ ('\u{118a0}', '\u{118df}'), ('\u{118e0}', '\u{118e9}'), ('\u{118ea}', '\u{118f2}'), ('\u{118ff}', '\u{118ff}') ]; - pub static Yi_table: &'static [(char, char)] = &[ + pub const Yi_table: &'static [(char, char)] = &[ ('\u{a000}', '\u{a014}'), ('\u{a015}', '\u{a015}'), ('\u{a016}', '\u{a48c}'), ('\u{a490}', '\u{a4c6}') ]; @@ -3928,11 +3928,11 @@ pub mod script { } pub mod property { - pub static Join_Control_table: &'static [(char, char)] = &[ + pub const Join_Control_table: &'static [(char, char)] = &[ ('\u{200c}', '\u{200d}') ]; - pub static Noncharacter_Code_Point_table: &'static [(char, char)] = &[ + pub const Noncharacter_Code_Point_table: &'static [(char, char)] = &[ ('\u{fdd0}', '\u{fdef}'), ('\u{fffe}', '\u{ffff}'), ('\u{1fffe}', '\u{1ffff}'), ('\u{2fffe}', '\u{2ffff}'), ('\u{3fffe}', '\u{3ffff}'), ('\u{4fffe}', '\u{4ffff}'), ('\u{5fffe}', '\u{5ffff}'), ('\u{6fffe}', '\u{6ffff}'), ('\u{7fffe}', '\u{7ffff}'), @@ -3941,7 +3941,7 @@ pub mod property { ('\u{efffe}', '\u{effff}'), ('\u{ffffe}', '\u{fffff}') ]; - pub static White_Space_table: &'static [(char, char)] = &[ + pub const White_Space_table: &'static [(char, char)] = &[ ('\u{9}', '\u{d}'), ('\u{20}', '\u{20}'), ('\u{85}', '\u{85}'), ('\u{a0}', '\u{a0}'), ('\u{1680}', '\u{1680}'), ('\u{2000}', '\u{200a}'), ('\u{2028}', '\u{2028}'), ('\u{2029}', '\u{2029}'), ('\u{202f}', '\u{202f}'), ('\u{205f}', '\u{205f}'), ('\u{3000}', '\u{3000}') @@ -3954,111 +3954,110 @@ pub mod property { } pub mod regex { - pub static UNICODE_CLASSES: &'static [(&'static str, &'static &'static [(char, char)])] = &[ - ("Alphabetic", &super::derived_property::Alphabetic_table), ("Arabic", - &super::script::Arabic_table), ("Armenian", &super::script::Armenian_table), ("Avestan", - &super::script::Avestan_table), ("Balinese", &super::script::Balinese_table), ("Bamum", - &super::script::Bamum_table), ("Bassa_Vah", &super::script::Bassa_Vah_table), ("Batak", - &super::script::Batak_table), ("Bengali", &super::script::Bengali_table), ("Bopomofo", - &super::script::Bopomofo_table), ("Brahmi", &super::script::Brahmi_table), ("Braille", - &super::script::Braille_table), ("Buginese", &super::script::Buginese_table), ("Buhid", - &super::script::Buhid_table), ("C", &super::general_category::C_table), - ("Canadian_Aboriginal", &super::script::Canadian_Aboriginal_table), ("Carian", - &super::script::Carian_table), ("Caucasian_Albanian", - &super::script::Caucasian_Albanian_table), ("Cc", &super::general_category::Cc_table), - ("Cf", &super::general_category::Cf_table), ("Chakma", &super::script::Chakma_table), - ("Cham", &super::script::Cham_table), ("Cherokee", &super::script::Cherokee_table), ("Cn", - &super::general_category::Cn_table), ("Co", &super::general_category::Co_table), ("Common", - &super::script::Common_table), ("Coptic", &super::script::Coptic_table), ("Cuneiform", - &super::script::Cuneiform_table), ("Cypriot", &super::script::Cypriot_table), ("Cyrillic", - &super::script::Cyrillic_table), ("Default_Ignorable_Code_Point", - &super::derived_property::Default_Ignorable_Code_Point_table), ("Deseret", - &super::script::Deseret_table), ("Devanagari", &super::script::Devanagari_table), - ("Duployan", &super::script::Duployan_table), ("Egyptian_Hieroglyphs", - &super::script::Egyptian_Hieroglyphs_table), ("Elbasan", &super::script::Elbasan_table), - ("Ethiopic", &super::script::Ethiopic_table), ("Georgian", &super::script::Georgian_table), - ("Glagolitic", &super::script::Glagolitic_table), ("Gothic", &super::script::Gothic_table), - ("Grantha", &super::script::Grantha_table), ("Greek", &super::script::Greek_table), - ("Gujarati", &super::script::Gujarati_table), ("Gurmukhi", &super::script::Gurmukhi_table), - ("Han", &super::script::Han_table), ("Hangul", &super::script::Hangul_table), ("Hanunoo", - &super::script::Hanunoo_table), ("Hebrew", &super::script::Hebrew_table), ("Hiragana", - &super::script::Hiragana_table), ("Imperial_Aramaic", - &super::script::Imperial_Aramaic_table), ("Inherited", &super::script::Inherited_table), - ("Inscriptional_Pahlavi", &super::script::Inscriptional_Pahlavi_table), - ("Inscriptional_Parthian", &super::script::Inscriptional_Parthian_table), ("Javanese", - &super::script::Javanese_table), ("Join_Control", &super::property::Join_Control_table), - ("Kaithi", &super::script::Kaithi_table), ("Kannada", &super::script::Kannada_table), - ("Katakana", &super::script::Katakana_table), ("Kayah_Li", &super::script::Kayah_Li_table), - ("Kharoshthi", &super::script::Kharoshthi_table), ("Khmer", &super::script::Khmer_table), - ("Khojki", &super::script::Khojki_table), ("Khudawadi", &super::script::Khudawadi_table), - ("L", &super::general_category::L_table), ("LC", &super::general_category::LC_table), - ("Lao", &super::script::Lao_table), ("Latin", &super::script::Latin_table), ("Lepcha", - &super::script::Lepcha_table), ("Limbu", &super::script::Limbu_table), ("Linear_A", - &super::script::Linear_A_table), ("Linear_B", &super::script::Linear_B_table), ("Lisu", - &super::script::Lisu_table), ("Ll", &super::general_category::Ll_table), ("Lm", - &super::general_category::Lm_table), ("Lo", &super::general_category::Lo_table), - ("Lowercase", &super::derived_property::Lowercase_table), ("Lt", - &super::general_category::Lt_table), ("Lu", &super::general_category::Lu_table), ("Lycian", - &super::script::Lycian_table), ("Lydian", &super::script::Lydian_table), ("M", - &super::general_category::M_table), ("Mahajani", &super::script::Mahajani_table), - ("Malayalam", &super::script::Malayalam_table), ("Mandaic", &super::script::Mandaic_table), - ("Manichaean", &super::script::Manichaean_table), ("Mc", - &super::general_category::Mc_table), ("Me", &super::general_category::Me_table), - ("Meetei_Mayek", &super::script::Meetei_Mayek_table), ("Mende_Kikakui", - &super::script::Mende_Kikakui_table), ("Meroitic_Cursive", - &super::script::Meroitic_Cursive_table), ("Meroitic_Hieroglyphs", - &super::script::Meroitic_Hieroglyphs_table), ("Miao", &super::script::Miao_table), ("Mn", - &super::general_category::Mn_table), ("Modi", &super::script::Modi_table), ("Mongolian", - &super::script::Mongolian_table), ("Mro", &super::script::Mro_table), ("Myanmar", - &super::script::Myanmar_table), ("N", &super::general_category::N_table), ("Nabataean", - &super::script::Nabataean_table), ("Nd", &super::general_category::Nd_table), - ("New_Tai_Lue", &super::script::New_Tai_Lue_table), ("Nko", &super::script::Nko_table), - ("Nl", &super::general_category::Nl_table), ("No", &super::general_category::No_table), - ("Noncharacter_Code_Point", &super::property::Noncharacter_Code_Point_table), ("Ogham", - &super::script::Ogham_table), ("Ol_Chiki", &super::script::Ol_Chiki_table), ("Old_Italic", - &super::script::Old_Italic_table), ("Old_North_Arabian", - &super::script::Old_North_Arabian_table), ("Old_Permic", &super::script::Old_Permic_table), - ("Old_Persian", &super::script::Old_Persian_table), ("Old_South_Arabian", - &super::script::Old_South_Arabian_table), ("Old_Turkic", &super::script::Old_Turkic_table), - ("Oriya", &super::script::Oriya_table), ("Osmanya", &super::script::Osmanya_table), ("P", - &super::general_category::P_table), ("Pahawh_Hmong", &super::script::Pahawh_Hmong_table), - ("Palmyrene", &super::script::Palmyrene_table), ("Pau_Cin_Hau", - &super::script::Pau_Cin_Hau_table), ("Pc", &super::general_category::Pc_table), ("Pd", - &super::general_category::Pd_table), ("Pe", &super::general_category::Pe_table), ("Pf", - &super::general_category::Pf_table), ("Phags_Pa", &super::script::Phags_Pa_table), - ("Phoenician", &super::script::Phoenician_table), ("Pi", - &super::general_category::Pi_table), ("Po", &super::general_category::Po_table), ("Ps", - &super::general_category::Ps_table), ("Psalter_Pahlavi", - &super::script::Psalter_Pahlavi_table), ("Rejang", &super::script::Rejang_table), ("Runic", - &super::script::Runic_table), ("S", &super::general_category::S_table), ("Samaritan", - &super::script::Samaritan_table), ("Saurashtra", &super::script::Saurashtra_table), ("Sc", - &super::general_category::Sc_table), ("Sharada", &super::script::Sharada_table), ("Shavian", - &super::script::Shavian_table), ("Siddham", &super::script::Siddham_table), ("Sinhala", - &super::script::Sinhala_table), ("Sk", &super::general_category::Sk_table), ("Sm", - &super::general_category::Sm_table), ("So", &super::general_category::So_table), - ("Sora_Sompeng", &super::script::Sora_Sompeng_table), ("Sundanese", - &super::script::Sundanese_table), ("Syloti_Nagri", &super::script::Syloti_Nagri_table), - ("Syriac", &super::script::Syriac_table), ("Tagalog", &super::script::Tagalog_table), - ("Tagbanwa", &super::script::Tagbanwa_table), ("Tai_Le", &super::script::Tai_Le_table), - ("Tai_Tham", &super::script::Tai_Tham_table), ("Tai_Viet", &super::script::Tai_Viet_table), - ("Takri", &super::script::Takri_table), ("Tamil", &super::script::Tamil_table), ("Telugu", - &super::script::Telugu_table), ("Thaana", &super::script::Thaana_table), ("Thai", - &super::script::Thai_table), ("Tibetan", &super::script::Tibetan_table), ("Tifinagh", - &super::script::Tifinagh_table), ("Tirhuta", &super::script::Tirhuta_table), ("Ugaritic", - &super::script::Ugaritic_table), ("Uppercase", &super::derived_property::Uppercase_table), - ("Vai", &super::script::Vai_table), ("Warang_Citi", &super::script::Warang_Citi_table), - ("White_Space", &super::property::White_Space_table), ("XID_Continue", - &super::derived_property::XID_Continue_table), ("XID_Start", - &super::derived_property::XID_Start_table), ("Yi", &super::script::Yi_table), ("Z", - &super::general_category::Z_table), ("Zl", &super::general_category::Zl_table), ("Zp", - &super::general_category::Zp_table), ("Zs", &super::general_category::Zs_table) - ]; - - pub static PERLD: &'static &'static [(char, char)] = &super::general_category::Nd_table; - - pub static PERLS: &'static &'static [(char, char)] = &super::property::White_Space_table; - - pub static PERLW: &'static [(char, char)] = &[ + pub const UNICODE_CLASSES: &'static [(&'static str, &'static [(char, char)])] = &[ + ("Alphabetic", super::derived_property::Alphabetic_table), ("Arabic", + super::script::Arabic_table), ("Armenian", super::script::Armenian_table), ("Avestan", + super::script::Avestan_table), ("Balinese", super::script::Balinese_table), ("Bamum", + super::script::Bamum_table), ("Bassa_Vah", super::script::Bassa_Vah_table), ("Batak", + super::script::Batak_table), ("Bengali", super::script::Bengali_table), ("Bopomofo", + super::script::Bopomofo_table), ("Brahmi", super::script::Brahmi_table), ("Braille", + super::script::Braille_table), ("Buginese", super::script::Buginese_table), ("Buhid", + super::script::Buhid_table), ("C", super::general_category::C_table), + ("Canadian_Aboriginal", super::script::Canadian_Aboriginal_table), ("Carian", + super::script::Carian_table), ("Caucasian_Albanian", + super::script::Caucasian_Albanian_table), ("Cc", super::general_category::Cc_table), ("Cf", + super::general_category::Cf_table), ("Chakma", super::script::Chakma_table), ("Cham", + super::script::Cham_table), ("Cherokee", super::script::Cherokee_table), ("Cn", + super::general_category::Cn_table), ("Co", super::general_category::Co_table), ("Common", + super::script::Common_table), ("Coptic", super::script::Coptic_table), ("Cuneiform", + super::script::Cuneiform_table), ("Cypriot", super::script::Cypriot_table), ("Cyrillic", + super::script::Cyrillic_table), ("Default_Ignorable_Code_Point", + super::derived_property::Default_Ignorable_Code_Point_table), ("Deseret", + super::script::Deseret_table), ("Devanagari", super::script::Devanagari_table), ("Duployan", + super::script::Duployan_table), ("Egyptian_Hieroglyphs", + super::script::Egyptian_Hieroglyphs_table), ("Elbasan", super::script::Elbasan_table), + ("Ethiopic", super::script::Ethiopic_table), ("Georgian", super::script::Georgian_table), + ("Glagolitic", super::script::Glagolitic_table), ("Gothic", super::script::Gothic_table), + ("Grantha", super::script::Grantha_table), ("Greek", super::script::Greek_table), + ("Gujarati", super::script::Gujarati_table), ("Gurmukhi", super::script::Gurmukhi_table), + ("Han", super::script::Han_table), ("Hangul", super::script::Hangul_table), ("Hanunoo", + super::script::Hanunoo_table), ("Hebrew", super::script::Hebrew_table), ("Hiragana", + super::script::Hiragana_table), ("Imperial_Aramaic", super::script::Imperial_Aramaic_table), + ("Inherited", super::script::Inherited_table), ("Inscriptional_Pahlavi", + super::script::Inscriptional_Pahlavi_table), ("Inscriptional_Parthian", + super::script::Inscriptional_Parthian_table), ("Javanese", super::script::Javanese_table), + ("Join_Control", super::property::Join_Control_table), ("Kaithi", + super::script::Kaithi_table), ("Kannada", super::script::Kannada_table), ("Katakana", + super::script::Katakana_table), ("Kayah_Li", super::script::Kayah_Li_table), ("Kharoshthi", + super::script::Kharoshthi_table), ("Khmer", super::script::Khmer_table), ("Khojki", + super::script::Khojki_table), ("Khudawadi", super::script::Khudawadi_table), ("L", + super::general_category::L_table), ("LC", super::general_category::LC_table), ("Lao", + super::script::Lao_table), ("Latin", super::script::Latin_table), ("Lepcha", + super::script::Lepcha_table), ("Limbu", super::script::Limbu_table), ("Linear_A", + super::script::Linear_A_table), ("Linear_B", super::script::Linear_B_table), ("Lisu", + super::script::Lisu_table), ("Ll", super::general_category::Ll_table), ("Lm", + super::general_category::Lm_table), ("Lo", super::general_category::Lo_table), ("Lowercase", + super::derived_property::Lowercase_table), ("Lt", super::general_category::Lt_table), ("Lu", + super::general_category::Lu_table), ("Lycian", super::script::Lycian_table), ("Lydian", + super::script::Lydian_table), ("M", super::general_category::M_table), ("Mahajani", + super::script::Mahajani_table), ("Malayalam", super::script::Malayalam_table), ("Mandaic", + super::script::Mandaic_table), ("Manichaean", super::script::Manichaean_table), ("Mc", + super::general_category::Mc_table), ("Me", super::general_category::Me_table), + ("Meetei_Mayek", super::script::Meetei_Mayek_table), ("Mende_Kikakui", + super::script::Mende_Kikakui_table), ("Meroitic_Cursive", + super::script::Meroitic_Cursive_table), ("Meroitic_Hieroglyphs", + super::script::Meroitic_Hieroglyphs_table), ("Miao", super::script::Miao_table), ("Mn", + super::general_category::Mn_table), ("Modi", super::script::Modi_table), ("Mongolian", + super::script::Mongolian_table), ("Mro", super::script::Mro_table), ("Myanmar", + super::script::Myanmar_table), ("N", super::general_category::N_table), ("Nabataean", + super::script::Nabataean_table), ("Nd", super::general_category::Nd_table), ("New_Tai_Lue", + super::script::New_Tai_Lue_table), ("Nko", super::script::Nko_table), ("Nl", + super::general_category::Nl_table), ("No", super::general_category::No_table), + ("Noncharacter_Code_Point", super::property::Noncharacter_Code_Point_table), ("Ogham", + super::script::Ogham_table), ("Ol_Chiki", super::script::Ol_Chiki_table), ("Old_Italic", + super::script::Old_Italic_table), ("Old_North_Arabian", + super::script::Old_North_Arabian_table), ("Old_Permic", super::script::Old_Permic_table), + ("Old_Persian", super::script::Old_Persian_table), ("Old_South_Arabian", + super::script::Old_South_Arabian_table), ("Old_Turkic", super::script::Old_Turkic_table), + ("Oriya", super::script::Oriya_table), ("Osmanya", super::script::Osmanya_table), ("P", + super::general_category::P_table), ("Pahawh_Hmong", super::script::Pahawh_Hmong_table), + ("Palmyrene", super::script::Palmyrene_table), ("Pau_Cin_Hau", + super::script::Pau_Cin_Hau_table), ("Pc", super::general_category::Pc_table), ("Pd", + super::general_category::Pd_table), ("Pe", super::general_category::Pe_table), ("Pf", + super::general_category::Pf_table), ("Phags_Pa", super::script::Phags_Pa_table), + ("Phoenician", super::script::Phoenician_table), ("Pi", super::general_category::Pi_table), + ("Po", super::general_category::Po_table), ("Ps", super::general_category::Ps_table), + ("Psalter_Pahlavi", super::script::Psalter_Pahlavi_table), ("Rejang", + super::script::Rejang_table), ("Runic", super::script::Runic_table), ("S", + super::general_category::S_table), ("Samaritan", super::script::Samaritan_table), + ("Saurashtra", super::script::Saurashtra_table), ("Sc", super::general_category::Sc_table), + ("Sharada", super::script::Sharada_table), ("Shavian", super::script::Shavian_table), + ("Siddham", super::script::Siddham_table), ("Sinhala", super::script::Sinhala_table), ("Sk", + super::general_category::Sk_table), ("Sm", super::general_category::Sm_table), ("So", + super::general_category::So_table), ("Sora_Sompeng", super::script::Sora_Sompeng_table), + ("Sundanese", super::script::Sundanese_table), ("Syloti_Nagri", + super::script::Syloti_Nagri_table), ("Syriac", super::script::Syriac_table), ("Tagalog", + super::script::Tagalog_table), ("Tagbanwa", super::script::Tagbanwa_table), ("Tai_Le", + super::script::Tai_Le_table), ("Tai_Tham", super::script::Tai_Tham_table), ("Tai_Viet", + super::script::Tai_Viet_table), ("Takri", super::script::Takri_table), ("Tamil", + super::script::Tamil_table), ("Telugu", super::script::Telugu_table), ("Thaana", + super::script::Thaana_table), ("Thai", super::script::Thai_table), ("Tibetan", + super::script::Tibetan_table), ("Tifinagh", super::script::Tifinagh_table), ("Tirhuta", + super::script::Tirhuta_table), ("Ugaritic", super::script::Ugaritic_table), ("Uppercase", + super::derived_property::Uppercase_table), ("Vai", super::script::Vai_table), + ("Warang_Citi", super::script::Warang_Citi_table), ("White_Space", + super::property::White_Space_table), ("XID_Continue", + super::derived_property::XID_Continue_table), ("XID_Start", + super::derived_property::XID_Start_table), ("Yi", super::script::Yi_table), ("Z", + super::general_category::Z_table), ("Zl", super::general_category::Zl_table), ("Zp", + super::general_category::Zp_table), ("Zs", super::general_category::Zs_table) + ]; + + pub const PERLD: &'static [(char, char)] = super::general_category::Nd_table; + + pub const PERLS: &'static [(char, char)] = super::property::White_Space_table; + + pub const PERLW: &'static [(char, char)] = &[ ('\u{30}', '\u{39}'), ('\u{41}', '\u{5a}'), ('\u{5f}', '\u{5f}'), ('\u{61}', '\u{7a}'), ('\u{aa}', '\u{aa}'), ('\u{b5}', '\u{b5}'), ('\u{ba}', '\u{ba}'), ('\u{c0}', '\u{d6}'), ('\u{d8}', '\u{f6}'), ('\u{f8}', '\u{2c1}'), ('\u{2c6}', '\u{2d1}'), ('\u{2e0}', '\u{2e4}'), @@ -4254,7 +4253,7 @@ pub mod regex { pub mod normalization { // Canonical decompositions - pub static canonical_table: &'static [(char, &'static [char])] = &[ + pub const canonical_table: &'static [(char, &'static [char])] = &[ ('\u{c0}', &['\u{41}', '\u{300}']), ('\u{c1}', &['\u{41}', '\u{301}']), ('\u{c2}', &['\u{41}', '\u{302}']), ('\u{c3}', &['\u{41}', '\u{303}']), ('\u{c4}', &['\u{41}', '\u{308}']), ('\u{c5}', &['\u{41}', '\u{30a}']), ('\u{c7}', &['\u{43}', '\u{327}']), @@ -5056,7 +5055,7 @@ pub mod normalization { ]; // Compatibility decompositions - pub static compatibility_table: &'static [(char, &'static [char])] = &[ + pub const compatibility_table: &'static [(char, &'static [char])] = &[ ('\u{a0}', &['\u{20}']), ('\u{a8}', &['\u{20}', '\u{308}']), ('\u{aa}', &['\u{61}']), ('\u{af}', &['\u{20}', '\u{304}']), ('\u{b2}', &['\u{32}']), ('\u{b3}', &['\u{33}']), ('\u{b4}', &['\u{20}', '\u{301}']), ('\u{b5}', &['\u{3bc}']), ('\u{b8}', &['\u{20}', @@ -6480,7 +6479,7 @@ pub mod normalization { ]; // Canonical compositions - pub static composition_table: &'static [(char, &'static [(char, char)])] = &[ + pub const composition_table: &'static [(char, &'static [(char, char)])] = &[ ('\u{3c}', &[('\u{338}', '\u{226e}')]), ('\u{3d}', &[('\u{338}', '\u{2260}')]), ('\u{3e}', &[('\u{338}', '\u{226f}')]), ('\u{41}', &[('\u{300}', '\u{c0}'), ('\u{301}', '\u{c1}'), ('\u{302}', '\u{c2}'), ('\u{303}', '\u{c3}'), ('\u{304}', '\u{100}'), ('\u{306}', @@ -6840,7 +6839,7 @@ pub mod normalization { } } - static combining_class_table: &'static [(char, char, u8)] = &[ + const combining_class_table: &'static [(char, char, u8)] = &[ ('\u{300}', '\u{314}', 230), ('\u{315}', '\u{315}', 232), ('\u{316}', '\u{319}', 220), ('\u{31a}', '\u{31a}', 232), ('\u{31b}', '\u{31b}', 216), ('\u{31c}', '\u{320}', 220), ('\u{321}', '\u{322}', 202), ('\u{323}', '\u{326}', 220), ('\u{327}', '\u{328}', 202), @@ -6988,7 +6987,7 @@ pub mod conversions { } } - static LuLl_table: &'static [(char, char)] = &[ + const LuLl_table: &'static [(char, char)] = &[ ('\u{41}', '\u{61}'), ('\u{42}', '\u{62}'), ('\u{43}', '\u{63}'), ('\u{44}', '\u{64}'), ('\u{45}', '\u{65}'), ('\u{46}', '\u{66}'), ('\u{47}', '\u{67}'), ('\u{48}', '\u{68}'), ('\u{49}', '\u{69}'), ('\u{4a}', '\u{6a}'), ('\u{4b}', '\u{6b}'), ('\u{4c}', '\u{6c}'), @@ -7284,7 +7283,7 @@ pub mod conversions { ('\u{118be}', '\u{118de}'), ('\u{118bf}', '\u{118df}') ]; - static LlLu_table: &'static [(char, char)] = &[ + const LlLu_table: &'static [(char, char)] = &[ ('\u{61}', '\u{41}'), ('\u{62}', '\u{42}'), ('\u{63}', '\u{43}'), ('\u{64}', '\u{44}'), ('\u{65}', '\u{45}'), ('\u{66}', '\u{46}'), ('\u{67}', '\u{47}'), ('\u{68}', '\u{48}'), ('\u{69}', '\u{49}'), ('\u{6a}', '\u{4a}'), ('\u{6b}', '\u{4b}'), ('\u{6c}', '\u{4c}'), @@ -7625,7 +7624,7 @@ pub mod charwidth { // character width table. Based on Markus Kuhn's free wcwidth() implementation, // http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c - static charwidth_table: &'static [(char, char, u8, u8)] = &[ + const charwidth_table: &'static [(char, char, u8, u8)] = &[ ('\u{a1}', '\u{a1}', 1, 2), ('\u{a4}', '\u{a4}', 1, 2), ('\u{a7}', '\u{a8}', 1, 2), ('\u{aa}', '\u{aa}', 1, 2), ('\u{ae}', '\u{ae}', 1, 2), ('\u{b0}', '\u{b4}', 1, 2), ('\u{b6}', '\u{ba}', 1, 2), ('\u{bc}', '\u{bf}', 1, 2), ('\u{c6}', '\u{c6}', 1, 2), @@ -7839,7 +7838,7 @@ pub mod grapheme { bsearch_range_value_table(c, grapheme_cat_table) } - static grapheme_cat_table: &'static [(char, char, GraphemeCat)] = &[ + const grapheme_cat_table: &'static [(char, char, GraphemeCat)] = &[ ('\u{0}', '\u{1f}', GC_Control), ('\u{7f}', '\u{9f}', GC_Control), ('\u{ad}', '\u{ad}', GC_Control), ('\u{300}', '\u{36f}', GC_Extend), ('\u{483}', '\u{487}', GC_Extend), ('\u{488}', '\u{489}', GC_Extend), ('\u{591}', '\u{5bd}', GC_Extend), ('\u{5bf}', '\u{5bf}', From f580412e952957dc1d91884338f2edc7866d1d17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Steinbrink?= Date: Mon, 2 Mar 2015 17:11:02 +0100 Subject: [PATCH 06/16] Drop alloca_zeroed Its only user was lvalue_scratch_datum which is called with zero=true anymore, so it's effectively unused. --- src/librustc_trans/trans/adt.rs | 2 +- src/librustc_trans/trans/base.rs | 16 ---------------- src/librustc_trans/trans/datum.rs | 14 ++++---------- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/src/librustc_trans/trans/adt.rs b/src/librustc_trans/trans/adt.rs index 3ea14d3c58929..777fd28d31f2a 100644 --- a/src/librustc_trans/trans/adt.rs +++ b/src/librustc_trans/trans/adt.rs @@ -1000,7 +1000,7 @@ pub fn trans_drop_flag_ptr<'blk, 'tcx>(mut bcx: Block<'blk, 'tcx>, r: &Repr<'tcx let fcx = bcx.fcx; let custom_cleanup_scope = fcx.push_custom_cleanup_scope(); let scratch = unpack_datum!(bcx, datum::lvalue_scratch_datum( - bcx, tcx.types.bool, "drop_flag", false, + bcx, tcx.types.bool, "drop_flag", cleanup::CustomScope(custom_cleanup_scope), (), |_, bcx, _| bcx )); bcx = fold_variants(bcx, r, val, |variant_cx, st, value| { diff --git a/src/librustc_trans/trans/base.rs b/src/librustc_trans/trans/base.rs index 1f578ac0bdbab..032620d2861fe 100644 --- a/src/librustc_trans/trans/base.rs +++ b/src/librustc_trans/trans/base.rs @@ -1203,21 +1203,6 @@ pub fn alloca_no_lifetime(cx: Block, ty: Type, name: &str) -> ValueRef { Alloca(cx, ty, name) } -pub fn alloca_zeroed<'blk, 'tcx>(cx: Block<'blk, 'tcx>, ty: Ty<'tcx>, - name: &str) -> ValueRef { - let llty = type_of::type_of(cx.ccx(), ty); - if cx.unreachable.get() { - unsafe { - return llvm::LLVMGetUndef(llty.ptr_to().to_ref()); - } - } - let p = alloca_no_lifetime(cx, llty, name); - let b = cx.fcx.ccx.builder(); - b.position_before(cx.fcx.alloca_insert_pt.get().unwrap()); - memzero(&b, p, ty); - p -} - // Creates the alloca slot which holds the pointer to the slot for the final return value pub fn make_return_slot_pointer<'a, 'tcx>(fcx: &FunctionContext<'a, 'tcx>, output_type: Ty<'tcx>) -> ValueRef { @@ -1547,7 +1532,6 @@ fn create_datums_for_fn_args_under_call_abi<'blk, 'tcx>( datum::lvalue_scratch_datum(bcx, arg_ty, "tupled_args", - false, tuple_args_scope_id, (), |(), diff --git a/src/librustc_trans/trans/datum.rs b/src/librustc_trans/trans/datum.rs index 6ca71254868f3..e181df545e6fc 100644 --- a/src/librustc_trans/trans/datum.rs +++ b/src/librustc_trans/trans/datum.rs @@ -195,24 +195,18 @@ pub fn immediate_rvalue_bcx<'blk, 'tcx>(bcx: Block<'blk, 'tcx>, /// Allocates temporary space on the stack using alloca() and returns a by-ref Datum pointing to /// it. The memory will be dropped upon exit from `scope`. The callback `populate` should -/// initialize the memory. If `zero` is true, the space will be zeroed when it is allocated; this -/// is not necessary unless `bcx` does not dominate the end of `scope`. +/// initialize the memory. pub fn lvalue_scratch_datum<'blk, 'tcx, A, F>(bcx: Block<'blk, 'tcx>, ty: Ty<'tcx>, name: &str, - zero: bool, scope: cleanup::ScopeId, arg: A, populate: F) -> DatumBlock<'blk, 'tcx, Lvalue> where F: FnOnce(A, Block<'blk, 'tcx>, ValueRef) -> Block<'blk, 'tcx>, { - let scratch = if zero { - alloca_zeroed(bcx, ty, name) - } else { - let llty = type_of::type_of(bcx.ccx(), ty); - alloca(bcx, llty, name) - }; + let llty = type_of::type_of(bcx.ccx(), ty); + let scratch = alloca(bcx, llty, name); // Subtle. Populate the scratch memory *before* scheduling cleanup. let bcx = populate(arg, bcx, scratch); @@ -383,7 +377,7 @@ impl<'tcx> Datum<'tcx, Rvalue> { ByValue => { lvalue_scratch_datum( - bcx, self.ty, name, false, scope, self, + bcx, self.ty, name, scope, self, |this, bcx, llval| this.store_to(bcx, llval)) } } From c6b66034d61581ff32effa5929de97143f4b38e3 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Thu, 19 Feb 2015 12:41:10 +0100 Subject: [PATCH 07/16] Make `test/run-pass/backtrace.rs` more robust about own host environment. Namely, I have been annoyed in the past when I have done `RUST_BACKTRACE=1 make check` only to discover (again) that such a trick causes this test to fail, because it assumes that the `RUST_BACKTRACE` environment variable is not set. Fix #22870 --- src/test/run-pass/backtrace.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/run-pass/backtrace.rs b/src/test/run-pass/backtrace.rs index 6f76322cb778d..879b3e920ab96 100644 --- a/src/test/run-pass/backtrace.rs +++ b/src/test/run-pass/backtrace.rs @@ -53,7 +53,9 @@ fn runtest(me: &str) { "bad output: {}", s); // Make sure the stack trace is *not* printed - let p = template.clone().arg("fail").spawn().unwrap(); + // (Remove RUST_BACKTRACE from our own environment, in case developer + // is running `make check` with it on.) + let p = template.clone().arg("fail").env_remove("RUST_BACKTRACE").spawn().unwrap(); let out = p.wait_with_output().unwrap(); assert!(!out.status.success()); let s = str::from_utf8(&out.error).unwrap(); From 33f77e92e823d2c08804ebe0c3faeecf74c709d2 Mon Sep 17 00:00:00 2001 From: Simonas Kazlauskas Date: Mon, 2 Mar 2015 22:54:39 +0200 Subject: [PATCH 08/16] Readd int_uint feature to libstd Reverts a small part of c74d49c804c3 because compilation pukes with warnings now. --- src/libstd/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 7957bc35b76b5..c890af631f0a8 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -123,6 +123,7 @@ #![feature(unsafe_no_drop_flag)] #![feature(macro_reexport)] #![feature(hash)] +#![feature(int_uint)] #![feature(unique)] #![cfg_attr(test, feature(test, rustc_private, env))] From daef3b9b53559b4c176b0a02db0f2c4fb8232c20 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Mon, 2 Mar 2015 13:21:40 -0800 Subject: [PATCH 09/16] Add regression tests for #15778 Fixes #15778. --- src/test/auxiliary/lint_for_crate.rs | 43 +++++++++++++++++++ .../compile-fail-fulldeps/issue-15778-fail.rs | 18 ++++++++ .../run-pass-fulldeps/issue-15778-pass.rs | 19 ++++++++ 3 files changed, 80 insertions(+) create mode 100644 src/test/auxiliary/lint_for_crate.rs create mode 100644 src/test/compile-fail-fulldeps/issue-15778-fail.rs create mode 100644 src/test/run-pass-fulldeps/issue-15778-pass.rs diff --git a/src/test/auxiliary/lint_for_crate.rs b/src/test/auxiliary/lint_for_crate.rs new file mode 100644 index 0000000000000..1be37ce1780b3 --- /dev/null +++ b/src/test/auxiliary/lint_for_crate.rs @@ -0,0 +1,43 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// force-host + +#![feature(plugin_registrar)] +#![feature(box_syntax)] + +extern crate syntax; +#[macro_use] extern crate rustc; + +use syntax::{ast, attr}; +use rustc::lint::{Context, LintPass, LintPassObject, LintArray}; +use rustc::plugin::Registry; + +declare_lint!(CRATE_NOT_OKAY, Warn, "crate not marked with #![crate_okay]"); + +struct Pass; + +impl LintPass for Pass { + fn get_lints(&self) -> LintArray { + lint_array!(CRATE_NOT_OKAY) + } + + fn check_crate(&mut self, cx: &Context, krate: &ast::Crate) { + if !attr::contains_name(&krate.attrs, "crate_okay") { + cx.span_lint(CRATE_NOT_OKAY, krate.span, + "crate is not marked with #![crate_okay]"); + } + } +} + +#[plugin_registrar] +pub fn plugin_registrar(reg: &mut Registry) { + reg.register_lint_pass(box Pass as LintPassObject); +} diff --git a/src/test/compile-fail-fulldeps/issue-15778-fail.rs b/src/test/compile-fail-fulldeps/issue-15778-fail.rs new file mode 100644 index 0000000000000..8c6889f715fc0 --- /dev/null +++ b/src/test/compile-fail-fulldeps/issue-15778-fail.rs @@ -0,0 +1,18 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:lint_for_crate.rs +// ignore-stage1 +// compile-flags: -D crate-not-okay + +#![feature(plugin, custom_attribute)] //~ ERROR crate is not marked with #![crate_okay] +#![plugin(lint_for_crate)] + +pub fn main() { } diff --git a/src/test/run-pass-fulldeps/issue-15778-pass.rs b/src/test/run-pass-fulldeps/issue-15778-pass.rs new file mode 100644 index 0000000000000..a767779687a3d --- /dev/null +++ b/src/test/run-pass-fulldeps/issue-15778-pass.rs @@ -0,0 +1,19 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:lint_for_crate.rs +// ignore-stage1 +// compile-flags: -D crate-not-okay + +#![feature(plugin, custom_attribute)] +#![plugin(lint_for_crate)] +#![crate_okay] + +pub fn main() { } From 2b03718618d66e7e672663230be1ee857d3fb89a Mon Sep 17 00:00:00 2001 From: Ivan Petkov Date: Sat, 28 Feb 2015 23:24:05 -0800 Subject: [PATCH 10/16] Enable recursion for visit_ty in lint visitor * The lint visitor's visit_ty method did not recurse, and had a reference to the now closed #10894 * The newly enabled recursion has only affected the `deprectated` lint which now detects uses of deprecated items in trait impls and function return types * Renamed some references to `CowString` and `CowVec` to `Cow` and `Cow<[T]>`, respectively, which appear outside of the crate which defines them * Replaced a few instances of `InvariantType` with `PhantomData>` * Disabled the `deprecated` lint in several places that reference/implement traits on deprecated items which will get cleaned up in the future * Disabled the `exceeding_bitshifts` lint for compile-fail/huge-array-simple test so it doesn't shadow the expected error on 32bit systems * Unfortunately, this means that if a library declares `#![deny(deprecated)]` and marks anything as deprecated, it will have to disable the lint for any uses of said item, e.g. any impl the now deprecated item For any library that denies deprecated items but has deprecated items of its own, this is a [breaking-change] --- src/libcollections/str.rs | 1 + src/libcollections/vec.rs | 12 ++++++------ src/libcore/atomic.rs | 2 ++ src/libcore/raw.rs | 1 + src/libcore/str/mod.rs | 2 ++ src/libgraphviz/lib.rs | 4 ++-- src/librustc/lint/context.rs | 2 +- src/librustc/middle/ty.rs | 4 ++-- src/libstd/ffi/os_str.rs | 8 ++++---- src/libstd/sys/common/wtf8.rs | 7 +++---- src/libstd/sys/unix/os_str.rs | 5 +++-- src/libstd/sys/windows/os_str.rs | 5 +++-- src/libstd/thread_local/scoped.rs | 5 +++-- src/test/compile-fail/huge-array-simple.rs | 1 + 14 files changed, 34 insertions(+), 25 deletions(-) diff --git a/src/libcollections/str.rs b/src/libcollections/str.rs index 86fcac3e4b8a0..599b92d05ddd7 100644 --- a/src/libcollections/str.rs +++ b/src/libcollections/str.rs @@ -756,6 +756,7 @@ pub trait StrExt: Index { /// ``` #[unstable(feature = "collections")] #[deprecated(since = "1.0.0", reason = "use `split()` with a `&str`")] + #[allow(deprecated) /* for SplitStr */] fn split_str<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitStr<'a, P> { core_str::StrExt::split_str(&self[..], pat) } diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs index 805e4623396b8..a4d39974c7013 100644 --- a/src/libcollections/vec.rs +++ b/src/libcollections/vec.rs @@ -1499,9 +1499,9 @@ impl Extend for Vec { __impl_slice_eq1! { Vec, Vec } __impl_slice_eq2! { Vec, &'b [B] } __impl_slice_eq2! { Vec, &'b mut [B] } -__impl_slice_eq2! { CowVec<'a, A>, &'b [B], Clone } -__impl_slice_eq2! { CowVec<'a, A>, &'b mut [B], Clone } -__impl_slice_eq2! { CowVec<'a, A>, Vec, Clone } +__impl_slice_eq2! { Cow<'a, [A]>, &'b [B], Clone } +__impl_slice_eq2! { Cow<'a, [A]>, &'b mut [B], Clone } +__impl_slice_eq2! { Cow<'a, [A]>, Vec, Clone } macro_rules! array_impls { ($($N: expr)+) => { @@ -1510,9 +1510,9 @@ macro_rules! array_impls { __impl_slice_eq2! { Vec, [B; $N] } __impl_slice_eq2! { Vec, &'b [B; $N] } // __impl_slice_eq2! { Vec, &'b mut [B; $N] } - // __impl_slice_eq2! { CowVec<'a, A>, [B; $N], Clone } - // __impl_slice_eq2! { CowVec<'a, A>, &'b [B; $N], Clone } - // __impl_slice_eq2! { CowVec<'a, A>, &'b mut [B; $N], Clone } + // __impl_slice_eq2! { Cow<'a, [A]>, [B; $N], Clone } + // __impl_slice_eq2! { Cow<'a, [A]>, &'b [B; $N], Clone } + // __impl_slice_eq2! { Cow<'a, [A]>, &'b mut [B; $N], Clone } )+ } } diff --git a/src/libcore/atomic.rs b/src/libcore/atomic.rs index 38e2bd98ef9e3..c316236a80412 100644 --- a/src/libcore/atomic.rs +++ b/src/libcore/atomic.rs @@ -1067,6 +1067,7 @@ pub struct AtomicInt { v: UnsafeCell, } +#[allow(deprecated)] unsafe impl Sync for AtomicInt {} #[unstable(feature = "core")] @@ -1077,6 +1078,7 @@ pub struct AtomicUint { v: UnsafeCell, } +#[allow(deprecated)] unsafe impl Sync for AtomicUint {} #[unstable(feature = "core")] diff --git a/src/libcore/raw.rs b/src/libcore/raw.rs index 5cc210df5b464..35dfc76268727 100644 --- a/src/libcore/raw.rs +++ b/src/libcore/raw.rs @@ -70,6 +70,7 @@ impl Copy for Slice {} #[deprecated(reason = "unboxed new closures do not have a universal representation; \ `&Fn` (etc) trait objects should use `TraitObject` instead", since= "1.0.0")] +#[allow(deprecated) /* for deriving Copy impl */] pub struct Closure { pub code: *mut (), pub env: *mut (), diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index b354116993c23..facc62a8659e6 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -935,6 +935,7 @@ impl<'a, P: Pattern<'a>> Iterator for MatchIndices<'a, P> { #[unstable(feature = "core")] #[deprecated(since = "1.0.0", reason = "use `Split` with a `&str`")] pub struct SplitStr<'a, P: Pattern<'a>>(Split<'a, P>); +#[allow(deprecated)] impl<'a, P: Pattern<'a>> Iterator for SplitStr<'a, P> { type Item = &'a str; @@ -1325,6 +1326,7 @@ pub trait StrExt { fn split_terminator<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitTerminator<'a, P>; fn rsplitn<'a, P: Pattern<'a>>(&'a self, count: usize, pat: P) -> RSplitN<'a, P>; fn match_indices<'a, P: Pattern<'a>>(&'a self, pat: P) -> MatchIndices<'a, P>; + #[allow(deprecated) /* for SplitStr */] fn split_str<'a, P: Pattern<'a>>(&'a self, pat: P) -> SplitStr<'a, P>; fn lines<'a>(&'a self) -> Lines<'a>; fn lines_any<'a>(&'a self) -> LinesAny<'a>; diff --git a/src/libgraphviz/lib.rs b/src/libgraphviz/lib.rs index 09fbf4935e4c1..2f60a9e2cca2a 100644 --- a/src/libgraphviz/lib.rs +++ b/src/libgraphviz/lib.rs @@ -37,7 +37,7 @@ //! Each node label is derived directly from the int representing the node, //! while the edge labels are all empty strings. //! -//! This example also illustrates how to use `CowVec` to return +//! This example also illustrates how to use `Cow<[T]>` to return //! an owned vector or a borrowed slice as appropriate: we construct the //! node vector from scratch, but borrow the edge list (rather than //! constructing a copy of all the edges from scratch). @@ -502,7 +502,7 @@ pub type Edges<'a,E> = Cow<'a,[E]>; /// that is bound by the self lifetime `'a`. /// /// The `nodes` and `edges` method each return instantiations of -/// `CowVec` to leave implementers the freedom to create +/// `Cow<[T]>` to leave implementers the freedom to create /// entirely new vectors or to pass back slices into internally owned /// vectors. pub trait GraphWalk<'a, N, E> { diff --git a/src/librustc/lint/context.rs b/src/librustc/lint/context.rs index f635c77af9b2a..a777e1f7f75e6 100644 --- a/src/librustc/lint/context.rs +++ b/src/librustc/lint/context.rs @@ -568,9 +568,9 @@ impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> { }) } - // FIXME(#10894) should continue recursing fn visit_ty(&mut self, t: &ast::Ty) { run_lints!(self, check_ty, t); + visit::walk_ty(self, t); } fn visit_ident(&mut self, sp: Span, id: ast::Ident) { diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index aaba840825e69..5cd2d3ca31291 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -76,7 +76,7 @@ use std::hash::{Hash, SipHasher, Hasher}; use std::mem; use std::ops; use std::rc::Rc; -use std::vec::{CowVec, IntoIter}; +use std::vec::IntoIter; use collections::enum_set::{EnumSet, CLike}; use std::collections::{HashMap, HashSet}; use syntax::abi; @@ -5580,7 +5580,7 @@ pub fn predicates<'tcx>( /// Get the attributes of a definition. pub fn get_attrs<'tcx>(tcx: &'tcx ctxt, did: DefId) - -> CowVec<'tcx, ast::Attribute> { + -> Cow<'tcx, [ast::Attribute]> { if is_local(did) { let item = tcx.map.expect_item(did.node); Cow::Borrowed(&item.attrs) diff --git a/src/libstd/ffi/os_str.rs b/src/libstd/ffi/os_str.rs index fe0df1728efc0..926d8e03f2c3b 100644 --- a/src/libstd/ffi/os_str.rs +++ b/src/libstd/ffi/os_str.rs @@ -34,10 +34,10 @@ use core::prelude::*; -use borrow::{Borrow, ToOwned}; +use borrow::{Borrow, Cow, ToOwned}; use fmt::{self, Debug}; use mem; -use string::{String, CowString}; +use string::String; use ops; use cmp; use hash::{Hash, Hasher}; @@ -183,10 +183,10 @@ impl OsStr { self.inner.to_str() } - /// Convert an `OsStr` to a `CowString`. + /// Convert an `OsStr` to a `Cow`. /// /// Any non-Unicode sequences are replaced with U+FFFD REPLACEMENT CHARACTER. - pub fn to_string_lossy(&self) -> CowString { + pub fn to_string_lossy(&self) -> Cow { self.inner.to_string_lossy() } diff --git a/src/libstd/sys/common/wtf8.rs b/src/libstd/sys/common/wtf8.rs index fb9d6fef1faa7..bea2b6c6b4071 100644 --- a/src/libstd/sys/common/wtf8.rs +++ b/src/libstd/sys/common/wtf8.rs @@ -38,7 +38,7 @@ use num::Int; use ops; use slice; use str; -use string::{String, CowString}; +use string::String; use sys_common::AsInner; use unicode::str::{Utf16Item, utf16_items}; use vec::Vec; @@ -530,7 +530,7 @@ impl Wtf8 { /// Surrogates are replaced with `"\u{FFFD}"` (the replacement character “�”). /// /// This only copies the data if necessary (if it contains any surrogate). - pub fn to_string_lossy(&self) -> CowString { + pub fn to_string_lossy(&self) -> Cow { let surrogate_pos = match self.next_surrogate(0) { None => return Cow::Borrowed(unsafe { str::from_utf8_unchecked(&self.bytes) }), Some((pos, _)) => pos, @@ -844,7 +844,6 @@ mod tests { use borrow::Cow; use super::*; use mem::transmute; - use string::CowString; #[test] fn code_point_from_u32() { @@ -1224,7 +1223,7 @@ mod tests { assert_eq!(Wtf8::from_str("aé 💩").to_string_lossy(), Cow::Borrowed("aé 💩")); let mut string = Wtf8Buf::from_str("aé 💩"); string.push(CodePoint::from_u32(0xD800).unwrap()); - let expected: CowString = Cow::Owned(String::from_str("aé 💩�")); + let expected: Cow = Cow::Owned(String::from_str("aé 💩�")); assert_eq!(string.to_string_lossy(), expected); } diff --git a/src/libstd/sys/unix/os_str.rs b/src/libstd/sys/unix/os_str.rs index 023d951dc4f8a..c8ac524876b5b 100644 --- a/src/libstd/sys/unix/os_str.rs +++ b/src/libstd/sys/unix/os_str.rs @@ -13,11 +13,12 @@ use core::prelude::*; +use borrow::Cow; use fmt::{self, Debug}; use vec::Vec; use slice::SliceExt as StdSliceExt; use str; -use string::{String, CowString}; +use string::String; use mem; #[derive(Clone, Hash)] @@ -76,7 +77,7 @@ impl Slice { str::from_utf8(&self.inner).ok() } - pub fn to_string_lossy(&self) -> CowString { + pub fn to_string_lossy(&self) -> Cow { String::from_utf8_lossy(&self.inner) } diff --git a/src/libstd/sys/windows/os_str.rs b/src/libstd/sys/windows/os_str.rs index af94b56bf1f71..ad1e6c4b0e727 100644 --- a/src/libstd/sys/windows/os_str.rs +++ b/src/libstd/sys/windows/os_str.rs @@ -11,9 +11,10 @@ /// The underlying OsString/OsStr implementation on Windows is a /// wrapper around the "WTF-8" encoding; see the `wtf8` module for more. +use borrow::Cow; use fmt::{self, Debug}; use sys_common::wtf8::{Wtf8, Wtf8Buf}; -use string::{String, CowString}; +use string::String; use result::Result; use option::Option; use mem; @@ -70,7 +71,7 @@ impl Slice { self.inner.as_str() } - pub fn to_string_lossy(&self) -> CowString { + pub fn to_string_lossy(&self) -> Cow { self.inner.to_string_lossy() } diff --git a/src/libstd/thread_local/scoped.rs b/src/libstd/thread_local/scoped.rs index a2a5d8b81f404..d89d69e949716 100644 --- a/src/libstd/thread_local/scoped.rs +++ b/src/libstd/thread_local/scoped.rs @@ -119,7 +119,7 @@ macro_rules! __scoped_thread_local_inner { const _INIT: __Key<$t> = __Key { inner: ::std::thread_local::scoped::__impl::KeyInner { inner: ::std::thread_local::scoped::__impl::OS_INIT, - marker: ::std::marker::InvariantType, + marker: ::std::marker::PhantomData::<::std::cell::Cell<$t>>, } }; @@ -244,12 +244,13 @@ mod imp { target_arch = "aarch64"))] mod imp { use marker; + use std::cell::Cell; use sys_common::thread_local::StaticKey as OsStaticKey; #[doc(hidden)] pub struct KeyInner { pub inner: OsStaticKey, - pub marker: marker::InvariantType, + pub marker: marker::PhantomData>, } unsafe impl ::marker::Sync for KeyInner { } diff --git a/src/test/compile-fail/huge-array-simple.rs b/src/test/compile-fail/huge-array-simple.rs index 1e04e685e41b8..105f885f2875f 100644 --- a/src/test/compile-fail/huge-array-simple.rs +++ b/src/test/compile-fail/huge-array-simple.rs @@ -9,6 +9,7 @@ // except according to those terms. // error-pattern: too big for the current +#![allow(exceeding_bitshifts)] fn main() { let fat : [u8; (1<<61)+(1<<31)] = [0; (1u64<<61) as usize +(1u64<<31) as usize]; From c195783c05d253c8e32fb781cce1ae978f8bd6bd Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Mon, 2 Mar 2015 21:46:31 +1100 Subject: [PATCH 11/16] Feature gate `#[static_assert]`. The API this exposes is a little strange (being attached to `static`s), so it makes sense to conservatively feature gate it. If it is highly popular, it is possible to reverse this gating. --- src/doc/reference.md | 6 ++++++ src/libsyntax/feature_gate.rs | 7 +++++-- src/test/compile-fail/asm-misplaced-option.rs | 9 +++------ .../compile-fail/feature-gate-static-assert.rs | 14 ++++++++++++++ src/test/compile-fail/issue-6804.rs | 8 +++----- src/test/compile-fail/nonbool_static_assert.rs | 1 + src/test/compile-fail/static-assert.rs | 1 + src/test/compile-fail/static-assert2.rs | 1 + src/test/run-pass/static-assert.rs | 2 ++ 9 files changed, 36 insertions(+), 13 deletions(-) create mode 100644 src/test/compile-fail/feature-gate-static-assert.rs diff --git a/src/doc/reference.md b/src/doc/reference.md index 2f047d2c173f8..333d6fddbbdf2 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -2495,6 +2495,12 @@ The currently implemented features of the reference compiler are: * `staged_api` - Allows usage of stability markers and `#![staged_api]` in a crate +* `static_assert` - The `#[static_assert]` functionality is experimental and + unstable. The attribute can be attached to a `static` of + type `bool` and the compiler will error if the `bool` is + `false` at compile time. This version of this functionality + is unintuitive and suboptimal. + * `start` - Allows use of the `#[start]` attribute, which changes the entry point into a Rust program. This capabiilty, especially the signature for the annotated function, is subject to change. diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index ffc136d5a1d1a..48c81280285ea 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -139,6 +139,9 @@ static KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ // Allows the use of rustc_* attributes; RFC 572 ("rustc_attrs", "1.0.0", Active), + + // Allows the use of `static_assert` + ("static_assert", "1.0.0", Active), ]; // (changing above list without updating src/doc/reference.md makes @cmr sad) @@ -241,7 +244,8 @@ pub static KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[ ("no_split_stack", Whitelisted), ("no_stack_check", Whitelisted), ("packed", Whitelisted), - ("static_assert", Whitelisted), + ("static_assert", Gated("static_assert", + "`#[static_assert]` is an experimental feature, and has a poor API")), ("no_debug", Whitelisted), ("omit_gdb_pretty_printer_section", Whitelisted), ("unsafe_no_drop_flag", Gated("unsafe_no_drop_flag", @@ -769,4 +773,3 @@ pub fn check_crate(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::Crate) |ctx, krate| visit::walk_crate(&mut PostExpansionVisitor { context: ctx }, krate)) } - diff --git a/src/test/compile-fail/asm-misplaced-option.rs b/src/test/compile-fail/asm-misplaced-option.rs index 02d06c4e1bf80..43a0ad6b5f6bf 100644 --- a/src/test/compile-fail/asm-misplaced-option.rs +++ b/src/test/compile-fail/asm-misplaced-option.rs @@ -10,13 +10,14 @@ // ignore-android -#![feature(asm)] +#![feature(asm, rustc_attrs)] #![allow(dead_code, non_upper_case_globals)] #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] -pub fn main() { +#[rustc_error] +pub fn main() { //~ ERROR compilation successful // assignment not dead let mut x: isize = 0; unsafe { @@ -33,7 +34,3 @@ pub fn main() { } assert_eq!(x, 13); } - -// At least one error is needed so that compilation fails -#[static_assert] -static b: bool = false; //~ ERROR static assertion failed diff --git a/src/test/compile-fail/feature-gate-static-assert.rs b/src/test/compile-fail/feature-gate-static-assert.rs new file mode 100644 index 0000000000000..25740397d7a1e --- /dev/null +++ b/src/test/compile-fail/feature-gate-static-assert.rs @@ -0,0 +1,14 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +#[static_assert] //~ ERROR `#[static_assert]` is an experimental feature +static X: bool = true; + +fn main() {} diff --git a/src/test/compile-fail/issue-6804.rs b/src/test/compile-fail/issue-6804.rs index 30d3ab17a463e..08c5cae9f5f79 100644 --- a/src/test/compile-fail/issue-6804.rs +++ b/src/test/compile-fail/issue-6804.rs @@ -8,13 +8,15 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(rustc_attrs)] #![allow(dead_code)] // Matching against NaN should result in a warning use std::f64::NAN; -fn main() { +#[rustc_error] +fn main() { //~ ERROR compilation successful let x = NAN; match x { NAN => {}, @@ -27,7 +29,3 @@ fn main() { }; //~^^^ WARNING unmatchable NaN in pattern, use the is_nan method in a guard instead } - -// At least one error is needed so that compilation fails -#[static_assert] -static B: bool = false; //~ ERROR static assertion failed diff --git a/src/test/compile-fail/nonbool_static_assert.rs b/src/test/compile-fail/nonbool_static_assert.rs index d85f58edc90d4..7a7912b06f887 100644 --- a/src/test/compile-fail/nonbool_static_assert.rs +++ b/src/test/compile-fail/nonbool_static_assert.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(static_assert)] #![allow(dead_code)] #[static_assert] diff --git a/src/test/compile-fail/static-assert.rs b/src/test/compile-fail/static-assert.rs index 349e5f4cb5105..d0cfbfbbcccc2 100644 --- a/src/test/compile-fail/static-assert.rs +++ b/src/test/compile-fail/static-assert.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(static_assert)] #![allow(dead_code)] #[static_assert] diff --git a/src/test/compile-fail/static-assert2.rs b/src/test/compile-fail/static-assert2.rs index d5e70205e9536..35f840dab0c0c 100644 --- a/src/test/compile-fail/static-assert2.rs +++ b/src/test/compile-fail/static-assert2.rs @@ -8,6 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(static_assert)] #![allow(dead_code)] #[static_assert] diff --git a/src/test/run-pass/static-assert.rs b/src/test/run-pass/static-assert.rs index f8fd81b936515..f650e56bb6b77 100644 --- a/src/test/run-pass/static-assert.rs +++ b/src/test/run-pass/static-assert.rs @@ -8,6 +8,8 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#![feature(static_assert)] + #[static_assert] static b: bool = true; From 1d647a0eec0315f95f982af68d0dc75d9e6a9e0c Mon Sep 17 00:00:00 2001 From: David Creswick Date: Mon, 2 Mar 2015 22:06:51 -0600 Subject: [PATCH 12/16] Slice::swap should be inlineable --- src/libcore/slice.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcore/slice.rs b/src/libcore/slice.rs index 5b78da34eddde..89957f07af6a6 100644 --- a/src/libcore/slice.rs +++ b/src/libcore/slice.rs @@ -351,6 +351,7 @@ impl SliceExt for [T] { ChunksMut { v: self, chunk_size: chunk_size } } + #[inline] fn swap(&mut self, a: usize, b: usize) { unsafe { // Can't take two mutable loans from one vector, so instead just cast From bc98e9fbc239d335c33fc1751125f1212c47f8ef Mon Sep 17 00:00:00 2001 From: Lai Jiangshan Date: Mon, 2 Mar 2015 18:01:01 +0800 Subject: [PATCH 13/16] str: fix comments for FromStr for bool Fix the return type in the comments. An old commit 082bfde41217 ("Fallout of std::str stabilization") removed the example of FromStr::from_str(), this commit adds it back. But the example of StrExt::parse() is still kept with an additinal note. Signed-off-by: Lai Jiangshan --- src/libcore/str/mod.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index b354116993c23..21c6c846576be 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -134,12 +134,23 @@ impl FromStr for bool { /// Parse a `bool` from a string. /// - /// Yields an `Option`, because `s` may or may not actually be - /// parseable. + /// Yields a `Result`, because `s` may or may not + /// actually be parseable. /// /// # Examples /// /// ```rust + /// use std::str::FromStr; + /// + /// assert_eq!(FromStr::from_str("true"), Ok(true)); + /// assert_eq!(FromStr::from_str("false"), Ok(false)); + /// assert!(::from_str("not even a boolean").is_err()); + /// ``` + /// + /// Note, in many cases, the StrExt::parse() which is based on + /// this FromStr::from_str() is more proper. + /// + /// ```rust /// assert_eq!("true".parse(), Ok(true)); /// assert_eq!("false".parse(), Ok(false)); /// assert!("not even a boolean".parse::().is_err()); From ac84af24dbdb2b18c548e772ba7427bb7e91f9ed Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Mon, 2 Mar 2015 23:26:14 -0500 Subject: [PATCH 14/16] privacy: walk associated types in trait impls --- src/librustc_privacy/lib.rs | 13 ++++++++- src/test/compile-fail/issue-22912.rs | 41 ++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 src/test/compile-fail/issue-22912.rs diff --git a/src/librustc_privacy/lib.rs b/src/librustc_privacy/lib.rs index 46729988bb6bd..ab3b56c31b62a 100644 --- a/src/librustc_privacy/lib.rs +++ b/src/librustc_privacy/lib.rs @@ -1376,10 +1376,11 @@ impl<'a, 'tcx, 'v> Visitor<'v> for VisiblePrivateTypesVisitor<'a, 'tcx> { } } Some(ref tr) => { - // Any private types in a trait impl fall into two + // Any private types in a trait impl fall into three // categories. // 1. mentioned in the trait definition // 2. mentioned in the type params/generics + // 3. mentioned in the associated types of the impl // // Those in 1. can only occur if the trait is in // this crate and will've been warned about on the @@ -1389,6 +1390,16 @@ impl<'a, 'tcx, 'v> Visitor<'v> for VisiblePrivateTypesVisitor<'a, 'tcx> { // Those in 2. are warned via walk_generics and this // call here. visit::walk_path(self, &tr.path); + + // Those in 3. are warned with this call. + for impl_item in impl_items { + match *impl_item { + ast::MethodImplItem(..) => {}, + ast::TypeImplItem(ref typedef) => { + self.visit_ty(&typedef.typ); + } + } + } } } } else if trait_ref.is_none() && self_is_public_path { diff --git a/src/test/compile-fail/issue-22912.rs b/src/test/compile-fail/issue-22912.rs new file mode 100644 index 0000000000000..f4536ceb8ed69 --- /dev/null +++ b/src/test/compile-fail/issue-22912.rs @@ -0,0 +1,41 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub struct PublicType; +struct PrivateType; + +pub trait PublicTrait { + type Item; +} + +trait PrivateTrait { + type Item; +} + +impl PublicTrait for PublicType { + type Item = PrivateType; //~ ERROR private type in exported type signature +} + +// OK +impl PublicTrait for PrivateType { + type Item = PrivateType; +} + +// OK +impl PrivateTrait for PublicType { + type Item = PrivateType; +} + +// OK +impl PrivateTrait for PrivateType { + type Item = PrivateType; +} + +fn main() {} From 89776aee49a8d896521c62eb6e33b88b9122880c Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 3 Mar 2015 00:25:14 -0500 Subject: [PATCH 15/16] fix fallout --- src/test/run-pass/associated-types-binding-in-where-clause.rs | 2 +- src/test/run-pass/associated-types-eq-obj.rs | 2 +- src/test/run-pass/associated-types-return.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/run-pass/associated-types-binding-in-where-clause.rs b/src/test/run-pass/associated-types-binding-in-where-clause.rs index 2f9a0b328b5d4..c6c66f1c75c54 100644 --- a/src/test/run-pass/associated-types-binding-in-where-clause.rs +++ b/src/test/run-pass/associated-types-binding-in-where-clause.rs @@ -16,7 +16,7 @@ pub trait Foo { } #[derive(PartialEq)] -struct Bar; +pub struct Bar; impl Foo for int { type A = uint; diff --git a/src/test/run-pass/associated-types-eq-obj.rs b/src/test/run-pass/associated-types-eq-obj.rs index 0ec8a3661906f..901b3c0d96b01 100644 --- a/src/test/run-pass/associated-types-eq-obj.rs +++ b/src/test/run-pass/associated-types-eq-obj.rs @@ -15,7 +15,7 @@ pub trait Foo { fn boo(&self) -> ::A; } -struct Bar; +pub struct Bar; impl Foo for char { type A = Bar; diff --git a/src/test/run-pass/associated-types-return.rs b/src/test/run-pass/associated-types-return.rs index fe24ab6bbeb1b..8ae550be3fc66 100644 --- a/src/test/run-pass/associated-types-return.rs +++ b/src/test/run-pass/associated-types-return.rs @@ -16,7 +16,7 @@ pub trait Foo { } #[derive(PartialEq)] -struct Bar; +pub struct Bar; impl Foo for int { type A = uint; From d18897cadfe243591bac2c606d63ce37449d5257 Mon Sep 17 00:00:00 2001 From: Tobias Bucher Date: Mon, 2 Mar 2015 23:56:13 +0100 Subject: [PATCH 16/16] Revert incorrect `usize` -> `u32` replacements from #22510 Conflicts: src/libstd/thread.rs --- src/libstd/thread.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs index 0f0bca5e8b2a0..e83308209062c 100644 --- a/src/libstd/thread.rs +++ b/src/libstd/thread.rs @@ -277,7 +277,7 @@ impl Builder { // address at which our stack started). let main = move || { let something_around_the_top_of_the_stack = 1; - let addr = &something_around_the_top_of_the_stack as *const isize; + let addr = &something_around_the_top_of_the_stack as *const i32; let my_stack_top = addr as usize; let my_stack_bottom = my_stack_top - stack_size + 1024; unsafe { @@ -802,13 +802,13 @@ mod test { } fn avoid_copying_the_body(spawnfn: F) where F: FnOnce(Thunk<'static>) { - let (tx, rx) = channel::(); + let (tx, rx) = channel(); let x = box 1; - let x_in_parent = (&*x) as *const isize as u32; + let x_in_parent = (&*x) as *const i32 as usize; spawnfn(Thunk::new(move|| { - let x_in_child = (&*x) as *const isize as u32; + let x_in_child = (&*x) as *const i32 as usize; tx.send(x_in_child).unwrap(); })); @@ -847,8 +847,8 @@ mod test { // climbing the task tree to dereference each ancestor. (See #1789) // (well, it would if the constant were 8000+ - I lowered it to be more // valgrind-friendly. try this at home, instead..!) - const GENERATIONS: usize = 16; - fn child_no(x: usize) -> Thunk<'static> { + const GENERATIONS: u32 = 16; + fn child_no(x: u32) -> Thunk<'static> { return Thunk::new(move|| { if x < GENERATIONS { thread::spawn(move|| child_no(x+1).invoke(()));