Segfault on nightly with feature Pointer Metadata (original) (raw)
Using the Pointer Metadata feature on nightly, the following code will segfault. This is as much as I managed to minimize the issue over the last hours.
#![feature(ptr_metadata)] use std::ptr::{Thin}; use std::{fmt::Debug};
trait Parent{} trait Blanket: Parent + Thin{} //mind the + Thin which causes the SegFault
impl<T: Parent> Blanket for T{}
trait WithDebug: Blanket+Debug {} impl<T: Blanket + Debug> WithDebug for T {}
#[derive(Debug)] struct ZST; impl Parent for ZST{}
fn main() { let dyn_ref: &dyn WithDebug = &ZST; println!("segfault {:?}", dyn_ref); }
rustc --version --verbose:
rustc 1.92.0-nightly (6501e64fc 2025-10-23)
binary: rustc
commit-hash: 6501e64fcb02d22b49d6e59d10a7692ec8095619
commit-date: 2025-10-23
host: x86_64-unknown-linux-gnu
release: 1.92.0-nightly
LLVM version: 21.1.3