rust/compiler/rustc_const_eval
Jonathan Brouwer 25e6f5cda7
Rollup merge of #151119 - reflect-pointers, r=oli-obk
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!(),
}
```
2026-01-19 20:53:22 +01:00
..
src Rollup merge of #151119 - reflect-pointers, r=oli-obk 2026-01-19 20:53:22 +01:00
Cargo.toml Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
messages.ftl Fix capitalization of error messages 2026-01-18 22:40:55 +01:00