-
Notifications
You must be signed in to change notification settings - Fork 558
Fix compile errors of all the examples #2289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
tshepang
merged 2 commits into
rust-lang:master
from
y1lan:fix_compiler_err_of_examples
Mar 29, 2025
Merged
Fix compile errors of all the examples #2289
tshepang
merged 2 commits into
rust-lang:master
from
y1lan:fix_compiler_err_of_examples
Mar 29, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
(https://github.com/rust-lang/rust), `ErrorGuaranteed` was replaced by fatal errors. As a result, `tcx.analysis()` now aborts directly instead of returning an error guard. To accommodate this change, this update replaces `tcx.analysis()` with `typeck()` to perform type checking in the example.
@jieyouxu
jieyouxu
added
S-waiting-on-review
Status: this PR is waiting for a reviewer to verify its content
A-driver
Area: rustc driver
T-compiler
Relevant to compiler team
A-custom-driver
Area: custom driver
and removed
A-driver
Area: rustc driver
labels
Mar 17, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
examples/rustc-driver-example.rs
,examples/rustc-driver-interacting-with-the-ast.rs
andexamples/rustc-interface-example.rs
cannot be compiled with the latest nightly toolchain (even nightly-2025年02月13日 currently), the reason is that some methods ofMap
were move toTyCtxt
. I reimplement them by using new version of these methods.examples/rustc-interface-getting-diagnostics.rs
cannot output as expected due to ErrorGuaranteed was replaced by fatal errors. I reimplement it by callingtypeck
function directly.