Skip to content

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

Description

@Hiroki6

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions