Skip to content

Commit 1f0c4f0

Browse files
simon-perriardjyn514
authored andcommitted
make it compile with 1.56.0
1 parent 6a27fc2 commit 1f0c4f0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/rustc-driver-interacting-with-the-ast.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ fn main() {
6464
// Analyze the crate and inspect the types under the cursor.
6565
queries.global_ctxt().unwrap().take().enter(|tcx| {
6666
// Every compilation contains a single crate.
67-
let hir_krate = tcx.hir().krate();
67+
let hir_krate = tcx.hir();
6868
// Iterate over the top-level items in the crate, looking for the main function.
69-
for (_, item) in &hir_krate.items {
69+
for item in hir_krate.items() {
7070
// Use pattern-matching to find a specific node inside the main function.
7171
if let rustc_hir::ItemKind::Fn(_, _, body_id) = item.kind {
7272
let expr = &tcx.hir().body(body_id).value;

0 commit comments

Comments
 (0)