Skip to content

Commit 52edb2e

Browse files
committed
Register new snapshots
1 parent b25e100 commit 52edb2e

File tree

34 files changed

+8002
-7220
lines changed

34 files changed

+8002
-7220
lines changed

src/etc/unicode.py

+13-14
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,7 @@ def load_east_asian_width(want_widths, except_cats):
283283
return widths
284284

285285
def escape_char(c):
286-
if c <= 0x7f:
287-
return "'\\x%2.2x'" % c
288-
if c <= 0xffff:
289-
return "'\\u%4.4x'" % c
290-
return "'\\U%8.8x'" % c
286+
return "'\\u{%x}'" % c
291287

292288
def emit_bsearch_range_table(f):
293289
f.write("""
@@ -377,8 +373,8 @@ def emit_conversions_module(f, lowerupper, upperlower):
377373
else if key < c { Less }
378374
else { Greater }
379375
}) {
380-
slice::Found(i) => Some(i),
381-
slice::NotFound(_) => None,
376+
slice::BinarySearchResult::Found(i) => Some(i),
377+
slice::BinarySearchResult::NotFound(_) => None,
382378
}
383379
}
384380
@@ -392,6 +388,7 @@ def emit_conversions_module(f, lowerupper, upperlower):
392388
def emit_grapheme_module(f, grapheme_table, grapheme_cats):
393389
f.write("""pub mod grapheme {
394390
use core::slice::SlicePrelude;
391+
use core::kinds::Copy;
395392
pub use self::GraphemeCat::*;
396393
use core::slice;
397394
@@ -403,18 +400,20 @@ def emit_grapheme_module(f, grapheme_table, grapheme_cats):
403400
f.write(" GC_" + cat + ",\n")
404401
f.write(""" }
405402
403+
impl Copy for GraphemeCat {}
404+
406405
fn bsearch_range_value_table(c: char, r: &'static [(char, char, GraphemeCat)]) -> GraphemeCat {
407406
use core::cmp::Ordering::{Equal, Less, Greater};
408407
match r.binary_search(|&(lo, hi, _)| {
409408
if lo <= c && c <= hi { Equal }
410409
else if hi < c { Less }
411410
else { Greater }
412411
}) {
413-
slice::Found(idx) => {
412+
slice::BinarySearchResult::Found(idx) => {
414413
let (_, _, cat) = r[idx];
415414
cat
416415
}
417-
slice::NotFound(_) => GC_Any
416+
slice::BinarySearchResult::NotFound(_) => GC_Any
418417
}
419418
}
420419
@@ -443,11 +442,11 @@ def emit_charwidth_module(f, width_table):
443442
else if hi < c { Less }
444443
else { Greater }
445444
}) {
446-
slice::Found(idx) => {
445+
slice::BinarySearchResult::Found(idx) => {
447446
let (_, _, r_ncjk, r_cjk) = r[idx];
448447
if is_cjk { r_cjk } else { r_ncjk }
449448
}
450-
slice::NotFound(_) => 1
449+
slice::BinarySearchResult::NotFound(_) => 1
451450
}
452451
}
453452
""")
@@ -540,11 +539,11 @@ def comp_pfun(char):
540539
else if hi < c { Less }
541540
else { Greater }
542541
}) {
543-
slice::Found(idx) => {
542+
slice::BinarySearchResult::Found(idx) => {
544543
let (_, _, result) = r[idx];
545544
result
546545
}
547-
slice::NotFound(_) => 0
546+
slice::BinarySearchResult::NotFound(_) => 0
548547
}
549548
}\n
550549
""")
@@ -613,7 +612,7 @@ def optimize_width_table(wtable):
613612
unicode_version = re.search(pattern, readme.read()).groups()
614613
rf.write("""
615614
/// The version of [Unicode](http://www.unicode.org/)
616-
/// that the `UnicodeChar` and `UnicodeStrSlice` traits are based on.
615+
/// that the `UnicodeChar` and `UnicodeStrPrelude` traits are based on.
617616
pub const UNICODE_VERSION: (uint, uint, uint) = (%s, %s, %s);
618617
""" % unicode_version)
619618
(canon_decomp, compat_decomp, gencats, combines,

src/libcollections/str.rs

+414-291
Large diffs are not rendered by default.

src/libcollections/string.rs

+18-17
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl String {
118118
/// ```rust
119119
/// let input = b"Hello \xF0\x90\x80World";
120120
/// let output = String::from_utf8_lossy(input);
121-
/// assert_eq!(output.as_slice(), "Hello \uFFFDWorld");
121+
/// assert_eq!(output.as_slice(), "Hello \u{FFFD}World");
122122
/// ```
123123
#[unstable = "return type may change"]
124124
pub fn from_utf8_lossy<'a>(v: &'a [u8]) -> CowString<'a> {
@@ -275,7 +275,7 @@ impl String {
275275
/// 0xD834];
276276
///
277277
/// assert_eq!(String::from_utf16_lossy(v),
278-
/// "𝄞mus\uFFFDic\uFFFD".to_string());
278+
/// "𝄞mus\u{FFFD}ic\u{FFFD}".to_string());
279279
/// ```
280280
#[stable]
281281
pub fn from_utf16_lossy(v: &[u16]) -> String {
@@ -1043,32 +1043,32 @@ mod tests {
10431043

10441044
let xs = b"Hello\xC2 There\xFF Goodbye";
10451045
assert_eq!(String::from_utf8_lossy(xs),
1046-
String::from_str("Hello\uFFFD There\uFFFD Goodbye").into_cow());
1046+
String::from_str("Hello\u{FFFD} There\u{FFFD} Goodbye").into_cow());
10471047

10481048
let xs = b"Hello\xC0\x80 There\xE6\x83 Goodbye";
10491049
assert_eq!(String::from_utf8_lossy(xs),
1050-
String::from_str("Hello\uFFFD\uFFFD There\uFFFD Goodbye").into_cow());
1050+
String::from_str("Hello\u{FFFD}\u{FFFD} There\u{FFFD} Goodbye").into_cow());
10511051

10521052
let xs = b"\xF5foo\xF5\x80bar";
10531053
assert_eq!(String::from_utf8_lossy(xs),
1054-
String::from_str("\uFFFDfoo\uFFFD\uFFFDbar").into_cow());
1054+
String::from_str("\u{FFFD}foo\u{FFFD}\u{FFFD}bar").into_cow());
10551055

10561056
let xs = b"\xF1foo\xF1\x80bar\xF1\x80\x80baz";
10571057
assert_eq!(String::from_utf8_lossy(xs),
1058-
String::from_str("\uFFFDfoo\uFFFDbar\uFFFDbaz").into_cow());
1058+
String::from_str("\u{FFFD}foo\u{FFFD}bar\u{FFFD}baz").into_cow());
10591059

10601060
let xs = b"\xF4foo\xF4\x80bar\xF4\xBFbaz";
10611061
assert_eq!(String::from_utf8_lossy(xs),
1062-
String::from_str("\uFFFDfoo\uFFFDbar\uFFFD\uFFFDbaz").into_cow());
1062+
String::from_str("\u{FFFD}foo\u{FFFD}bar\u{FFFD}\u{FFFD}baz").into_cow());
10631063

10641064
let xs = b"\xF0\x80\x80\x80foo\xF0\x90\x80\x80bar";
1065-
assert_eq!(String::from_utf8_lossy(xs), String::from_str("\uFFFD\uFFFD\uFFFD\uFFFD\
1066-
foo\U00010000bar").into_cow());
1065+
assert_eq!(String::from_utf8_lossy(xs), String::from_str("\u{FFFD}\u{FFFD}\u{FFFD}\u{FFFD}\
1066+
foo\u{10000}bar").into_cow());
10671067

10681068
// surrogates
10691069
let xs = b"\xED\xA0\x80foo\xED\xBF\xBFbar";
1070-
assert_eq!(String::from_utf8_lossy(xs), String::from_str("\uFFFD\uFFFD\uFFFDfoo\
1071-
\uFFFD\uFFFD\uFFFDbar").into_cow());
1070+
assert_eq!(String::from_utf8_lossy(xs), String::from_str("\u{FFFD}\u{FFFD}\u{FFFD}foo\
1071+
\u{FFFD}\u{FFFD}\u{FFFD}bar").into_cow());
10721072
}
10731073

10741074
#[test]
@@ -1110,7 +1110,7 @@ mod tests {
11101110
0xd801_u16, 0xdc95_u16, 0xd801_u16, 0xdc86_u16,
11111111
0x000a_u16 ]),
11121112
// Issue #12318, even-numbered non-BMP planes
1113-
(String::from_str("\U00020000"),
1113+
(String::from_str("\u{20000}"),
11141114
vec![0xD840, 0xDC00])];
11151115

11161116
for p in pairs.iter() {
@@ -1148,16 +1148,17 @@ mod tests {
11481148
fn test_from_utf16_lossy() {
11491149
// completely positive cases tested above.
11501150
// lead + eof
1151-
assert_eq!(String::from_utf16_lossy(&[0xD800]), String::from_str("\uFFFD"));
1151+
assert_eq!(String::from_utf16_lossy(&[0xD800]), String::from_str("\u{FFFD}"));
11521152
// lead + lead
1153-
assert_eq!(String::from_utf16_lossy(&[0xD800, 0xD800]), String::from_str("\uFFFD\uFFFD"));
1153+
assert_eq!(String::from_utf16_lossy(&[0xD800, 0xD800]),
1154+
String::from_str("\u{FFFD}\u{FFFD}"));
11541155

11551156
// isolated trail
1156-
assert_eq!(String::from_utf16_lossy(&[0x0061, 0xDC00]), String::from_str("a\uFFFD"));
1157+
assert_eq!(String::from_utf16_lossy(&[0x0061, 0xDC00]), String::from_str("a\u{FFFD}"));
11571158

11581159
// general
11591160
assert_eq!(String::from_utf16_lossy(&[0xD800, 0xd801, 0xdc8b, 0xD800]),
1160-
String::from_str("\uFFFD𐒋\uFFFD"));
1161+
String::from_str("\u{FFFD}𐒋\u{FFFD}"));
11611162
}
11621163

11631164
#[test]
@@ -1249,7 +1250,7 @@ mod tests {
12491250
#[test]
12501251
#[should_fail]
12511252
fn test_str_truncate_split_codepoint() {
1252-
let mut s = String::from_str("\u00FC"); // ü
1253+
let mut s = String::from_str("\u{FC}"); // ü
12531254
s.truncate(1);
12541255
}
12551256

src/libcore/char.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static MAX_THREE_B: u32 = 0x10000u32;
6565

6666
/// The highest valid code point
6767
#[stable]
68-
pub const MAX: char = '\U0010ffff';
68+
pub const MAX: char = '\u{10ffff}';
6969

7070
/// Converts from `u32` to a `char`
7171
#[inline]
@@ -161,8 +161,8 @@ pub fn from_digit(num: uint, radix: uint) -> Option<char> {
161161
/// The rules are as follows:
162162
///
163163
/// - chars in [0,0xff] get 2-digit escapes: `\\xNN`
164-
/// - chars in [0x100,0xffff] get 4-digit escapes: `\\uNNNN`
165-
/// - chars above 0x10000 get 8-digit escapes: `\\UNNNNNNNN`
164+
/// - chars in [0x100,0xffff] get 4-digit escapes: `\\u{NNNN}`
165+
/// - chars above 0x10000 get 8-digit escapes: `\\u{{NNN}NNNNN}`
166166
///
167167
#[deprecated = "use the Char::escape_unicode method"]
168168
pub fn escape_unicode(c: char, f: |char|) {
@@ -269,8 +269,8 @@ pub trait Char {
269269
/// The rules are as follows:
270270
///
271271
/// * Characters in [0,0xff] get 2-digit escapes: `\\xNN`
272-
/// * Characters in [0x100,0xffff] get 4-digit escapes: `\\uNNNN`.
273-
/// * Characters above 0x10000 get 8-digit escapes: `\\UNNNNNNNN`.
272+
/// * Characters in [0x100,0xffff] get 4-digit escapes: `\\u{NNNN}`.
273+
/// * Characters above 0x10000 get 8-digit escapes: `\\u{{NNN}NNNNN}`.
274274
#[unstable = "pending error conventions, trait organization"]
275275
fn escape_unicode(self) -> UnicodeEscapedChars;
276276

@@ -470,7 +470,7 @@ impl Iterator<char> for UnicodeEscapedChars {
470470
}
471471
UnicodeEscapedCharsState::Type => {
472472
let (typechar, pad) = if self.c <= '\x7f' { ('x', 2) }
473-
else if self.c <= '\uffff' { ('u', 4) }
473+
else if self.c <= '\u{ffff}' { ('u', 4) }
474474
else { ('U', 8) };
475475
self.state = UnicodeEscapedCharsState::Value(range_step(4 * (pad - 1), -1, -4i32));
476476
Some(typechar)

src/libcore/ops.rs

-50
Original file line numberDiff line numberDiff line change
@@ -864,53 +864,3 @@ impl<F,A,R> FnOnce<A,R> for F
864864
self.call_mut(args)
865865
}
866866
}
867-
868-
#[cfg(stage0)]
869-
mod fn_impls {
870-
use super::Fn;
871-
872-
impl<Result> Fn<(),Result> for extern "Rust" fn() -> Result {
873-
#[allow(non_snake_case)]
874-
extern "rust-call" fn call(&self, _args: ()) -> Result {
875-
(*self)()
876-
}
877-
}
878-
879-
impl<Result,A0> Fn<(A0,),Result> for extern "Rust" fn(A0) -> Result {
880-
#[allow(non_snake_case)]
881-
extern "rust-call" fn call(&self, args: (A0,)) -> Result {
882-
let (a0,) = args;
883-
(*self)(a0)
884-
}
885-
}
886-
887-
macro_rules! def_fn(
888-
($($args:ident)*) => (
889-
impl<Result$(,$args)*>
890-
Fn<($($args,)*),Result>
891-
for extern "Rust" fn($($args: $args,)*) -> Result {
892-
#[allow(non_snake_case)]
893-
extern "rust-call" fn call(&self, args: ($($args,)*)) -> Result {
894-
let ($($args,)*) = args;
895-
(*self)($($args,)*)
896-
}
897-
}
898-
)
899-
)
900-
901-
def_fn!(A0 A1)
902-
def_fn!(A0 A1 A2)
903-
def_fn!(A0 A1 A2 A3)
904-
def_fn!(A0 A1 A2 A3 A4)
905-
def_fn!(A0 A1 A2 A3 A4 A5)
906-
def_fn!(A0 A1 A2 A3 A4 A5 A6)
907-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7)
908-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8)
909-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9)
910-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10)
911-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11)
912-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12)
913-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13)
914-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14)
915-
def_fn!(A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14 A15)
916-
}

src/libcore/option.rs

-3
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@
143143
144144
#![stable]
145145

146-
#[cfg(stage0)]
147-
pub use self::Option::*;
148-
#[cfg(not(stage0))]
149146
use self::Option::*;
150147

151148
use cmp::{Eq, Ord};

src/libcore/result.rs

-1
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,5 @@ pub fn fold<T,
918918
Ok(init)
919919
}
920920

921-
#[cfg(not(stage0))]
922921
impl<T:Copy,U:Copy> Copy for Result<T,U> {}
923922

src/libcore/str.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -914,13 +914,13 @@ fn run_utf8_validation_iterator(iter: &mut slice::Items<u8>) -> bool {
914914
if first >= 128 {
915915
let w = utf8_char_width(first);
916916
let second = next!();
917-
// 2-byte encoding is for codepoints \u0080 to \u07ff
917+
// 2-byte encoding is for codepoints \u{0080} to \u{07ff}
918918
// first C2 80 last DF BF
919-
// 3-byte encoding is for codepoints \u0800 to \uffff
919+
// 3-byte encoding is for codepoints \u{0800} to \u{ffff}
920920
// first E0 A0 80 last EF BF BF
921-
// excluding surrogates codepoints \ud800 to \udfff
921+
// excluding surrogates codepoints \u{d800} to \u{dfff}
922922
// ED A0 80 to ED BF BF
923-
// 4-byte encoding is for codepoints \u10000 to \u10ffff
923+
// 4-byte encoding is for codepoints \u{1000}0 to \u{10ff}ff
924924
// first F0 90 80 80 last F4 8F BF BF
925925
//
926926
// Use the UTF-8 syntax from the RFC
@@ -1007,7 +1007,7 @@ impl Utf16Item {
10071007
pub fn to_char_lossy(&self) -> char {
10081008
match *self {
10091009
ScalarValue(c) => c,
1010-
LoneSurrogate(_) => '\uFFFD'
1010+
LoneSurrogate(_) => '\u{FFFD}'
10111011
}
10121012
}
10131013
}
@@ -1523,7 +1523,7 @@ pub trait StrPrelude for Sized? {
15231523
/// // composed forms of `ö` and `é`
15241524
/// let c = "Löwe 老虎 Léopard"; // German, Simplified Chinese, French
15251525
/// // decomposed forms of `ö` and `é`
1526-
/// let d = "Lo\u0308we 老虎 Le\u0301opard";
1526+
/// let d = "Lo\u{0308}we 老虎 Le\u{0301}opard";
15271527
///
15281528
/// assert_eq!(c.char_len(), 15);
15291529
/// assert_eq!(d.char_len(), 17);

src/libgetopts/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1569,10 +1569,10 @@ Options:
15691569
#[test]
15701570
fn test_usage_description_multibyte_handling() {
15711571
let optgroups = vec!(
1572-
optflag("k", "k\u2013w\u2013",
1572+
optflag("k", "k\u{2013}w\u{2013}",
15731573
"The word kiwi is normally spelled with two i's"),
15741574
optflag("a", "apple",
1575-
"This \u201Cdescription\u201D has some characters that could \
1575+
"This \u{201C}description\u{201D} has some characters that could \
15761576
confuse the line wrapping; an apple costs 0.51€ in some parts of Europe."));
15771577

15781578
let expected =

src/librustc/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2323
html_root_url = "http://doc.rust-lang.org/nightly/")]
2424

25-
#![feature(default_type_params, globs, if_let, import_shadowing, macro_rules, phase, quote)]
26-
#![feature(slicing_syntax, tuple_indexing, unsafe_destructor)]
25+
#![feature(default_type_params, globs, import_shadowing, macro_rules, phase, quote)]
26+
#![feature(slicing_syntax, unsafe_destructor)]
2727
#![feature(rustc_diagnostic_macros)]
2828

2929
extern crate arena;

src/librustc_driver/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2323
html_root_url = "http://doc.rust-lang.org/nightly/")]
2424

25-
#![feature(default_type_params, globs, if_let, import_shadowing, macro_rules, phase, quote)]
25+
#![feature(default_type_params, globs, import_shadowing, macro_rules, phase, quote)]
2626
#![feature(slicing_syntax, unsafe_destructor)]
2727
#![feature(rustc_diagnostic_macros)]
2828

src/librustc_trans/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
2323
html_root_url = "http://doc.rust-lang.org/nightly/")]
2424

25-
#![feature(default_type_params, globs, if_let, import_shadowing, macro_rules, phase, quote)]
25+
#![feature(default_type_params, globs, import_shadowing, macro_rules, phase, quote)]
2626
#![feature(slicing_syntax, unsafe_destructor)]
2727
#![feature(rustc_diagnostic_macros)]
2828

src/librustc_typeck/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ This API is completely unstable and subject to change.
7171
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
7272
html_root_url = "http://doc.rust-lang.org/nightly/")]
7373

74-
#![feature(default_type_params, globs, if_let, import_shadowing, macro_rules, phase, quote)]
75-
#![feature(slicing_syntax, tuple_indexing, unsafe_destructor)]
74+
#![feature(default_type_params, globs, import_shadowing, macro_rules, phase, quote)]
75+
#![feature(slicing_syntax, unsafe_destructor)]
7676
#![feature(rustc_diagnostic_macros)]
7777
#![allow(non_camel_case_types)]
7878

0 commit comments

Comments
 (0)