rustc-dev-guide/examples
Yang Lin 971366b58b Adapt to rust-lang/rust#136466:
Start removing `rustc_middle::hir::map::Map`

Following commit f86f7ad from pull request #136466
in the Rust project
(https://github.com/rust-lang/rust),
some methods in `Map` were moved to `TyCtxt`.
This update reimplements `rustc-drive-example.rs`,
`rustc-driver-interacting-with-the-ast.rs`,
and `rustc-interface-example.rs` using the new
versions of these methods, ensuring compatibility
with the nightly-2025-03-08 toolchain.
2025-03-16 23:27:10 +08:00
..
README Fix examples to work with nightly-2025-02-13 2025-02-15 19:44:32 +01:00
rustc-driver-example.rs Adapt to rust-lang/rust#136466: 2025-03-16 23:27:10 +08:00
rustc-driver-interacting-with-the-ast.rs Adapt to rust-lang/rust#136466: 2025-03-16 23:27:10 +08:00
rustc-interface-example.rs Adapt to rust-lang/rust#136466: 2025-03-16 23:27:10 +08:00
rustc-interface-getting-diagnostics.rs Fix examples to work with nightly-2025-02-13 2025-02-15 19:44:32 +01:00

README

For each example to compile, you will need to first run the following:

    rustup component add rustc-dev llvm-tools

To create an executable:

    rustup run nightly rustc rustc-driver-example.rs

You might need to be more specific about the exact nightly version. See the comments at the top of
the examples for the version they were written for.

To run an executable:

    rustup run nightly ./rustc-driver-example