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

Update the rustc-driver examples to play with the latest nightly #1581

Closed
Hiroki6 opened this issue Feb 3, 2023 · 2 comments · Fixed by #1590
Closed

Update the rustc-driver examples to play with the latest nightly #1581

Hiroki6 opened this issue Feb 3, 2023 · 2 comments · Fixed by #1590

Comments

@Hiroki6
Copy link
Contributor

Hiroki6 commented Feb 3, 2023

I tried to compile the examples in rustc 1.69.0-nightly (f3126500f 2023-02-02)

$ rustup -V
rustup 1.25.2 (17db695f1 2023-02-01)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.69.0-nightly (f3126500f 2023-02-02)`

$ rustc +nightly rustc-driver-interacting-with-the-ast.rs
$ rustc +nightly rustc-driver-getting-diagnostics.rs
$ rustc +nightly rustc-driver-example.rs

All of them raised errors

error[E0560]: struct `rustc_interface::Config` has no field named `input_path`
  --> rustc-driver-example.rs:49:9
   |
49 |         input_path: None,  // Option<PathBuf>
   |         ^^^^^^^^^^ `rustc_interface::Config` does not have this field
   |
   = note: available fields are: `opts`, `crate_cfg`, `crate_check_cfg`, `input`, `output_dir` ... and 8 others

error[E0599]: `rustc_interface::queries::QueryResult<'_, rustc_ast::ast::Crate>` is not an iterator
    --> rustc-driver-example.rs:74:50
     |
74   |             let parse = queries.parse().unwrap().take();
     |                                                  ^^^^ `rustc_interface::queries::QueryResult<'_, rustc_ast::ast::Crate>` is not an iterator

error[E0599]: `rustc_interface::queries::QueryResult<'_, rustc_interface::passes::QueryContext<'_>>` is not an iterator
    --> rustc-driver-example.rs:77:44
     |
77   |             queries.global_ctxt().unwrap().take().enter(|tcx| {
     |                                            ^^^^ `rustc_interface::queries::QueryResult<'_, rustc_interface::passes::QueryContext<'_>>` is not an iterator

error: aborting due to 3 previous errors
@JohnTitor
Copy link
Member

Please note that, as mentioned in

// version: rustc 1.68.0-nightly (935dc0721 2022-12-19)
, we expect this example to compile with the fixed version. However, a PR to update it would be welcome!

@Hiroki6
Copy link
Contributor Author

Hiroki6 commented Feb 4, 2023

, we expect this example to compile with the fixed version. However, a PR to update it would be welcome!

yes, I knew it.
Sorry, I meant it should be updated with the latest one.

I will try to update it.

@JohnTitor JohnTitor changed the title fail to compile examples with 1.69.0-nightly Update the rustc-driver examples to play with the latest nightly Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants