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 @@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
5
5
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8
- refs/heads/try2: 7af56bb92199eabcfee52c43739761b18872a2c1
8
+ refs/heads/try2: cf75330807ad908a428e9c162a388e367fb07781
9
9
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
10
10
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
11
11
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
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