Add comment

This commit is contained in:
bjorn3 2018-06-04 12:14:50 +02:00
parent 4e0ee758b7
commit cc5c1a0abb
1 changed files with 12 additions and 0 deletions

View File

@ -414,6 +414,18 @@ impl<'a> CompileController<'a> {
}
}
/// This implementation makes it easier to create a custom driver when you only want to hook
/// into callbacks from `CompileController`.
///
/// # Example
///
/// ```no_run
/// # extern crate rustc_driver;
/// # use rustc_driver::driver::CompileController;
/// let mut controller = CompileController::basic();
/// controller.after_analysis.callback = Box::new(move |_state| {});
/// rustc_driver::run_compiler(&[], Box::new(controller), None, None);
/// ```
impl<'a> ::CompilerCalls<'a> for CompileController<'a> {
fn early_callback(
&mut self,