diff options
| author | Philipp Krones <hello@philkrones.com> | 2023-04-16 21:08:59 +0200 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2023-04-16 21:08:59 +0200 |
| commit | b842e99ddf9776a480ca911702195922b2603c3b (patch) | |
| tree | 2fe6a94b6769b394fd2565ba12a6fabee2c2b71e | |
| parent | fbb69dea9156d73d2e73361aab8164bb1c0074e6 (diff) | |
Make warning about hir_ty_to_ty more visible
| -rw-r--r-- | book/src/development/type_checking.md | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/book/src/development/type_checking.md b/book/src/development/type_checking.md index e4398885be0..225de849566 100644 --- a/book/src/development/type_checking.md +++ b/book/src/development/type_checking.md @@ -119,8 +119,9 @@ 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. Don't use `hir_ty_to_ty` inside of bodies, -because this can cause ICEs. +outside of bodies the [`TypeckResults::node_type()`][node_type] method. + +> **Warning**: Don't use `hir_ty_to_ty` inside of bodies, because this can cause ICEs. ## Useful Links |
