@@ -92,14 +92,12 @@ fn test_tls_multitask() {
92
92
fn my_key ( _x : @~str ) { }
93
93
local_data_set ( my_key, @~"parent data") ;
94
94
do task:: spawn {
95
- unsafe {
96
- // TLS shouldn't carry over.
97
- assert!( local_data_get ( my_key) . is_none ( ) ) ;
98
- local_data_set ( my_key, @~"child data") ;
99
- assert ! ( * ( local_data_get( my_key) . get( ) ) ==
95
+ // TLS shouldn't carry over.
96
+ assert!( local_data_get ( my_key) . is_none ( ) ) ;
97
+ local_data_set ( my_key, @~"child data") ;
98
+ assert ! ( * ( local_data_get( my_key) . get( ) ) ==
100
99
~"child data");
101
- // should be cleaned up for us
102
- }
100
+ // should be cleaned up for us
103
101
}
104
102
// Must work multiple times
105
103
assert!(*(local_data_get(my_key).get()) == ~" parent data");
@@ -206,12 +204,11 @@ fn test_tls_cleanup_on_failure() {
206
204
local_data_set(str_key, @~" parent data");
207
205
local_data_set(box_key, @@());
208
206
do task::spawn {
209
- unsafe { // spawn_linked
210
- local_data_set(str_key, @~" string data") ;
211
- local_data_set( box_key, @@( ) ) ;
212
- local_data_set( int_key, @42 ) ;
213
- fail!( ) ;
214
- }
207
+ // spawn_linked
208
+ local_data_set(str_key, @~" string data") ;
209
+ local_data_set( box_key, @@( ) ) ;
210
+ local_data_set( int_key, @42 ) ;
211
+ fail!( ) ;
215
212
}
216
213
// Not quite nondeterministic.
217
214
local_data_set( int_key, @31337 ) ;
0 commit comments