Allow to create definitions inside the query system.
This commit is contained in:
parent
3dcb616888
commit
43bb31b954
23 changed files with 260 additions and 150 deletions
|
@ -10,6 +10,7 @@
|
|||
#![feature(array_windows)]
|
||||
#![feature(associated_type_bounds)]
|
||||
#![feature(auto_traits)]
|
||||
#![feature(cell_leak)]
|
||||
#![feature(control_flow_enum)]
|
||||
#![feature(extend_one)]
|
||||
#![feature(let_else)]
|
||||
|
|
|
@ -539,6 +539,33 @@ impl<T> RwLock<T> {
|
|||
pub fn borrow_mut(&self) -> WriteGuard<'_, T> {
|
||||
self.write()
|
||||
}
|
||||
|
||||
#[cfg(not(parallel_compiler))]
|
||||
#[inline(always)]
|
||||
pub fn clone_guard<'a>(rg: &ReadGuard<'a, T>) -> ReadGuard<'a, T> {
|
||||
ReadGuard::clone(rg)
|
||||
}
|
||||
|
||||
#[cfg(parallel_compiler)]
|
||||
#[inline(always)]
|
||||
pub fn clone_guard<'a>(rg: &ReadGuard<'a, T>) -> ReadGuard<'a, T> {
|
||||
ReadGuard::rwlock(&rg).read()
|
||||
}
|
||||
|
||||
#[cfg(not(parallel_compiler))]
|
||||
#[inline(always)]
|
||||
pub fn leak(&self) -> &T {
|
||||
ReadGuard::leak(self.read())
|
||||
}
|
||||
|
||||
#[cfg(parallel_compiler)]
|
||||
#[inline(always)]
|
||||
pub fn leak(&self) -> &T {
|
||||
let guard = self.read();
|
||||
let ret = unsafe { &*(&*guard as *const T) };
|
||||
std::mem::forget(guard);
|
||||
ret
|
||||
}
|
||||
}
|
||||
|
||||
// FIXME: Probably a bad idea
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue