Skip to content

Commit 200617e

Browse files
committed
---
yaml --- r: 143207 b: refs/heads/try2 c: cf75330 h: refs/heads/master i: 143205: 9e8593a 143203: bd0bb98 143199: 2645716 v: v3
1 parent 67182c8 commit 200617e

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
@@ -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: 7af56bb92199eabcfee52c43739761b18872a2c1
8+
refs/heads/try2: cf75330807ad908a428e9c162a388e367fb07781
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/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/try2/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/try2/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)