diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2018-06-04 12:14:50 +0200 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2018-06-05 18:05:12 +0200 |
| commit | cc5c1a0abb1a4e25c8a40126991acce4c34508c4 (patch) | |
| tree | c8fc0b212d1cf2b5a876b2b298099cc36ce6e13f | |
| parent | 4e0ee758b7d3292c2f2bbc6443ed1ea8f180f953 (diff) | |
| download | rust-cc5c1a0abb1a4e25c8a40126991acce4c34508c4.tar.gz rust-cc5c1a0abb1a4e25c8a40126991acce4c34508c4.zip | |
Add comment
| -rw-r--r-- | src/librustc_driver/driver.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/librustc_driver/driver.rs b/src/librustc_driver/driver.rs index 7b177d5e79c..8dcbda917b2 100644 --- a/src/librustc_driver/driver.rs +++ b/src/librustc_driver/driver.rs @@ -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, |
