{"id":"d673d1279cc98475","repo":"rust-lang/rust","slug":"tuple-does-not-have-an-associated-type","errorCode":null,"errorMessage":"`Tuple` does not have an associated type: {:?}","messagePattern":"`Tuple` 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":694,"sourceCode":"            ecx.cx(),\n            goal_kind,\n            tupled_inputs_ty.expect_ty(),\n            tupled_upvars_ty.expect_ty(),\n            coroutine_captures_by_ref_ty.expect_ty(),\n            borrow_region.expect_region(),\n        );\n\n        ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc).enter(|ecx| {\n            ecx.instantiate_normalizes_to_term(goal, upvars_ty.into())?;\n            ecx.evaluate_added_goals_and_make_canonical_response(Certainty::Yes)\n        })\n    }\n\n    fn consider_builtin_tuple_candidate(\n        _ecx: &mut EvalCtxt<'_, D>,\n        goal: Goal<I, Self>,\n    ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {\n        panic!(\"`Tuple` does not have an associated type: {:?}\", goal);\n    }\n\n    fn consider_builtin_pointee_candidate(\n        ecx: &mut EvalCtxt<'_, D>,\n        goal: Goal<I, Self>,\n    ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {\n        let cx = ecx.cx();\n        let metadata_def_id = cx.require_projection_lang_item(SolverProjectionLangItem::Metadata);\n        assert_eq!(\n            ty::AliasTermKind::ProjectionTy { def_id: metadata_def_id },\n            goal.predicate.alias.kind\n        );\n        let metadata_ty = match goal.predicate.self_ty().kind() {\n            ty::Bool\n            | ty::Char\n            | ty::Int(..)\n            | ty::Uint(..)\n            | ty::Float(..)","sourceCodeStart":676,"sourceCodeEnd":712,"githubUrl":"https://github.com/rust-lang/rust/blob/22057b88b091743bc0fd8d592a9264f0a6951403/compiler/rustc_next_trait_solver/src/solve/normalizes_to.rs#L676-L712","documentation":"consider_builtin_tuple_candidate (normalizes_to.rs:694) panics unconditionally. The Tuple auto-trait (the built-in impl that lets tuple types satisfy the Fn call machinery) declares no associated types, so a NormalizesTo (projection) goal such as `<? as Tuple>::SomeAssoc` is semantically impossible. The dispatch in assembly/mod.rs routes trait goals to a real implementation in trait_goals.rs; if a projection goal for the Tuple trait ever reaches this normalizes_to.rs stub, it is an invariant violation in the solver's goal construction.","triggerScenarios":"A NormalizesTo goal whose trait_ref resolves to the Tuple lang item is passed to the next solver's builtin-candidate assembly, routing here instead of short-circuiting. This requires the solver to have built a projection goal against a trait that has no associated items — something well-formed user code cannot express directly.","commonSituations":"A nightly rustc regression in the next solver that misclassifies a goal kind; fuzzing or stress-testing the solver with adversarial projections; none of these arises from ordinary stable Rust code.","solutions":["Update to the latest nightly; this path is unreachable from valid input, so a hit implies a compiler bug that gets fixed quickly.","Disable -Znext-solver (remove the flag or use -Znext-solver=no) to fall back to the legacy solver.","Capture the full ICE backtrace and the goal printed in the panic, then file it at https://github.com/rust-lang/rust/issues.","Bisect nightly toolchains (rustup toolchain install nightly-YYYY-MM-DD) to find the commit that introduced the regression and include it in the report."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// `Tuple` is an auto/marker trait with NO associated types.\n// Anywhere you wrote `<X as Tuple>::Foo` -> remove it; this is always a bug.\n// Valid: only use `Tuple` as a bound, never as a projection target.\nfn accept_tuple<T: Tuple>() {} // OK\n","typeGuard":"// Reject at review-time: grep for `as Tuple>::` / `Tuple>::`.\n// Type-level guard that the projection is never written:\nconst _: () = { fn _no_tuple_assoc<T: Tuple>() { /* do not reference <T as Tuple>::X */ } };\n","tryCatchPattern":null,"preventionTips":["`Tuple` is a sealed auto trait; treat it as a bound only, never as an associated-type source.","If you need tuple element types, destructure via a `Tuple`-impl helper or use `frunk`/manual impls rather than projecting.","Add a clippy/macro lint that rejects the token sequence `as Tuple)>::` in source."],"tags":["rust","rustc","trait-solver","next-solver","ice","panic","builtin-impl","associated-type","tuple"],"analyzedSha":"22057b88b091743bc0fd8d592a9264f0a6951403","analyzedAt":"2026-08-03T08:09:25.915Z","schemaVersion":2}