Skip to content
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

Fix examples to work with nightly-2025-02-13 #2256

Merged

Conversation

torfsen
Copy link
Contributor

@torfsen torfsen commented Feb 15, 2025

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. I'd be happy to include a fix if somebody can point me towards 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.

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.
@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 labels Feb 19, 2025
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@jieyouxu jieyouxu merged commit 0af2f51 into rust-lang:master Feb 19, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-custom-driver Area: custom driver A-driver Area: rustc driver S-waiting-on-review Status: this PR is waiting for a reviewer to verify its content T-compiler Relevant to compiler team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants