{"id":"0f1690c9fce58e99","repo":"rust-lang/rust","slug":"destruct-does-not-have-an-associated-type","errorCode":null,"errorMessage":"`Destruct` does not have an associated type: {:?}","messagePattern":"`Destruct` does not have an associated type: (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"compiler/rustc_next_trait_solver/src/solve/normalizes_to.rs","lineNumber":1040,"sourceCode":"            ty::Infer(ty::TyVar(_) | ty::FreshTy(_) | ty::FreshIntTy(_) | ty::FreshFloatTy(_))\n            | ty::Alias(ty::IsRigid::No, _)\n            | ty::Bound(..) => panic!(\n                \"unexpected self ty `{:?}` when normalizing `<T as DiscriminantKind>::Discriminant`\",\n                goal.predicate.self_ty()\n            ),\n        };\n\n        ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc).enter(|ecx| {\n            ecx.instantiate_normalizes_to_term(goal, discriminant_ty.into())?;\n            ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)\n        })\n    }\n\n    fn consider_builtin_destruct_candidate(\n        _ecx: &mut EvalCtxt<'_, D>,\n        goal: Goal<I, Self>,\n    ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {\n        panic!(\"`Destruct` does not have an associated type: {:?}\", goal);\n    }\n\n    fn consider_builtin_transmute_candidate(\n        _ecx: &mut EvalCtxt<'_, D>,\n        goal: Goal<I, Self>,\n    ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {\n        panic!(\"`TransmuteFrom` does not have an associated type: {:?}\", goal)\n    }\n\n    fn consider_builtin_bikeshed_guaranteed_no_drop_candidate(\n        _ecx: &mut EvalCtxt<'_, D>,\n        goal: Goal<I, Self>,\n    ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {\n        unreachable!(\"`BikeshedGuaranteedNoDrop` does not have an associated type: {:?}\", goal)\n    }\n\n    fn consider_builtin_field_candidate(\n        ecx: &mut EvalCtxt<'_, D>,","sourceCodeStart":1022,"sourceCodeEnd":1058,"githubUrl":"https://github.com/rust-lang/rust/blob/22057b88b091743bc0fd8d592a9264f0a6951403/compiler/rustc_next_trait_solver/src/solve/normalizes_to.rs#L1022-L1058","documentation":"consider_builtin_destruct_candidate (normalizes_to.rs:1040) panics unconditionally. The Destruct auto-trait (the destructor-presence analysis that replaced ad-hoc Drop checking) declares no associated types, so a NormalizesTo projection goal against Destruct is impossible. Trait goals for Destruct are handled by a real implementation in trait_goals.rs; reaching this normalizes_to.rs stub means the solver built a projection goal for an associated-type-less trait.","triggerScenarios":"A NormalizesTo goal whose trait_ref is the Destruct lang item is routed into the next-solver builtin-candidate assembly. Valid Rust cannot project an associated type off Destruct, so this is an internal goal-construction/routing bug.","commonSituations":"Nightly rustc regression in the next solver's Destruct handling (the Destruct trait is itself relatively new and under active change); fuzzing; not produced by ordinary drop/destructor code.","solutions":["Update to the latest nightly (rustup update nightly).","Disable -Znext-solver (remove the flag or -Znext-solver=no).","File an ICE at https://github.com/rust-lang/rust/issues including the goal from the panic and a minimal reproducer.","Bisect nightlies to find the introducing commit."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// `Destruct` (drop-check lang trait, nightly) is a marker with NO assoc types.\n// Use only as a bound: `T: Destruct`. Never `<T as Destruct>::X`.\nfn needs_destruct<T: core::ops::Destruct>() {} // OK\n","typeGuard":"trait _GuardDestruct<T: core::ops::Destruct> {} // bound-only sentinel\n","tryCatchPattern":null,"preventionTips":["`Destruct` is nightly-only and a marker; never project off it.","Gate nightly drop-check features behind `#[cfg(feature = \"nightly\")]`.","Lint against `as Destruct)>::`."],"tags":["rust","rustc","trait-solver","next-solver","ice","panic","builtin-impl","destruct","associated-type"],"analyzedSha":"22057b88b091743bc0fd8d592a9264f0a6951403","analyzedAt":"2026-08-03T08:09:25.915Z","schemaVersion":2}