mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-21 17:52:12 +03:00
Pass Queries by reference.
This commit is contained in:
@@ -278,7 +278,7 @@ pub fn ongoing_codegen(&self) -> Result<&Query<Box<dyn Any>>> {
|
||||
})
|
||||
}
|
||||
|
||||
pub fn linker(self) -> Result<Linker> {
|
||||
pub fn linker(&self) -> Result<Linker> {
|
||||
let dep_graph = self.dep_graph()?;
|
||||
let prepare_outputs = self.prepare_outputs()?;
|
||||
let ongoing_codegen = self.ongoing_codegen()?;
|
||||
@@ -288,7 +288,7 @@ pub fn linker(self) -> Result<Linker> {
|
||||
|
||||
Ok(Linker {
|
||||
sess,
|
||||
dep_graph: dep_graph.take(),
|
||||
dep_graph: dep_graph.peek().clone(),
|
||||
prepare_outputs: prepare_outputs.take(),
|
||||
ongoing_codegen: ongoing_codegen.take(),
|
||||
codegen_backend,
|
||||
@@ -316,11 +316,11 @@ pub fn link(self) -> Result<()> {
|
||||
}
|
||||
|
||||
impl Compiler {
|
||||
pub fn enter<'c, F, T>(&'c self, f: F) -> Result<T>
|
||||
where F: FnOnce(Queries<'c>) -> Result<T>
|
||||
pub fn enter<'c, F, T>(&'c self, f: F) -> T
|
||||
where F: for<'q> FnOnce(&'q Queries<'c>) -> T
|
||||
{
|
||||
let queries = Queries::new(&self);
|
||||
f(queries)
|
||||
f(&queries)
|
||||
}
|
||||
|
||||
// This method is different to all the other methods in `Compiler` because
|
||||
|
||||
Reference in New Issue
Block a user