2 // Test that the Callbacks interface to the compiler works.
4 // ignore-cross-compile
8 #![feature(rustc_private)]
10 extern crate rustc_driver
;
11 extern crate rustc_interface
;
13 use rustc_interface
::interface
;
15 struct TestCalls
<'a
> {
19 impl rustc_driver
::Callbacks
for TestCalls
<'_
> {
20 fn config(&mut self, _config
: &mut interface
::Config
) {
27 let args
= vec
!["compiler-calls".to_string(), "foo.rs".to_string()];
28 rustc_driver
::catch_fatal_errors(|| {
29 rustc_driver
::run_compiler(&args
, &mut TestCalls { count: &mut count }
, None
, None
).ok();