Skip to content

Commit

Permalink
TypeckResults::node_type() can be used inside of bodies
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Nov 26, 2023
1 parent 7af811b commit a7c59ab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion book/src/development/type_checking.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ an `u32`. As far as `hir::Ty` is concerned those might be different types. But a
understands that they're the same type, in-depth lifetimes, etc...

To get from a `hir::Ty` to a `ty::Ty`, you can use the [`hir_ty_to_ty`][hir_ty_to_ty] function outside of bodies or
outside of bodies the [`TypeckResults::node_type()`][node_type] method.
the [`TypeckResults::node_type()`][node_type] method inside of bodies.

> **Warning**: Don't use `hir_ty_to_ty` inside of bodies, because this can cause ICEs.
Expand Down

0 comments on commit a7c59ab

Please sign in to comment.