diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2011-10-11 17:53:10 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2011-10-12 16:33:07 -0700 |
| commit | 70164739e8ef2cefbc0510c2521421658f73d332 (patch) | |
| tree | 6968d24c55b892284b56a6a71eb3256343359013 /src/test | |
| parent | 9f9deff7af4b3f430b0577d48cace3d2b18efc57 (diff) | |
| download | rust-70164739e8ef2cefbc0510c2521421658f73d332.tar.gz rust-70164739e8ef2cefbc0510c2521421658f73d332.zip | |
convert a few tests from unsafe fns to fns with unsafe bodies
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/stdtest/str.rs | 4 | ||||
| -rw-r--r-- | src/test/stdtest/vec.rs | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/test/stdtest/str.rs b/src/test/stdtest/str.rs index 8cce515ec3e..aa3a61f3dd5 100644 --- a/src/test/stdtest/str.rs +++ b/src/test/stdtest/str.rs @@ -256,7 +256,7 @@ fn unsafe_from_bytes() { } #[test] -unsafe fn str_from_cstr() { +fn str_from_cstr() unsafe { let a = [65u8, 65u8, 65u8, 65u8, 65u8, 65u8, 65u8, 0u8]; let b = vec::to_ptr(a); let c = str::str_from_cstr(b); @@ -278,7 +278,7 @@ fn as_buf_small() { } #[test] -unsafe fn as_buf2() { +fn as_buf2() unsafe { let s = "hello"; let sb = str::as_buf(s, {|b| b }); let s_cstr = str::str_from_cstr(sb); diff --git a/src/test/stdtest/vec.rs b/src/test/stdtest/vec.rs index 313db7b71f1..3d8614f2d24 100644 --- a/src/test/stdtest/vec.rs +++ b/src/test/stdtest/vec.rs @@ -21,7 +21,7 @@ fn square_if_odd(&&n: uint) -> option::t<uint> { fn add(&&x: uint, &&y: uint) -> uint { ret x + y; } #[test] -unsafe fn test_unsafe_ptrs() { +fn test_unsafe_ptrs() unsafe { // Test on-stack copy-from-buf. let a = [1, 2, 3]; let ptr = vec::to_ptr(a); |
