Skip to content

Commit 7016473

Browse files
nikomatsakisbrson
authored andcommitted
convert a few tests from unsafe fns to fns with unsafe bodies
1 parent 9f9deff commit 7016473

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/test/stdtest/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ fn unsafe_from_bytes() {
256256
}
257257

258258
#[test]
259-
unsafe fn str_from_cstr() {
259+
fn str_from_cstr() unsafe {
260260
let a = [65u8, 65u8, 65u8, 65u8, 65u8, 65u8, 65u8, 0u8];
261261
let b = vec::to_ptr(a);
262262
let c = str::str_from_cstr(b);
@@ -278,7 +278,7 @@ fn as_buf_small() {
278278
}
279279

280280
#[test]
281-
unsafe fn as_buf2() {
281+
fn as_buf2() unsafe {
282282
let s = "hello";
283283
let sb = str::as_buf(s, {|b| b });
284284
let s_cstr = str::str_from_cstr(sb);

src/test/stdtest/vec.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn square_if_odd(&&n: uint) -> option::t<uint> {
2121
fn add(&&x: uint, &&y: uint) -> uint { ret x + y; }
2222

2323
#[test]
24-
unsafe fn test_unsafe_ptrs() {
24+
fn test_unsafe_ptrs() unsafe {
2525
// Test on-stack copy-from-buf.
2626
let a = [1, 2, 3];
2727
let ptr = vec::to_ptr(a);

0 commit comments

Comments
 (0)