Skip to content

Commit da9e815

Browse files
committedMar 11, 2024
removing parens for functions
1 parent ef8963b commit da9e815

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed
 

‎src/rustc-driver.md

+12-11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `rustc_driver` and `rustc_interface`
22

3-
The [`rustc_driver`] is essentially `rustc`'s `main()` function. It acts as
3+
The [`rustc_driver`] is essentially `rustc`'s `main` function. It acts as
44
the glue for running the various phases of the compiler in the correct order,
55
using the interface defined in the [`rustc_interface`] crate.
66

@@ -10,24 +10,25 @@ third parties to effectively use `rustc`'s internals as a library for
1010
analyzing a crate or for ad hoc emulating of the compiler (i.e. `rustdoc`
1111
compiling code and serving output).
1212

13-
More specifically the [`rustc_interface::run_compiler()`][i_rc] function is the
13+
More specifically the [`rustc_interface::run_compiler`][i_rc] function is the
1414
main entrypoint for using [`nightly-rustc`] as a library. Initially
15-
[`run_compiler()`][i_rc] takes a configuration variable for the compiler and a
15+
[`run_compiler`][i_rc] takes a configuration variable for the compiler and a
1616
`closure` taking a yet unresolved [`Compiler`]. Operationally
17-
[`run_compiler()`][i_rc] creates a `Compiler` from the configuration and passes
17+
[`run_compiler`][i_rc] creates a `Compiler` from the configuration and passes
1818
it to the `closure`. Inside the `closure` you can use the `Compiler` to drive
1919
queries to compile a crate and get the results. Providing results about the
2020
internal state of the compiler what the [`rustc_driver`] does too. You can see
2121
a minimal example of how to use [`rustc_interface`] [here][example].
2222

23-
You can see what queries are currently available in the [`Compiler`] rustdoc.
24-
You can see an example of how to use the queries by looking at the `rustc_driver` implementation,
25-
specifically [`rustc_driver::run_compiler()`][rd_rc] (not to be confused with
26-
[`rustc_interface::run_compiler()`][i_rc]). Generally [`rustc_driver::run_compiler()`][i_rc]
27-
takes a bunch of command-line args and some other configurations and
28-
drives the compilation to completion.
23+
You can see what queries are currently available in the [`Compiler`] rustdocs.
24+
You can see an example of how to use the queries by looking at the
25+
`rustc_driver` implementation, specifically
26+
[`rustc_driver::run_compiler`][rd_rc] (not to be confused with
27+
[`rustc_interface::run_compiler`][i_rc]). Generally
28+
[`rustc_driver::run_compiler`][i_rc] takes a bunch of command-line args and
29+
some other configurations and drives the compilation to completion.
2930

30-
Finally [`rustc_driver::run_compiler()`][rd_rc] also takes a [`Callbacks`][cb],
31+
Finally [`rustc_driver::run_compiler`][rd_rc] also takes a [`Callbacks`][cb],
3132
which is a `trait` that allows for custom compiler configuration, as well as
3233
allowing custom code to run after different phases of the compilation.
3334

0 commit comments

Comments
 (0)