Skip to content

Commit 75f77ea

Browse files
georgewfrasermark-i-m
authored andcommitted
Reference example from #621
1 parent e74b303 commit 75f77ea

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/rustc-driver.md

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ function is the main entrypoint to the compiler. It takes a configuration for th
1414
and a closure that takes a [`Compiler`]. `run_compiler` creates a `Compiler` from the
1515
configuration and passes it to the closure. Inside the closure, you can use the `Compiler`
1616
to drive queries to compile a crate and get the results. This is what the `rustc_driver` does too.
17+
You can see a minimal example of how to use `rustc_interface` [here][example].
1718

1819
You can see what queries are currently available through the rustdocs for [`Compiler`].
1920
You can see an example of how to use them by looking at the `rustc_driver` implementation,
@@ -36,6 +37,7 @@ replaces this functionality.
3637
[cb]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/trait.Callbacks.html
3738
[rd_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/fn.run_compiler.html
3839
[i_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/fn.run_compiler.html
40+
[example]: https://github.com/rust-lang/rustc-dev-guide/blob/master/src/rustc-driver-example.rs
3941
[`rustc_interface`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/index.html
4042
[`rustc_driver`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/
4143
[`Compiler`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/struct.Compiler.html

0 commit comments

Comments
 (0)