Inline Query::default()
This commit is contained in:
parent
ec2d1b0ed2
commit
f27645927c
@ -65,12 +65,6 @@ pub fn enter<T>(&mut self, f: impl FnOnce(TyCtxt<'tcx>) -> T) -> T {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> Default for Query<T> {
|
|
||||||
fn default() -> Self {
|
|
||||||
Query { result: RefCell::new(None) }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct Queries<'tcx> {
|
pub struct Queries<'tcx> {
|
||||||
compiler: &'tcx Compiler,
|
compiler: &'tcx Compiler,
|
||||||
gcx_cell: OnceLock<GlobalCtxt<'tcx>>,
|
gcx_cell: OnceLock<GlobalCtxt<'tcx>>,
|
||||||
@ -90,8 +84,8 @@ pub fn new(compiler: &'tcx Compiler) -> Queries<'tcx> {
|
|||||||
gcx_cell: OnceLock::new(),
|
gcx_cell: OnceLock::new(),
|
||||||
arena: WorkerLocal::new(|_| Arena::default()),
|
arena: WorkerLocal::new(|_| Arena::default()),
|
||||||
hir_arena: WorkerLocal::new(|_| rustc_hir::Arena::default()),
|
hir_arena: WorkerLocal::new(|_| rustc_hir::Arena::default()),
|
||||||
parse: Default::default(),
|
parse: Query { result: RefCell::new(None) },
|
||||||
gcx: Default::default(),
|
gcx: Query { result: RefCell::new(None) },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user