{"record":{"id":"2f3fb9db69130a05","repo":"rust-lang/rust","slug":"fixme-comptime-2f3fb9","errorCode":null,"errorMessage":"FIXME(comptime)","messagePattern":"FIXME\\(comptime\\)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/rustc_trait_selection/src/traits/effects.rs","lineNumber":468,"sourceCode":"    let tcx = selcx.tcx();\n    let destruct_def_id = tcx.require_lang_item(LangItem::Destruct, obligation.cause.span);\n    let self_ty = obligation.predicate.self_ty();\n\n    let const_conditions = match *self_ty.kind() {\n        // `ManuallyDrop` is trivially `[const] Destruct` as we do not run any drop glue on it.\n        ty::Adt(adt_def, _) if adt_def.is_manually_drop() => thin_vec![],\n\n        // An ADT is `[const] Destruct` only if all of the fields are,\n        // *and* if there is a `Drop` impl, that `Drop` impl is also `[const]`.\n        ty::Adt(adt_def, args) => {\n            let mut const_conditions: ThinVec<_> = adt_def\n                .all_fields()\n                .map(|field| {\n                    ty::TraitRef::new(tcx, destruct_def_id, [field.ty(tcx, args).skip_norm_wip()])\n                })\n                .collect();\n            match adt_def.destructor(tcx).map(|dtor| tcx.constness(dtor.did)) {\n                Some(hir::Constness::Const { always: true }) => unimplemented!(\"FIXME(comptime)\"),\n                // `Drop` impl exists, but it's not const. Type cannot be `[const] Destruct`.\n                Some(hir::Constness::NotConst) => return Err(EvaluationFailure::NoSolution),\n                // `Drop` impl exists, and it's const. Require `Ty: [const] Drop` to hold.\n                Some(hir::Constness::Const { always: false }) => {\n                    let drop_def_id = tcx.require_lang_item(LangItem::Drop, obligation.cause.span);\n                    let drop_trait_ref = ty::TraitRef::new(tcx, drop_def_id, [self_ty]);\n                    const_conditions.push(drop_trait_ref);\n                }\n                // No `Drop` impl, no need to require anything else.\n                None => {}\n            }\n            const_conditions\n        }\n\n        ty::Array(ty, _) | ty::Pat(ty, _) | ty::Slice(ty) => {\n            thin_vec![ty::TraitRef::new(tcx, destruct_def_id, [ty])]\n        }\n","sourceCodeStart":450,"sourceCodeEnd":486,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/compiler/rustc_trait_selection/src/traits/effects.rs#L450-L486","documentation":"An `unimplemented!(\"FIXME(comptime)\")` ICE in `rustc_trait_selection`'s effects (const-destruct) computation. When computing the const conditions for an ADT whose `Drop` impl is `Constness::Const { always: true }`, the effects code cannot yet express those conditions and panics at effects.rs:468. This is the effects-side counterpart of adt.rs:315.","triggerScenarios":"A type has an always-const `Drop` impl, and the trait solver must evaluate whether the type implements `[const] Destruct` (i.e. const destruction is required, e.g. in a `const` context).","commonSituations":"Comptime / const-destruct experimentation on nightly producing `always: true` const destructors combined with a `[const] Destruct` obligation.","solutions":["Make the `Drop` impl non-const (or a normal const drop) so the `always: true` branch is avoided.","Disable the experimental comptime/const-destruct feature gate.","Track the upstream `FIXME(comptime)` work; upgrade when implemented."],"exampleFix":"// before (always-const drop + const Destruct obligation -> ICE)\nimpl const Drop for T { ... }\nconst fn drop_in_const(x: T) { /* needs [const] Destruct */ }\n\n// after — non-const drop, no const obligation\nimpl Drop for T { fn drop(&mut self) { ... } }","handlingStrategy":"validation","validationCode":"# Detect const Drop impls that may become always-const under comptime\nrg -nE 'impl\\s+const\\s+Drop|const\\s+fn\\s+drop' src/  # review for always-const","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not require `[const] Destruct` for types with always-const Drop.","Use non-const Drop in experimental comptime crates.","Track upstream `FIXME(comptime)`."],"tags":["rustc","trait-selection","effects","drop","const-eval","comptime","nightly","ice","compiler-internal","unfinished-feature"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}