File tree Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Expand file tree Collapse file tree 4 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: 7af56bb92199eabcfee52c43739761b18872a2c1
4
+ refs/heads/snap-stage3: cf75330807ad908a428e9c162a388e367fb07781
5
5
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -380,7 +380,7 @@ pub fn link_exe(_src: &Path, _dest: &Path) -> bool {
380
380
#[ cfg( target_os = "freebsd" ) ]
381
381
#[ cfg( target_os = "macos" ) ]
382
382
pub fn link_exe ( src : & Path , dest : & Path ) -> bool {
383
- use std:: { libc, str } ;
383
+ use std:: libc;
384
384
unsafe {
385
385
do src. to_str ( ) . as_c_str |src_buf| {
386
386
do dest. to_str ( ) . as_c_str |dest_buf| {
Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ use option::{Some, None};
23
23
use os;
24
24
use prelude:: * ;
25
25
use ptr;
26
- use str;
27
26
use task;
28
27
use vec:: ImmutableVector ;
29
28
Original file line number Diff line number Diff line change @@ -3116,6 +3116,28 @@ mod tests {
3116
3116
}
3117
3117
}
3118
3118
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
+
3119
3141
#[test]
3120
3142
fn test_subslice_offset() {
3121
3143
let a = " kernelsprite";
You can’t perform that action at this time.
0 commit comments