Support pointers in type reflection Tracking issue: rust-lang/rust#146922 This PR adds support for inspecting pointers `*const T` and `*mut T` through type reflection. It does so by adding the new `Pointer` struct + variant: ```rust pub struct Pointer { /// The type of the value being pointed to. pub ty: TypeId, /// Whether this pointer is mutable or not. pub mutable: bool, } ``` This can be gathered using `Type::of`, for example: ```rust match const { Type::of::<*const u8>() }.kind { TypeKind::Pointer(pointer) => { assert_eq!(pointer.ty, TypeId::of::<u8>()); assert!(!pointer.mutable); } _ => unreachable!(), } ``` |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| messages.ftl | ||