{"record":{"id":"3c733cd1200a1b3a","repo":"diem/diem","slug":"ice-expansion-failed","errorCode":null,"errorMessage":"ICE expansion failed","messagePattern":"ICE expansion failed","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"language/move-lang/src/cfgir/locals/mod.rs","lineNumber":369,"sourceCode":"            t\n        ),\n    };\n    crate::typing::core::ability_not_satisified_tips(\n        &crate::typing::core::Subst::empty(),\n        diag,\n        Ability_::Drop,\n        &ty,\n        declared_loc_opt,\n        declared_abilities,\n        ty_args.iter().map(|ty_arg| {\n            let abilities = match &ty_arg.value {\n                T::Unit => AbilitySet::collection(ty_arg.loc),\n                T::Ref(_, _) => AbilitySet::references(ty_arg.loc),\n                T::UnresolvedError | T::Anything => AbilitySet::all(ty_arg.loc),\n                T::Param(TParam { abilities, .. }) | T::Apply(Some(abilities), _, _) => {\n                    abilities.clone()\n                }\n                T::Var(_) | T::Apply(None, _, _) => panic!(\"ICE expansion failed\"),\n            };\n            (ty_arg, abilities)\n        }),\n    )\n}\n\nfn single_type_to_naming_type(sp!(loc, st_): SingleType) -> N::Type {\n    sp(loc, single_type_to_naming_type_(st_))\n}\n\nfn single_type_to_naming_type_(st_: SingleType_) -> N::Type_ {\n    use SingleType_ as S;\n    use N::Type_ as T;\n    match st_ {\n        S::Ref(mut_, b) => T::Ref(mut_, Box::new(base_type_to_naming_type(b))),\n        S::Base(sp!(_, b_)) => base_type_to_naming_type_(b_),\n    }\n}","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/diem/diem/blob/fc4714a8ea273b6efe8b13dbce72ea60aad9a16c/language/move-lang/src/cfgir/locals/mod.rs#L351-L387","documentation":"This ICE panic in `add_drop_ability_tip` (language/move-lang/src/cfgir/locals/mod.rs:369) fires when computing abilities for a type argument and the type is still `T::Var(_)` or `T::Apply(None, _, _)` — i.e. the type-expansion pass has not run or failed. The compiler expects every type reaching CFGIR analysis to be fully expanded with concrete abilities. It indicates a broken internal invariant, typically a compiler bug.","triggerScenarios":"Type expansion did not resolve a type variable or left an unexpanded `T::Apply(None, ...)` node, and locals analysis then inspects that type argument while constructing a drop-ability tip from a `command` or `lvalue`.","commonSituations":"Compiling code containing types the expansion pass could not resolve (unresolved module/type names that were not surfaced as errors earlier); compiler bugs/regressions; stale intermediate artifacts from a mismatched compiler version.","solutions":["Fix the unresolved type references in the Move source so expansion succeeds (check imports and type names) before the analysis runs.","Minimize the failing program and report the ICE to the Move compiler maintainers.","Retry with a different/newer compiler version where the expansion bug may be fixed."],"exampleFix":"// before (type that fails to expand)\nlet x: UnknownType = ...;\n\n// after (fully resolvable type)\nuse 0x1::vector;\nlet x: vector<u8> = vector::empty();","handlingStrategy":"validation","validationCode":"// ensure all imports/types resolve before compilation\n// (check compiler diagnostics after parsing/expansion pass)\nif diagnostics_after_expansion(env) { return Err(\"unresolved types\"); }","typeGuard":null,"tryCatchPattern":"std::panic::catch_unwind(|| run_cfgir_locals(ast))\n    .map_err(|_| \"compiler ICE: unexpanded type\")?;","preventionTips":["Fix all unresolved type/import errors before later compilation phases.","Do not run CFGIR passes manually on partially-expanded ASTs.","Report minimized ICEs and update the compiler to a fixed release."],"tags":["rust","move-compiler","ice","panic","type-expansion"],"backgroundTag":"compiler-internal-error","analyzedSha":"fc4714a8ea273b6efe8b13dbce72ea60aad9a16c","analyzedAt":"2026-09-04T21:07:05.890Z","contentChangedAt":"2026-09-04T21:07:05.890Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}