| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
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.
|
|
|
|
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`.
|
|
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.
|
|
|
|
|
|
It has become nothing other than a wrapper around run_compiler.
|
|
They can both be set inside the config callback too.
|
|
|
|
|
|
Co-authored-by: Yuki Okushi <jtitor@2k36.org>
|
|
|
|
|
|
|
|
Closes https://github.com/rust-lang/rustc-dev-guide/issues/1581
|
|
Co-authored-by: Yuki Okushi <jtitor@2k36.org>
Closes https://github.com/rust-lang/rustc-dev-guide/issues/1556
|
|
|
|
|
|
Co-authored-by: Ujjawal Kumar <u.kumar@ukumar-ltmit1s.internal.salesforce.com>
|
|
|
|
|
|
|
|
|
|
|