{"id":"b907e247c285b7ac","repo":"rust-lang/rust","slug":"shouldn-t-exist-here-b907e2","errorCode":null,"errorMessage":"{:?} shouldn't exist here","messagePattern":"(.+?) shouldn't exist here","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/rustc_ast_lowering/src/expr.rs","lineNumber":500,"sourceCode":"                    ty.as_ref().map(|ty| {\n                        self.lower_ty_alloc(\n                            ty,\n                            ImplTraitContext::Disallowed(ImplTraitPosition::Cast),\n                        )\n                    }),\n                ),\n\n                ExprKind::Dummy => {\n                    span_bug!(e.span, \"lowered ExprKind::Dummy\")\n                }\n\n                ExprKind::Try(sub_expr) => self.lower_expr_try(e.span, sub_expr),\n\n                ExprKind::Paren(_) | ExprKind::ForLoop { .. } | ExprKind::Closure(..) => {\n                    unreachable!(\"already handled\")\n                }\n\n                ExprKind::MacCall(_) => panic!(\"{:?} shouldn't exist here\", e.span),\n\n                ExprKind::DirectConstArg(expr) => {\n                    let e = self.emit_bad_direct_const_arg(e.span, expr, \"expression\");\n                    hir::ExprKind::Err(e)\n                }\n            };\n\n            hir::Expr { hir_id: expr_hir_id, kind, span }\n        })\n    }\n\n    pub(crate) fn lower_const_block(&mut self, c: &AnonConst) -> hir::ConstBlock {\n        self.with_new_scopes(c.value.span, |this| {\n            let def_id = this.local_def_id(c.id);\n            let hir_id = this.lower_node_id(c.id);\n            let (body, _) = this.with_move_expr_bindings(None, |this| {\n                this.lower_const_body(c.value.span, Some(&c.value))\n            });","sourceCodeStart":482,"sourceCodeEnd":518,"githubUrl":"https://github.com/rust-lang/rust/blob/22057b88b091743bc0fd8d592a9264f0a6951403/compiler/rustc_ast_lowering/src/expr.rs#L482-L518","documentation":"This `panic!` fires when `lower_expr_inner` encounters an `ExprKind::MacCall` — a yet-to-be-expanded macro invocation. Macro expansion runs in a prior pass (`rustc_expand`), and by the time lowering runs the AST should contain zero `MacCall` nodes. Their presence means macro expansion was incomplete, was skipped, or a procedural macro re-injected an unexpanded `MacCall` into the AST. It is an ICE pointing at the span of the offending macro call.","triggerScenarios":"Triggered when the lowering visitor reaches any node with `ExprKind::MacCall(_)` at expr.rs:500. This happens if `rustc_expand` was not run, if a proc-macro returned tokens that re-formed a `MacCall` AST node, or if an earlier expansion produced a residual unexpanded macro in expression position.","commonSituations":"Encountered by proc-macro authors whose macro returns `expr!unexpanded_macro!(...)`-shaped output, by nightly users after a regression in the expansion-to-lowering handoff, or in partially-compiled crates where a build script skipped expansion. Also seen with attribute macros that splice in token streams containing fresh macro invocations that then never get re-expanded.","solutions":["As an end user: report the ICE with the proc-macro and invocation that triggered it.","As a proc-macro author: ensure your macro emits fully-formed expressions (use `quote!` to produce concrete syntax, not nested unexpanded `MacCall` nodes); verify with `cargo expand` that no residual macro calls remain.","Check for conflicting proc-macro versions where a re-expanded token stream reintroduces a macro call into expr position.","If developing rustc: verify the expand→lower pipeline re-runs expansion over macro-generated output (expansion recursion depth)."],"exampleFix":"// before — proc-macro returns a nested unexpanded macro call as an expression\nquote! { some_unexpanded_macro!(args) }\n\n// after — emit concrete expression syntax\nquote! { { /* concrete code */ } }","handlingStrategy":"fallback","validationCode":"// \"{:?} shouldn't exist here\" is a lowering assertion that a given expr\n// kind must not reach this point. No pre-API validation exists; defense is\n// to identify and rewrite the offending expression kind.\n//\n// Approach:\n//   1. Run `cargo build` and read the span in the ICE.\n//   2. Replace the flagged expr with a standard form (e.g. swap a complex\n//      match/const-block for a plain `if`/`let`).\n//   3. Re-run; if it persists, reduce the crate to the minimal node.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Identify the expression kind at the reported span and rewrite it in a more standard form","Avoid bleeding-edge expr forms (e.g. experimental const/inline blocks) in stable code paths","Bisect commits to isolate which syntax introduced the unreachable node","File an ICE with the minimized crate; this indicates a compiler bug, not misuse"],"tags":["rustc","ast-lowering","macro-expansion","ice","proc-macro"],"analyzedSha":"22057b88b091743bc0fd8d592a9264f0a6951403","analyzedAt":"2026-08-03T08:09:25.915Z","schemaVersion":2}