From 2af2e27bc760325fee8762d201096b6ef770b745 Mon Sep 17 00:00:00 2001 From: Youngsuk Kim Date: Thu, 7 Nov 2019 23:19:08 -0500 Subject: [PATCH 1/3] Clarify function name and add links rustc_interface::interface::run_compiler (https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/fn.run_compiler.html) --- src/rustc-driver.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rustc-driver.md b/src/rustc-driver.md index 715e6295d..77bda90f4 100644 --- a/src/rustc-driver.md +++ b/src/rustc-driver.md @@ -9,7 +9,7 @@ for running code at particular times during the compilation process, allowing third parties to effectively use `rustc`'s internals as a library for analysing a crate or emulating the compiler in-process (e.g. the RLS or rustdoc). -For those using `rustc` as a library, the `interface::run_compiler()` function is the main +For those using `rustc` as a library, the [`rustc_interface::interface::run_compiler()`][int_rc] function is the main entrypoint to the compiler. It takes a configuration for the compiler and a closure that takes a [`Compiler`]. `run_compiler` creates a `Compiler` from the configuration and passes it to the closure. Inside the closure, you can use the `Compiler` to drive queries to compile @@ -18,7 +18,7 @@ a crate and get the results. This is what the `rustc_driver` does too. You can see what queries are currently available through the rustdocs for [`Compiler`]. You can see an example of how to use them by looking at the `rustc_driver` implementation, specifically the [`rustc_driver::run_compiler` function][rd_rc] (not to be confused with -`interface::run_compiler`). The `rustc_driver::run_compiler` function takes a bunch of +[`rustc_interface::interface::run_compiler`][int_rc]). The `rustc_driver::run_compiler` function takes a bunch of command-line args and some other configurations and drives the compilation to completion. `rustc_driver::run_compiler` also takes a [`Callbacks`][cb]. In the past, when @@ -47,6 +47,7 @@ thread-locals, although you should rarely need to touch it. [cb]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/trait.Callbacks.html [rd_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/fn.run_compiler.html +[int_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/fn.run_compiler.html [`rustc_interface`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/index.html [`rustc_driver`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/ [`Compiler`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/struct.Compiler.html From 85f6f102f5af5e6ec18e60a91069d259b07c150a Mon Sep 17 00:00:00 2001 From: Youngsuk Kim Date: Thu, 7 Nov 2019 23:30:03 -0500 Subject: [PATCH 2/3] Tried to reduce column count in some rows --- src/rustc-driver.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rustc-driver.md b/src/rustc-driver.md index 77bda90f4..d7f2d7d88 100644 --- a/src/rustc-driver.md +++ b/src/rustc-driver.md @@ -9,8 +9,8 @@ for running code at particular times during the compilation process, allowing third parties to effectively use `rustc`'s internals as a library for analysing a crate or emulating the compiler in-process (e.g. the RLS or rustdoc). -For those using `rustc` as a library, the [`rustc_interface::interface::run_compiler()`][int_rc] function is the main -entrypoint to the compiler. It takes a configuration for the compiler and a closure that +For those using `rustc` as a library, the [`rustc_interface::interface::run_compiler()`][i_rc] function +is the main entrypoint to the compiler. It takes a configuration for the compiler and a closure that takes a [`Compiler`]. `run_compiler` creates a `Compiler` from the configuration and passes it to the closure. Inside the closure, you can use the `Compiler` to drive queries to compile a crate and get the results. This is what the `rustc_driver` does too. @@ -18,8 +18,8 @@ a crate and get the results. This is what the `rustc_driver` does too. You can see what queries are currently available through the rustdocs for [`Compiler`]. You can see an example of how to use them by looking at the `rustc_driver` implementation, specifically the [`rustc_driver::run_compiler` function][rd_rc] (not to be confused with -[`rustc_interface::interface::run_compiler`][int_rc]). The `rustc_driver::run_compiler` function takes a bunch of -command-line args and some other configurations and drives the compilation to completion. +[`rustc_interface::interface::run_compiler`][i_rc]). The `rustc_driver::run_compiler` function takes +a bunch of command-line args and some other configurations and drives the compilation to completion. `rustc_driver::run_compiler` also takes a [`Callbacks`][cb]. In the past, when the `rustc_driver::run_compiler` was the primary way to use the compiler as a @@ -47,7 +47,7 @@ thread-locals, although you should rarely need to touch it. [cb]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/trait.Callbacks.html [rd_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/fn.run_compiler.html -[int_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/fn.run_compiler.html +[i_rc]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/fn.run_compiler.html [`rustc_interface`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/index.html [`rustc_driver`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_driver/ [`Compiler`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_interface/interface/struct.Compiler.html From fcf1eed6007abd0232afb0c866be8e177e3a9b77 Mon Sep 17 00:00:00 2001 From: JOE1994 Date: Thu, 7 Nov 2019 23:41:14 -0500 Subject: [PATCH 3/3] render all lines to be of width less than 100 chars --- src/rustc-driver.md | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/rustc-driver.md b/src/rustc-driver.md index d7f2d7d88..f2ed1bab8 100644 --- a/src/rustc-driver.md +++ b/src/rustc-driver.md @@ -9,17 +9,18 @@ for running code at particular times during the compilation process, allowing third parties to effectively use `rustc`'s internals as a library for analysing a crate or emulating the compiler in-process (e.g. the RLS or rustdoc). -For those using `rustc` as a library, the [`rustc_interface::interface::run_compiler()`][i_rc] function -is the main entrypoint to the compiler. It takes a configuration for the compiler and a closure that -takes a [`Compiler`]. `run_compiler` creates a `Compiler` from the configuration and passes -it to the closure. Inside the closure, you can use the `Compiler` to drive queries to compile -a crate and get the results. This is what the `rustc_driver` does too. +For those using `rustc` as a library, the [`rustc_interface::interface::run_compiler()`][i_rc] +function is the main entrypoint to the compiler. It takes a configuration for the compiler +and a closure that takes a [`Compiler`]. `run_compiler` creates a `Compiler` from the +configuration and passes it to the closure. Inside the closure, you can use the `Compiler` +to drive queries to compile a crate and get the results. This is what the `rustc_driver` does too. You can see what queries are currently available through the rustdocs for [`Compiler`]. You can see an example of how to use them by looking at the `rustc_driver` implementation, specifically the [`rustc_driver::run_compiler` function][rd_rc] (not to be confused with -[`rustc_interface::interface::run_compiler`][i_rc]). The `rustc_driver::run_compiler` function takes -a bunch of command-line args and some other configurations and drives the compilation to completion. +[`rustc_interface::interface::run_compiler`][i_rc]). The `rustc_driver::run_compiler` function +takes a bunch of command-line args and some other configurations and +drives the compilation to completion. `rustc_driver::run_compiler` also takes a [`Callbacks`][cb]. In the past, when the `rustc_driver::run_compiler` was the primary way to use the compiler as a