Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Jun 5, 2018
1 parent 4e0ee75 commit cc5c1a0
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/librustc_driver/driver.rs
Expand Up @@ -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,
Expand Down

0 comments on commit cc5c1a0

Please sign in to comment.