about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide/examples/rustc-driver-interacting-with-the-ast.rs
AgeCommit message (Collapse)AuthorLines
2025-03-30add rustfmt settings fileTshepang Mbambo-1/+1
2025-03-29update rustc-{driver,interface} examplesTshepang Mbambo-2/+2
2025-03-16Adapt to rust-lang/rust#136466:Yang Lin-5/+3
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-02-25Merge from rustcBoxy-2/+2
2025-02-17Move some `Map` methods onto `TyCtxt`.Nicholas Nethercote-1/+1
The end goal is to eliminate `Map` altogether. I added a `hir_` prefix to all of them, that seemed simplest. The exceptions are `module_items` which became `hir_module_free_items` because there was already a `hir_module_items`, and `items` which became `hir_free_items` for consistency with `hir_module_free_items`.
2025-02-15Fix examples to work with nightly-2025-02-13Florian Brucker-3/+13
While there were comments indicating which nightly versions the examples were tested with, those versions did not work for me: neither did the examples compile, nor did they produce the expected output. This commit fixes the compilation issues, using nightly-2025-02-13 for all examples (previously the version differed between the examples) and, in the case of the `rustc_driver` examples, also fixes the argument passing: rustc ignores the first argument, so we need to pass the filename as the second (otherwise we only get the help text printed). Note that the `rustc-interface-getting-diagnostics.rs` example still does not produce any output, which I assume is not how it is intended. However, I don't know enough to fix it. To avoid inconsistencies between the documented version and the actually required version I've moved the version comment from the Markdown into the Rust code where it hopefully won't be forgotten as easily. Finally I've clarified in the examples' README that you also need to use the proper nightly version when compiling the examples, not just when running them.
2025-02-03tree-wide: parallel: Fully removed all `Lrc`, replaced with `Arc`Askar Safin-2/+2
2025-01-28Make crate AST mutation accessible for driver callbackMohammad Omidvar-1/+1
2025-01-23Remove RunCompilerbjorn3-2/+2
It has become nothing other than a wrapper around run_compiler.
2025-01-23Remove set_make_codegen_backend and set_file_loaderbjorn3-7/+6
They can both be set inside the config callback too.
2024-12-27Rework the driver docs (#2162)bjorn3-66/+75
2024-05-11Update the rustc_interface examples for current rustc (#1974)Matthew Woodcraft-4/+4
2024-01-21Update examples (#1856)Shoyu Vanilla-7/+8
Co-authored-by: Yuki Okushi <jtitor@2k36.org>
2023-10-05update rustc_driver examples (#1803)Timo-0/+2
2023-03-26Add locale_resources (#1651)Nathan Hammond-0/+1
2023-02-15howto run the examples (#1593)Tshepang Mbambo-6/+1
2023-02-09update examples for rustc 1.69.0-nightly (e1eaa2d5d 2023-02-06) (#1590)Hiroki Fujino-5/+4
Closes https://github.com/rust-lang/rustc-dev-guide/issues/1581
2023-01-15fix examples for rustc 1.68.0-nightly (935dc0721 2022-12-19) (#1556) (#1557)gftea-2/+1
Co-authored-by: Yuki Okushi <jtitor@2k36.org> Closes https://github.com/rust-lang/rustc-dev-guide/issues/1556
2022-06-07improve rustc_interface examples a little (#1362)Tshepang Mbambo-6/+10
2022-05-30Update rustc-driver related examplesYuki Okushi-4/+5
2022-04-11Update examples with 1.61.0-nightly (latest version) (#1330)Ujjawal-3/+3
Co-authored-by: Ujjawal Kumar <u.kumar@ukumar-ltmit1s.internal.salesforce.com>
2021-11-24make it compile with 1.56.0Simon Perriard-2/+2
2021-03-28Update rustc-driver-*.rs examples (#1095)Undxxx-6/+5
2020-11-10Add some more examples of using the compilerJoshua Nelson-3/+15
2020-08-03Fix examples not workingTakayuki Nakata-2/+1
2020-05-07Reference complete examplesGeorge Fraser-0/+78