Skip to content

Commit 6dc57e1

Browse files
committed
---
yaml --- r: 144861 b: refs/heads/try2 c: f87578d h: refs/heads/master i: 144859: 4c53ad9 v: v3
1 parent 96ba136 commit 6dc57e1

File tree

6 files changed

+78
-162
lines changed

6 files changed

+78
-162
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 7f8ada9acf128507106e67834c8d0d780f38636c
8+
refs/heads/try2: f87578d9fbf37f76fc1ccd3eb92ef24f8b2a0b31
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/rust.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3385,11 +3385,9 @@ The path to a module consists of the crate name, any parent modules,
33853385
then the module itself, all separated by double colons (`::`). The
33863386
optional log level can be appended to the module path with an equals
33873387
sign (`=`) followed by the log level, from 1 to 4, inclusive. Level 1
3388-
is the error level, 2 is warning, 3 info, and 4 debug. You can also
3389-
use the symbolic constants `error`, `warn`, `info`, and `debug`. Any
3390-
logs less than or equal to the specified level will be output. If not
3391-
specified then log level 4 is assumed. However, debug messages are
3392-
only available if `--cfg=debug` is passed to `rustc`.
3388+
is the error level, 2 is warning, 3 info, and 4 debug. Any logs
3389+
less than or equal to the specified level will be output. If not
3390+
specified then log level 4 is assumed.
33933391

33943392
As an example, to see all the logs generated by the compiler, you would set
33953393
`RUST_LOG` to `rustc`, which is the crate name (as specified in its `link`

branches/try2/mk/rt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export PYTHONPATH := $(PYTHONPATH):$$(S)src/gyp/pylib
178178

179179
$$(LIBUV_MAKEFILE_$(1)_$(2)):
180180
(cd $(S)src/libuv/ && \
181-
$$(CFG_PYTHON) ./gyp_uv -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) -D ninja \
181+
./gyp_uv -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) -D ninja \
182182
-Goutput_dir=$$(@D) --generator-output $$(@D))
183183

184184
# XXX: Shouldn't need platform-specific conditions here

branches/try2/src/libextra/uuid.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ impl Uuid {
210210
///
211211
/// # Arguments
212212
/// * `b` An array or slice of 16 bytes
213-
pub fn from_bytes(b: &[u8]) -> Option<Uuid> {
213+
pub fn from_utf8(b: &[u8]) -> Option<Uuid> {
214214
if b.len() != 16 {
215215
return None
216216
}
@@ -413,7 +413,7 @@ impl Uuid {
413413
ub[i] = FromStrRadix::from_str_radix(vs.slice(i*2, (i+1)*2), 16).unwrap();
414414
}
415415

416-
Ok(Uuid::from_bytes(ub).unwrap())
416+
Ok(Uuid::from_utf8(ub).unwrap())
417417
}
418418
}
419419

@@ -705,11 +705,11 @@ mod test {
705705
}
706706

707707
#[test]
708-
fn test_from_bytes() {
708+
fn test_from_utf8() {
709709
let b = ~[ 0xa1, 0xa2, 0xa3, 0xa4, 0xb1, 0xb2, 0xc1, 0xc2,
710710
0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8 ];
711711

712-
let u = Uuid::from_bytes(b).unwrap();
712+
let u = Uuid::from_utf8(b).unwrap();
713713
let expected = ~"a1a2a3a4b1b2c1c2d1d2d3d4d5d6d7d8";
714714

715715
assert!(u.to_simple_str() == expected);
@@ -729,7 +729,7 @@ mod test {
729729
let b_in: [u8, ..16] = [ 0xa1, 0xa2, 0xa3, 0xa4, 0xb1, 0xb2, 0xc1, 0xc2,
730730
0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8 ];
731731

732-
let u = Uuid::from_bytes(b_in.clone()).unwrap();
732+
let u = Uuid::from_utf8(b_in.clone()).unwrap();
733733

734734
let b_out = u.to_bytes();
735735

branches/try2/src/libstd/repr.rs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ impl<'self> ReprVisitor<'self> {
178178
pub fn write_escaped_slice(&mut self, slice: &str) {
179179
self.writer.write(['"' as u8]);
180180
for ch in slice.iter() {
181-
self.write_escaped_char(ch);
181+
self.write_escaped_char(ch, true);
182182
}
183183
self.writer.write(['"' as u8]);
184184
}
@@ -230,14 +230,26 @@ impl<'self> ReprVisitor<'self> {
230230
v.fill, inner)
231231
}
232232

233-
fn write_escaped_char(&mut self, ch: char) {
233+
fn write_escaped_char(&mut self, ch: char, is_str: bool) {
234234
match ch {
235235
'\t' => self.writer.write("\\t".as_bytes()),
236236
'\r' => self.writer.write("\\r".as_bytes()),
237237
'\n' => self.writer.write("\\n".as_bytes()),
238238
'\\' => self.writer.write("\\\\".as_bytes()),
239-
'\'' => self.writer.write("\\'".as_bytes()),
240-
'"' => self.writer.write("\\\"".as_bytes()),
239+
'\'' => {
240+
if is_str {
241+
self.writer.write("'".as_bytes())
242+
} else {
243+
self.writer.write("\\'".as_bytes())
244+
}
245+
}
246+
'"' => {
247+
if is_str {
248+
self.writer.write("\\\"".as_bytes())
249+
} else {
250+
self.writer.write("\"".as_bytes())
251+
}
252+
}
241253
'\x20'..'\x7e' => self.writer.write([ch as u8]),
242254
_ => {
243255
do char::escape_unicode(ch) |c| {
@@ -274,7 +286,7 @@ impl<'self> TyVisitor for ReprVisitor<'self> {
274286
fn visit_char(&mut self) -> bool {
275287
do self.get::<char> |this, &ch| {
276288
this.writer.write(['\'' as u8]);
277-
this.write_escaped_char(ch);
289+
this.write_escaped_char(ch, false);
278290
this.writer.write(['\'' as u8]);
279291
}
280292
}
@@ -684,6 +696,11 @@ fn test_repr() {
684696
exact_test(&(10u64, ~"hello"),
685697
"(10u64, ~\"hello\")");
686698

699+
exact_test(&'\'', "'\\''");
700+
exact_test(&'"', "'\"'");
701+
exact_test(&("'"), "\"'\"");
702+
exact_test(&("\""), "\"\\\"\"");
703+
687704
exact_test(&println, "fn(&str)");
688705
exact_test(&swap::<int>, "fn(&mut int, &mut int)");
689706
exact_test(&is_alphabetic, "fn(char) -> bool");

0 commit comments

Comments
 (0)