Skip to content

Commit cc5c1a0

Browse files
committed
Add comment
1 parent 4e0ee75 commit cc5c1a0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/librustc_driver/driver.rs

+12
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,18 @@ impl<'a> CompileController<'a> {
414414
}
415415
}
416416

417+
/// This implementation makes it easier to create a custom driver when you only want to hook
418+
/// into callbacks from `CompileController`.
419+
///
420+
/// # Example
421+
///
422+
/// ```no_run
423+
/// # extern crate rustc_driver;
424+
/// # use rustc_driver::driver::CompileController;
425+
/// let mut controller = CompileController::basic();
426+
/// controller.after_analysis.callback = Box::new(move |_state| {});
427+
/// rustc_driver::run_compiler(&[], Box::new(controller), None, None);
428+
/// ```
417429
impl<'a> ::CompilerCalls<'a> for CompileController<'a> {
418430
fn early_callback(
419431
&mut self,

0 commit comments

Comments
 (0)