Hello there ,
I am trying to get the examples from the rustc dev guide to compile:
What I did is:
- Create a new binary crate and copy paste one of the example (assuming this one )
- Install the
nightly-2021-03-28
toolchain withrustup toolchain install nightly-2021-03-28 --profile minimal
- Install the
rustc-dev
andllvm-tools-preview
components withrustup component add rustc-dev llvm-tools-preview --toolchain nightly-2021-03-28
Now, I try to run the example with cargo +nightly-20201-03-28 run
, but I get the following error:
error[E0599]: no method named `items` found for struct `rustc_middle::hir::map::Map<'_>` in the current scope
--> src/main.rs:76:39
|
76 | for item in tcx.hir().items() {
| ^^^^^ help: there is an associated function with a similar name: `item`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0599`.
I don't understand where this error comes from because the docs seem to show that this entry point is still available.
Any idea how to fix that ?
Best,
Alex