Make warning about hir_ty_to_ty more visible

This commit is contained in:
Philipp Krones 2023-04-16 21:08:59 +02:00
parent fbb69dea91
commit b842e99ddf
No known key found for this signature in database
GPG Key ID: 1CA0DF2AF59D68A5

View File

@ -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