Accept prefix notation for writing the types of str/~ and friends.

This commit is contained in:
Michael Sullivan
2012-07-11 23:42:26 -07:00
parent acb86921a6
commit 2ea9c8df0f
37 changed files with 198 additions and 147 deletions

View File

@@ -1300,7 +1300,7 @@ fn test_unkillable_nested() {
#[test]
fn test_tls_multitask() unsafe {
fn my_key(+_x: @str) { }
fn my_key(+_x: @str/~) { }
local_data_set(my_key, @"parent data");
do task::spawn {
assert local_data_get(my_key) == none; // TLS shouldn't carry over.
@@ -1316,7 +1316,7 @@ fn test_tls_multitask() unsafe {
#[test]
fn test_tls_overwrite() unsafe {
fn my_key(+_x: @str) { }
fn my_key(+_x: @str/~) { }
local_data_set(my_key, @"first data");
local_data_set(my_key, @"next data"); // Shouldn't leak.
assert *(local_data_get(my_key).get()) == "next data";
@@ -1324,7 +1324,7 @@ fn test_tls_overwrite() unsafe {
#[test]
fn test_tls_pop() unsafe {
fn my_key(+_x: @str) { }
fn my_key(+_x: @str/~) { }
local_data_set(my_key, @"weasel");
assert *(local_data_pop(my_key).get()) == "weasel";
// Pop must remove the data from the map.
@@ -1333,7 +1333,7 @@ fn test_tls_pop() unsafe {
#[test]
fn test_tls_modify() unsafe {
fn my_key(+_x: @str) { }
fn my_key(+_x: @str/~) { }
local_data_modify(my_key, |data| {
alt data {
some(@val) { fail "unwelcome value: " + val }
@@ -1357,7 +1357,7 @@ fn test_tls_crust_automorestack_memorial_bug() unsafe {
// 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) { }
fn my_key(+_x: @str/~) { }
do task::spawn {
unsafe { local_data_set(my_key, @"hax"); }
}
@@ -1365,7 +1365,7 @@ fn test_tls_crust_automorestack_memorial_bug() unsafe {
#[test]
fn test_tls_multiple_types() unsafe {
fn str_key(+_x: @str) { }
fn str_key(+_x: @str/~) { }
fn box_key(+_x: @@()) { }
fn int_key(+_x: @int) { }
do task::spawn {
@@ -1377,7 +1377,7 @@ fn test_tls_multiple_types() unsafe {
#[test]
fn test_tls_overwrite_multiple_types() unsafe {
fn str_key(+_x: @str) { }
fn str_key(+_x: @str/~) { }
fn box_key(+_x: @@()) { }
fn int_key(+_x: @int) { }
do task::spawn {
@@ -1393,7 +1393,7 @@ fn test_tls_overwrite_multiple_types() unsafe {
#[should_fail]
#[ignore(cfg(windows))]
fn test_tls_cleanup_on_failure() unsafe {
fn str_key(+_x: @str) { }
fn str_key(+_x: @str/~) { }
fn box_key(+_x: @@()) { }
fn int_key(+_x: @int) { }
local_data_set(str_key, @"parent data");