From 6582240d1296516ea02882c8bb092688d2f43f20 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Tue, 7 Jul 2020 11:10:51 +1000 Subject: [PATCH] Remove `Compiler::compile()`. It's unused. --- src/librustc_interface/queries.rs | 34 ------------------------------- 1 file changed, 34 deletions(-) diff --git a/src/librustc_interface/queries.rs b/src/librustc_interface/queries.rs index 4a41c3e97cafc..4265e6dca6a24 100644 --- a/src/librustc_interface/queries.rs +++ b/src/librustc_interface/queries.rs @@ -18,7 +18,6 @@ use rustc_session::{output::find_crate_name, Session}; use rustc_span::symbol::sym; use std::any::Any; use std::cell::{Ref, RefCell, RefMut}; -use std::mem; use std::rc::Rc; /// Represent the result of a query. @@ -395,37 +394,4 @@ impl Compiler { ret } - - // This method is different to all the other methods in `Compiler` because - // it lacks a `Queries` entry. It's also not currently used. It does serve - // as an example of how `Compiler` can be used, with additional steps added - // between some passes. And see `rustc_driver::run_compiler` for a more - // complex example. - pub fn compile(&self) -> Result<()> { - let linker = self.enter(|queries| { - queries.prepare_outputs()?; - - if self.session().opts.output_types.contains_key(&OutputType::DepInfo) - && self.session().opts.output_types.len() == 1 - { - return Ok(None); - } - - queries.global_ctxt()?; - - // Drop AST after creating GlobalCtxt to free memory. - mem::drop(queries.expansion()?.take()); - - queries.ongoing_codegen()?; - - let linker = queries.linker()?; - Ok(Some(linker)) - })?; - - if let Some(linker) = linker { - linker.link()? - } - - Ok(()) - } }