Skip to content

Commit 5679e78

Browse files
author
blake2-ppc
committed
---
yaml --- r: 83958 b: refs/heads/dist-snap c: 5a37cf8 h: refs/heads/master v: v3
1 parent 0dd0c8a commit 5679e78

File tree

4 files changed

+25
-5
lines changed

4 files changed

+25
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: 0983ebe5310d4eb6d289f636f7ed0536c08bbc0e
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: 51eb1e14d4285f157e9820f5ee61bc150cf554ad
9+
refs/heads/dist-snap: 5a37cf8a31c4d4eeb1805eb3e90894b8e67d16c8
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libextra/deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ impl<T> Deque<T> {
107107
if self.lo == 0u {
108108
self.lo = self.elts.len() - 1u;
109109
} else { self.lo -= 1u; }
110-
if self.lo == self.hi {
110+
if self.nelts == self.elts.len() {
111111
self.elts = grow(self.nelts, oldlo, self.elts);
112112
self.lo = self.elts.len() - 1u;
113113
self.hi = self.nelts;

branches/dist-snap/src/libextra/json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,7 @@ mod tests {
17231723
assert_eq!(v, 0.4e-01f);
17241724
}
17251725
1726-
// FIXME: #7611: xfailed for now
1726+
#[test]
17271727
fn test_read_str() {
17281728
assert_eq!(from_str("\""),
17291729
Err(Error {line: 1u, col: 2u, msg: @~"EOF while parsing string"

branches/dist-snap/src/libstd/str.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,10 @@ static MAX_TWO_B: uint = 2048u;
751751
static TAG_THREE_B: uint = 224u;
752752
static MAX_THREE_B: uint = 65536u;
753753
static TAG_FOUR_B: uint = 240u;
754+
static MAX_FOUR_B: uint = 2097152u;
755+
static TAG_FIVE_B: uint = 248u;
756+
static MAX_FIVE_B: uint = 67108864u;
757+
static TAG_SIX_B: uint = 252u;
754758

755759
/**
756760
* A dummy trait to hold all the utility methods that we implement on strings.
@@ -2066,13 +2070,14 @@ impl OwnedStr for ~str {
20662070
/// Appends a character to the back of a string
20672071
#[inline]
20682072
fn push_char(&mut self, c: char) {
2069-
assert!(c as uint <= 0x10ffff); // FIXME: #7609: should be enforced on all `char`
20702073
unsafe {
20712074
let code = c as uint;
20722075
let nb = if code < MAX_ONE_B { 1u }
20732076
else if code < MAX_TWO_B { 2u }
20742077
else if code < MAX_THREE_B { 3u }
2075-
else { 4u };
2078+
else if code < MAX_FOUR_B { 4u }
2079+
else if code < MAX_FIVE_B { 5u }
2080+
else { 6u };
20762081
let len = self.len();
20772082
let new_len = len + nb;
20782083
self.reserve_at_least(new_len);
@@ -2098,6 +2103,21 @@ impl OwnedStr for ~str {
20982103
*ptr::mut_offset(buf, off + 2u) = (code >> 6u & 63u | TAG_CONT) as u8;
20992104
*ptr::mut_offset(buf, off + 3u) = (code & 63u | TAG_CONT) as u8;
21002105
}
2106+
5u => {
2107+
*ptr::mut_offset(buf, off) = (code >> 24u & 3u | TAG_FIVE_B) as u8;
2108+
*ptr::mut_offset(buf, off + 1u) = (code >> 18u & 63u | TAG_CONT) as u8;
2109+
*ptr::mut_offset(buf, off + 2u) = (code >> 12u & 63u | TAG_CONT) as u8;
2110+
*ptr::mut_offset(buf, off + 3u) = (code >> 6u & 63u | TAG_CONT) as u8;
2111+
*ptr::mut_offset(buf, off + 4u) = (code & 63u | TAG_CONT) as u8;
2112+
}
2113+
6u => {
2114+
*ptr::mut_offset(buf, off) = (code >> 30u & 1u | TAG_SIX_B) as u8;
2115+
*ptr::mut_offset(buf, off + 1u) = (code >> 24u & 63u | TAG_CONT) as u8;
2116+
*ptr::mut_offset(buf, off + 2u) = (code >> 18u & 63u | TAG_CONT) as u8;
2117+
*ptr::mut_offset(buf, off + 3u) = (code >> 12u & 63u | TAG_CONT) as u8;
2118+
*ptr::mut_offset(buf, off + 4u) = (code >> 6u & 63u | TAG_CONT) as u8;
2119+
*ptr::mut_offset(buf, off + 5u) = (code & 63u | TAG_CONT) as u8;
2120+
}
21012121
_ => {}
21022122
}
21032123
}

0 commit comments

Comments
 (0)