Skip to content

Commit 9951ac4

Browse files
committed
driver: Pass session options to CompilerCallbacks::early_callback()
1 parent 601e045 commit 9951ac4

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/librustc_driver/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,11 @@ pub fn run_compiler<'a>(args: &[String],
164164

165165
let descriptions = diagnostics_registry();
166166

167-
do_or_return!(callbacks.early_callback(&matches, &descriptions, sopts.error_format), None);
167+
do_or_return!(callbacks.early_callback(&matches,
168+
&sopts,
169+
&descriptions,
170+
sopts.error_format),
171+
None);
168172

169173
let (odir, ofile) = make_output(&matches);
170174
let (input, input_file_path) = match make_input(&matches.free) {
@@ -251,6 +255,7 @@ pub trait CompilerCalls<'a> {
251255
// else (e.g., selecting input and output).
252256
fn early_callback(&mut self,
253257
_: &getopts::Matches,
258+
_: &config::Options,
254259
_: &diagnostics::registry::Registry,
255260
_: ErrorOutputType)
256261
-> Compilation {
@@ -327,6 +332,7 @@ pub struct RustcDefaultCalls;
327332
impl<'a> CompilerCalls<'a> for RustcDefaultCalls {
328333
fn early_callback(&mut self,
329334
matches: &getopts::Matches,
335+
_sopts: &config::Options,
330336
descriptions: &diagnostics::registry::Registry,
331337
output: ErrorOutputType)
332338
-> Compilation {

src/test/run-pass-fulldeps/compiler-calls.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ struct TestCalls {
3434
impl<'a> CompilerCalls<'a> for TestCalls {
3535
fn early_callback(&mut self,
3636
_: &getopts::Matches,
37+
_: &config::Options,
3738
_: &diagnostics::registry::Registry,
3839
_: config::ErrorOutputType)
3940
-> Compilation {

0 commit comments

Comments
 (0)