diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2013-04-18 20:40:37 -0400 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2013-04-19 23:23:23 -0400 |
| commit | 98dfeb173fc1fbe8724abf8cf0943bd32653dd65 (patch) | |
| tree | 01c687d6e306aa53acb698aaf33328bdd8a38927 /src/libcore/task | |
| parent | c97bee26967bfb5a7dccbb1ae1572a6c4da38f15 (diff) | |
| download | rust-98dfeb173fc1fbe8724abf8cf0943bd32653dd65.tar.gz rust-98dfeb173fc1fbe8724abf8cf0943bd32653dd65.zip | |
core: clean up tests (mostly unused unsafe blocks)
Diffstat (limited to 'src/libcore/task')
| -rw-r--r-- | src/libcore/task/local_data.rs | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/libcore/task/local_data.rs b/src/libcore/task/local_data.rs index 261671f6de9..6050aca6dc1 100644 --- a/src/libcore/task/local_data.rs +++ b/src/libcore/task/local_data.rs @@ -150,32 +150,28 @@ fn test_tls_modify() { #[test] fn test_tls_crust_automorestack_memorial_bug() { - unsafe { - // This might result in a stack-canary clobber if the runtime fails to - // set sp_limit to 0 when calling the cleanup extern - it might - // automatically jump over to the rust stack, which causes next_c_sp - // to get recorded as something within a rust stack segment. Then a - // subsequent upcall (esp. for logging, think vsnprintf) would run on - // a stack smaller than 1 MB. - fn my_key(_x: @~str) { } - do task::spawn { - unsafe { local_data_set(my_key, @~"hax"); } - } + // This might result in a stack-canary clobber if the runtime fails to + // set sp_limit to 0 when calling the cleanup extern - it might + // automatically jump over to the rust stack, which causes next_c_sp + // to get recorded as something within a rust stack segment. Then a + // subsequent upcall (esp. for logging, think vsnprintf) would run on + // a stack smaller than 1 MB. + fn my_key(_x: @~str) { } + do task::spawn { + unsafe { local_data_set(my_key, @~"hax"); } } } #[test] fn test_tls_multiple_types() { - unsafe { - fn str_key(_x: @~str) { } - fn box_key(_x: @@()) { } - fn int_key(_x: @int) { } - do task::spawn { - unsafe { - local_data_set(str_key, @~"string data"); - local_data_set(box_key, @@()); - local_data_set(int_key, @42); - } + fn str_key(_x: @~str) { } + fn box_key(_x: @@()) { } + fn int_key(_x: @int) { } + do task::spawn { + unsafe { + local_data_set(str_key, @~"string data"); + local_data_set(box_key, @@()); + local_data_set(int_key, @42); } } } |
