Skip to content

Commit 36f3789

Browse files
committed
---
yaml --- r: 64653 b: refs/heads/snap-stage3 c: cf75330 h: refs/heads/master i: 64651: aa37b65 v: v3
1 parent 1e84970 commit 36f3789

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 7af56bb92199eabcfee52c43739761b18872a2c1
4+
refs/heads/snap-stage3: cf75330807ad908a428e9c162a388e367fb07781
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustpkg/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ pub fn link_exe(_src: &Path, _dest: &Path) -> bool {
380380
#[cfg(target_os = "freebsd")]
381381
#[cfg(target_os = "macos")]
382382
pub fn link_exe(src: &Path, dest: &Path) -> bool {
383-
use std::{libc, str};
383+
use std::libc;
384384
unsafe {
385385
do src.to_str().as_c_str |src_buf| {
386386
do dest.to_str().as_c_str |dest_buf| {

branches/snap-stage3/src/libstd/run.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use option::{Some, None};
2323
use os;
2424
use prelude::*;
2525
use ptr;
26-
use str;
2726
use task;
2827
use vec::ImmutableVector;
2928

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3116,6 +3116,28 @@ mod tests {
31163116
}
31173117
}
31183118
3119+
#[test]
3120+
fn test_as_c_str() {
3121+
let a = ~"";
3122+
do a.as_c_str |buf| {
3123+
unsafe {
3124+
assert_eq!(*ptr::offset(buf, 0), 0);
3125+
}
3126+
}
3127+
3128+
let a = ~"hello";
3129+
do a.as_c_str |buf| {
3130+
unsafe {
3131+
assert_eq!(*ptr::offset(buf, 0), 'h' as libc::c_char);
3132+
assert_eq!(*ptr::offset(buf, 1), 'e' as libc::c_char);
3133+
assert_eq!(*ptr::offset(buf, 2), 'l' as libc::c_char);
3134+
assert_eq!(*ptr::offset(buf, 3), 'l' as libc::c_char);
3135+
assert_eq!(*ptr::offset(buf, 4), 'o' as libc::c_char);
3136+
assert_eq!(*ptr::offset(buf, 5), 0);
3137+
}
3138+
}
3139+
}
3140+
31193141
#[test]
31203142
fn test_subslice_offset() {
31213143
let a = "kernelsprite";

0 commit comments

Comments
 (0)