Skip to content

Commit c26130d

Browse files
committed
---
yaml --- r: 127289 b: refs/heads/try c: ef03363 h: refs/heads/master i: 127287: a59ab78 v: v3
1 parent 010ce50 commit c26130d

File tree

48 files changed

+172
-175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+172
-175
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 87d2bf400ce1bc2cec832f9d5b8e763f06bb7f43
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 12e0f72f517516ac4fce2aed85e6142e9b874bce
5-
refs/heads/try: 7be8f0af0393dcdb077c2f6b1653836fd3fba235
5+
refs/heads/try: ef03363059f26f5215d2013da0168c4c34c5561c
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/libcollections/str.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,7 +1457,7 @@ mod tests {
14571457
109
14581458
];
14591459
assert_eq!("".as_bytes(), &[]);
1460-
assert_eq!("abc".as_bytes(), b"abc");
1460+
assert_eq!("abc".as_bytes(), &['a' as u8, 'b' as u8, 'c' as u8]);
14611461
assert_eq!("ศไทย中华Việt Nam".as_bytes(), v.as_slice());
14621462
}
14631463

@@ -1475,11 +1475,11 @@ mod tests {
14751475
fn test_as_ptr() {
14761476
let buf = "hello".as_ptr();
14771477
unsafe {
1478-
assert_eq!(*buf.offset(0), b'h');
1479-
assert_eq!(*buf.offset(1), b'e');
1480-
assert_eq!(*buf.offset(2), b'l');
1481-
assert_eq!(*buf.offset(3), b'l');
1482-
assert_eq!(*buf.offset(4), b'o');
1478+
assert_eq!(*buf.offset(0), 'h' as u8);
1479+
assert_eq!(*buf.offset(1), 'e' as u8);
1480+
assert_eq!(*buf.offset(2), 'l' as u8);
1481+
assert_eq!(*buf.offset(3), 'l' as u8);
1482+
assert_eq!(*buf.offset(4), 'o' as u8);
14831483
}
14841484
}
14851485

branches/try/src/libcollections/string.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ mod tests {
10401040
fn test_push_bytes() {
10411041
let mut s = String::from_str("ABC");
10421042
unsafe {
1043-
s.push_bytes([b'D']);
1043+
s.push_bytes([ 'D' as u8 ]);
10441044
}
10451045
assert_eq!(s.as_slice(), "ABCD");
10461046
}

branches/try/src/libcore/char.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ pub trait Char {
271271
/// # Failure
272272
///
273273
/// Fails if given a radix > 36.
274-
fn from_digit(num: uint, radix: uint) -> Option<char>;
274+
fn from_digit(num: uint, radix: uint) -> Option<Self>;
275275

276276
/// Returns the hexadecimal Unicode escape of a character.
277277
///

branches/try/src/libcore/fmt/float.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ pub fn float_to_str_bytes_common<T: Primitive + Float, U>(
198198
// Decide what sign to put in front
199199
match sign {
200200
SignNeg | SignAll if neg => {
201-
buf[end] = b'-';
201+
buf[end] = '-' as u8;
202202
end += 1;
203203
}
204204
SignAll => {
205-
buf[end] = b'+';
205+
buf[end] = '+' as u8;
206206
end += 1;
207207
}
208208
_ => ()
@@ -218,7 +218,7 @@ pub fn float_to_str_bytes_common<T: Primitive + Float, U>(
218218
// Now emit the fractional part, if any
219219
deccum = num.fract();
220220
if deccum != _0 || (limit_digits && exact && digit_count > 0) {
221-
buf[end] = b'.';
221+
buf[end] = '.' as u8;
222222
end += 1;
223223
let mut dig = 0u;
224224

@@ -269,8 +269,8 @@ pub fn float_to_str_bytes_common<T: Primitive + Float, U>(
269269
// If reached left end of number, have to
270270
// insert additional digit:
271271
if i < 0
272-
|| buf[i as uint] == b'-'
273-
|| buf[i as uint] == b'+' {
272+
|| buf[i as uint] == '-' as u8
273+
|| buf[i as uint] == '+' as u8 {
274274
for j in range(i as uint + 1, end).rev() {
275275
buf[j + 1] = buf[j];
276276
}
@@ -280,7 +280,7 @@ pub fn float_to_str_bytes_common<T: Primitive + Float, U>(
280280
}
281281

282282
// Skip the '.'
283-
if buf[i as uint] == b'.' { i -= 1; continue; }
283+
if buf[i as uint] == '.' as u8 { i -= 1; continue; }
284284

285285
// Either increment the digit,
286286
// or set to 0 if max and carry the 1.
@@ -306,14 +306,14 @@ pub fn float_to_str_bytes_common<T: Primitive + Float, U>(
306306
let mut i = buf_max_i;
307307

308308
// discover trailing zeros of fractional part
309-
while i > start_fractional_digits && buf[i] == b'0' {
309+
while i > start_fractional_digits && buf[i] == '0' as u8 {
310310
i -= 1;
311311
}
312312

313313
// Only attempt to truncate digits if buf has fractional digits
314314
if i >= start_fractional_digits {
315315
// If buf ends with '.', cut that too.
316-
if buf[i] == b'.' { i -= 1 }
316+
if buf[i] == '.' as u8 { i -= 1 }
317317

318318
// only resize buf if we actually remove digits
319319
if i < buf_max_i {
@@ -323,7 +323,7 @@ pub fn float_to_str_bytes_common<T: Primitive + Float, U>(
323323
} // If exact and trailing '.', just cut that
324324
else {
325325
let max_i = end - 1;
326-
if buf[max_i] == b'.' {
326+
if buf[max_i] == '.' as u8 {
327327
end = max_i;
328328
}
329329
}

branches/try/src/libcore/fmt/num.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,13 @@ macro_rules! radix {
104104
}
105105
}
106106

107-
radix!(Binary, 2, "0b", x @ 0 .. 2 => b'0' + x)
108-
radix!(Octal, 8, "0o", x @ 0 .. 7 => b'0' + x)
109-
radix!(Decimal, 10, "", x @ 0 .. 9 => b'0' + x)
110-
radix!(LowerHex, 16, "0x", x @ 0 .. 9 => b'0' + x,
111-
x @ 10 ..15 => b'a' + (x - 10))
112-
radix!(UpperHex, 16, "0x", x @ 0 .. 9 => b'0' + x,
113-
x @ 10 ..15 => b'A' + (x - 10))
107+
radix!(Binary, 2, "0b", x @ 0 .. 2 => '0' as u8 + x)
108+
radix!(Octal, 8, "0o", x @ 0 .. 7 => '0' as u8 + x)
109+
radix!(Decimal, 10, "", x @ 0 .. 9 => '0' as u8 + x)
110+
radix!(LowerHex, 16, "0x", x @ 0 .. 9 => '0' as u8 + x,
111+
x @ 10 ..15 => 'a' as u8 + (x - 10))
112+
radix!(UpperHex, 16, "0x", x @ 0 .. 9 => '0' as u8 + x,
113+
x @ 10 ..15 => 'A' as u8 + (x - 10))
114114

115115
/// A radix with in the range of `2..36`.
116116
#[deriving(Clone, PartialEq)]
@@ -129,8 +129,8 @@ impl GenericRadix for Radix {
129129
fn base(&self) -> u8 { self.base }
130130
fn digit(&self, x: u8) -> u8 {
131131
match x {
132-
x @ 0 ..9 => b'0' + x,
133-
x if x < self.base() => b'a' + (x - 10),
132+
x @ 0 ..9 => '0' as u8 + x,
133+
x if x < self.base() => 'a' as u8 + (x - 10),
134134
x => fail!("number not in the range 0..{}: {}", self.base() - 1, x),
135135
}
136136
}

branches/try/src/libcore/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ impl<'a> StrSlice<'a> for &'a str {
17551755
fn lines_any(&self) -> AnyLines<'a> {
17561756
self.lines().map(|line| {
17571757
let l = line.len();
1758-
if l > 0 && line.as_bytes()[l - 1] == b'\r' { line.slice(0, l - 1) }
1758+
if l > 0 && line.as_bytes()[l - 1] == '\r' as u8 { line.slice(0, l - 1) }
17591759
else { line }
17601760
})
17611761
}

branches/try/src/libdebug/repr.rs

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,11 @@ impl<'a> ReprVisitor<'a> {
165165
}
166166

167167
pub fn write_escaped_slice(&mut self, slice: &str) -> bool {
168-
try!(self, self.writer.write([b'"']));
168+
try!(self, self.writer.write(['"' as u8]));
169169
for ch in slice.chars() {
170170
if !self.write_escaped_char(ch, true) { return false }
171171
}
172-
try!(self, self.writer.write([b'"']));
172+
try!(self, self.writer.write(['"' as u8]));
173173
true
174174
}
175175

@@ -188,7 +188,7 @@ impl<'a> ReprVisitor<'a> {
188188
inner: *const TyDesc) -> bool {
189189
let mut p = ptr as *const u8;
190190
let (sz, al) = unsafe { ((*inner).size, (*inner).align) };
191-
try!(self, self.writer.write([b'[']));
191+
try!(self, self.writer.write(['[' as u8]));
192192
let mut first = true;
193193
let mut left = len;
194194
// unit structs have 0 size, and don't loop forever.
@@ -203,7 +203,7 @@ impl<'a> ReprVisitor<'a> {
203203
p = align(unsafe { p.offset(sz as int) as uint }, al) as *const u8;
204204
left -= dec;
205205
}
206-
try!(self, self.writer.write([b']']));
206+
try!(self, self.writer.write([']' as u8]));
207207
true
208208
}
209209

@@ -263,9 +263,9 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
263263

264264
fn visit_char(&mut self) -> bool {
265265
self.get::<char>(|this, &ch| {
266-
try!(this, this.writer.write([b'\'']));
266+
try!(this, this.writer.write(['\'' as u8]));
267267
if !this.write_escaped_char(ch, false) { return false }
268-
try!(this, this.writer.write([b'\'']));
268+
try!(this, this.writer.write(['\'' as u8]));
269269
true
270270
})
271271
}
@@ -310,7 +310,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
310310
}
311311

312312
fn visit_rptr(&mut self, mtbl: uint, inner: *const TyDesc) -> bool {
313-
try!(self, self.writer.write([b'&']));
313+
try!(self, self.writer.write(['&' as u8]));
314314
self.write_mut_qualifier(mtbl);
315315
self.get::<*const u8>(|this, p| {
316316
this.visit_ptr_inner(*p, inner)
@@ -319,7 +319,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
319319

320320
fn visit_evec_slice(&mut self, mtbl: uint, inner: *const TyDesc) -> bool {
321321
self.get::<raw::Slice<()>>(|this, s| {
322-
try!(this, this.writer.write([b'&']));
322+
try!(this, this.writer.write(['&' as u8]));
323323
this.write_mut_qualifier(mtbl);
324324
let size = unsafe {
325325
if (*inner).size == 0 { 1 } else { (*inner).size }
@@ -338,7 +338,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
338338

339339
fn visit_enter_rec(&mut self, _n_fields: uint,
340340
_sz: uint, _align: uint) -> bool {
341-
try!(self, self.writer.write([b'{']));
341+
try!(self, self.writer.write(['{' as u8]));
342342
true
343343
}
344344

@@ -356,7 +356,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
356356

357357
fn visit_leave_rec(&mut self, _n_fields: uint,
358358
_sz: uint, _align: uint) -> bool {
359-
try!(self, self.writer.write([b'}']));
359+
try!(self, self.writer.write(['}' as u8]));
360360
true
361361
}
362362

@@ -365,9 +365,9 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
365365
try!(self, self.writer.write(name.as_bytes()));
366366
if n_fields != 0 {
367367
if named_fields {
368-
try!(self, self.writer.write([b'{']));
368+
try!(self, self.writer.write(['{' as u8]));
369369
} else {
370-
try!(self, self.writer.write([b'(']));
370+
try!(self, self.writer.write(['(' as u8]));
371371
}
372372
}
373373
true
@@ -390,17 +390,17 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
390390
_sz: uint, _align: uint) -> bool {
391391
if n_fields != 0 {
392392
if named_fields {
393-
try!(self, self.writer.write([b'}']));
393+
try!(self, self.writer.write(['}' as u8]));
394394
} else {
395-
try!(self, self.writer.write([b')']));
395+
try!(self, self.writer.write([')' as u8]));
396396
}
397397
}
398398
true
399399
}
400400

401401
fn visit_enter_tup(&mut self, _n_fields: uint,
402402
_sz: uint, _align: uint) -> bool {
403-
try!(self, self.writer.write([b'(']));
403+
try!(self, self.writer.write(['(' as u8]));
404404
true
405405
}
406406

@@ -415,9 +415,9 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
415415
fn visit_leave_tup(&mut self, _n_fields: uint,
416416
_sz: uint, _align: uint) -> bool {
417417
if _n_fields == 1 {
418-
try!(self, self.writer.write([b',']));
418+
try!(self, self.writer.write([',' as u8]));
419419
}
420-
try!(self, self.writer.write([b')']));
420+
try!(self, self.writer.write([')' as u8]));
421421
true
422422
}
423423

@@ -455,7 +455,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
455455
if write {
456456
try!(self, self.writer.write(name.as_bytes()));
457457
if n_fields > 0 {
458-
try!(self, self.writer.write([b'(']));
458+
try!(self, self.writer.write(['(' as u8]));
459459
}
460460
}
461461
true
@@ -487,7 +487,7 @@ impl<'a> TyVisitor for ReprVisitor<'a> {
487487
match self.var_stk[self.var_stk.len() - 1] {
488488
Matched => {
489489
if n_fields > 0 {
490-
try!(self, self.writer.write([b')']));
490+
try!(self, self.writer.write([')' as u8]));
491491
}
492492
}
493493
_ => ()

branches/try/src/libgetopts/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ impl Matches {
372372
}
373373

374374
fn is_arg(arg: &str) -> bool {
375-
arg.len() > 1 && arg.as_bytes()[0] == b'-'
375+
arg.len() > 1 && arg.as_bytes()[0] == '-' as u8
376376
}
377377

378378
fn find_opt(opts: &[Opt], nm: Name) -> Option<uint> {
@@ -555,7 +555,7 @@ pub fn getopts(args: &[String], optgrps: &[OptGroup]) -> Result {
555555
} else {
556556
let mut names;
557557
let mut i_arg = None;
558-
if cur.as_bytes()[1] == b'-' {
558+
if cur.as_bytes()[1] == '-' as u8 {
559559
let tail = cur.as_slice().slice(2, curlen);
560560
let tail_eq: Vec<&str> = tail.split('=').collect();
561561
if tail_eq.len() <= 1 {

branches/try/src/libnum/bigint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1376,7 +1376,7 @@ impl BigInt {
13761376
if buf.is_empty() { return None; }
13771377
let mut sign = Plus;
13781378
let mut start = 0;
1379-
if buf[0] == b'-' {
1379+
if buf[0] == ('-' as u8) {
13801380
sign = Minus;
13811381
start = 1;
13821382
}

branches/try/src/libregex/test/bench.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ fn gen_text(n: uint) -> String {
159159
.collect::<Vec<u8>>();
160160
for (i, b) in bytes.mut_iter().enumerate() {
161161
if i % 20 == 0 {
162-
*b = b'\n'
162+
*b = '\n' as u8
163163
}
164164
}
165165
String::from_utf8(bytes).unwrap()

branches/try/src/libregex_macros/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ fn exec<'t>(which: ::regex::native::MatchKind, input: &'t str,
594594
pats: vec!(box(GC) ast::Pat{
595595
id: ast::DUMMY_NODE_ID,
596596
span: self.sp,
597-
node: ast::PatWild(ast::PatWildSingle),
597+
node: ast::PatWild,
598598
}),
599599
guard: None,
600600
body: body,

branches/try/src/librustc/middle/cfg/construct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl<'a> CFGBuilder<'a> {
112112
ast::PatEnum(_, None) |
113113
ast::PatLit(..) |
114114
ast::PatRange(..) |
115-
ast::PatWild(_) => {
115+
ast::PatWild | ast::PatWildMulti => {
116116
self.add_node(pat.id, [pred])
117117
}
118118

0 commit comments

Comments
 (0)