diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-05-07 14:43:48 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-05-07 14:43:48 -0700 |
| commit | 398cd18bfeba5d2c143b4b4e722a16ec9a2de2e8 (patch) | |
| tree | e9c4d9aa219c9f1f6a82247c56bc07e3269319e4 /src/libcore/task | |
| parent | 6bcc3a6c5742b5436d0c7f8be4bfb79f7eacd760 (diff) | |
| download | rust-398cd18bfeba5d2c143b4b4e722a16ec9a2de2e8.tar.gz rust-398cd18bfeba5d2c143b4b4e722a16ec9a2de2e8.zip | |
core: Replace Durable with 'static
Diffstat (limited to 'src/libcore/task')
| -rw-r--r-- | src/libcore/task/local_data.rs | 8 | ||||
| -rw-r--r-- | src/libcore/task/local_data_priv.rs | 16 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/libcore/task/local_data.rs b/src/libcore/task/local_data.rs index 89a31b7b3f5..d4b02a0ad9b 100644 --- a/src/libcore/task/local_data.rs +++ b/src/libcore/task/local_data.rs @@ -49,7 +49,7 @@ pub type LocalDataKey<'self,T> = &'self fn(v: @T); * Remove a task-local data value from the table, returning the * reference that was originally created to insert it. */ -pub unsafe fn local_data_pop<T:Durable>( +pub unsafe fn local_data_pop<T: 'static>( key: LocalDataKey<T>) -> Option<@T> { local_pop(Handle::new(), key) @@ -58,7 +58,7 @@ pub unsafe fn local_data_pop<T:Durable>( * Retrieve a task-local data value. It will also be kept alive in the * table until explicitly removed. */ -pub unsafe fn local_data_get<T:Durable>( +pub unsafe fn local_data_get<T: 'static>( key: LocalDataKey<T>) -> Option<@T> { local_get(Handle::new(), key) @@ -67,7 +67,7 @@ pub unsafe fn local_data_get<T:Durable>( * Store a value in task-local data. If this key already has a value, * that value is overwritten (and its destructor is run). */ -pub unsafe fn local_data_set<T:Durable>( +pub unsafe fn local_data_set<T: 'static>( key: LocalDataKey<T>, data: @T) { local_set(Handle::new(), key, data) @@ -76,7 +76,7 @@ pub unsafe fn local_data_set<T:Durable>( * Modify a task-local data value. If the function returns 'None', the * data is removed (and its reference dropped). */ -pub unsafe fn local_data_modify<T:Durable>( +pub unsafe fn local_data_modify<T: 'static>( key: LocalDataKey<T>, modify_fn: &fn(Option<@T>) -> Option<@T>) { diff --git a/src/libcore/task/local_data_priv.rs b/src/libcore/task/local_data_priv.rs index 10a40887e57..7240e0ca0a5 100644 --- a/src/libcore/task/local_data_priv.rs +++ b/src/libcore/task/local_data_priv.rs @@ -44,7 +44,7 @@ impl Handle { } pub trait LocalData { } -impl<T:Durable> LocalData for @T { } +impl<T: 'static> LocalData for @T { } impl Eq for @LocalData { fn eq(&self, other: &@LocalData) -> bool { @@ -131,7 +131,7 @@ unsafe fn get_newsched_local_map(local: *mut LocalStorage) -> TaskLocalMap { } } -unsafe fn key_to_key_value<T:Durable>(key: LocalDataKey<T>) -> *libc::c_void { +unsafe fn key_to_key_value<T: 'static>(key: LocalDataKey<T>) -> *libc::c_void { // Keys are closures, which are (fnptr,envptr) pairs. Use fnptr. // Use reintepret_cast -- transmute would leak (forget) the closure. let pair: (*libc::c_void, *libc::c_void) = cast::transmute_copy(&key); @@ -139,7 +139,7 @@ unsafe fn key_to_key_value<T:Durable>(key: LocalDataKey<T>) -> *libc::c_void { } // If returning Some(..), returns with @T with the map's reference. Careful! -unsafe fn local_data_lookup<T:Durable>( +unsafe fn local_data_lookup<T: 'static>( map: TaskLocalMap, key: LocalDataKey<T>) -> Option<(uint, *libc::c_void)> { @@ -157,7 +157,7 @@ unsafe fn local_data_lookup<T:Durable>( } } -unsafe fn local_get_helper<T:Durable>( +unsafe fn local_get_helper<T: 'static>( handle: Handle, key: LocalDataKey<T>, do_pop: bool) -> Option<@T> { @@ -179,21 +179,21 @@ unsafe fn local_get_helper<T:Durable>( } -pub unsafe fn local_pop<T:Durable>( +pub unsafe fn local_pop<T: 'static>( handle: Handle, key: LocalDataKey<T>) -> Option<@T> { local_get_helper(handle, key, true) } -pub unsafe fn local_get<T:Durable>( +pub unsafe fn local_get<T: 'static>( handle: Handle, key: LocalDataKey<T>) -> Option<@T> { local_get_helper(handle, key, false) } -pub unsafe fn local_set<T:Durable>( +pub unsafe fn local_set<T: 'static>( handle: Handle, key: LocalDataKey<T>, data: @T) { let map = get_local_map(handle); @@ -225,7 +225,7 @@ pub unsafe fn local_set<T:Durable>( } } -pub unsafe fn local_modify<T:Durable>( +pub unsafe fn local_modify<T: 'static>( handle: Handle, key: LocalDataKey<T>, modify_fn: &fn(Option<@T>) -> Option<@T>) { |
