{"id":"48ddc3b945aafaa3","repo":"rust-lang/rust","slug":"tuple-trait-is-not-const","errorCode":null,"errorMessage":"Tuple trait is not const","messagePattern":"Tuple trait is not const","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/rustc_next_trait_solver/src/solve/effect_goals.rs","lineNumber":364,"sourceCode":"        _ecx: &mut EvalCtxt<'_, D>,\n        _goal: Goal<I, Self>,\n        _kind: rustc_type_ir::ClosureKind,\n    ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {\n        unimplemented!(\"AsyncFn* are not yet const\")\n    }\n\n    fn consider_builtin_async_fn_kind_helper_candidate(\n        _ecx: &mut EvalCtxt<'_, D>,\n        _goal: Goal<I, Self>,\n    ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {\n        unreachable!(\"AsyncFnKindHelper is not const\")\n    }\n\n    fn consider_builtin_tuple_candidate(\n        _ecx: &mut EvalCtxt<'_, D>,\n        _goal: Goal<I, Self>,\n    ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {\n        unreachable!(\"Tuple trait is not const\")\n    }\n\n    fn consider_builtin_pointee_candidate(\n        _ecx: &mut EvalCtxt<'_, D>,\n        _goal: Goal<I, Self>,\n    ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {\n        unreachable!(\"Pointee is not const\")\n    }\n\n    fn consider_builtin_future_candidate(\n        _ecx: &mut EvalCtxt<'_, D>,\n        _goal: Goal<I, Self>,\n    ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {\n        unreachable!(\"Future is not const\")\n    }\n\n    fn consider_builtin_iterator_candidate(\n        _ecx: &mut EvalCtxt<'_, D>,","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/rust-lang/rust/blob/22057b88b091743bc0fd8d592a9264f0a6951403/compiler/rustc_next_trait_solver/src/solve/effect_goals.rs#L346-L382","documentation":"`consider_builtin_tuple_candidate` (effect_goals.rs:364) is `unreachable!`. The built-in impl of the `Tuple` auto-trait (which marks types that are tuple-like / not unit) is never const — there is no notion of a `const Tuple` bound. Reaching this branch means a `T: const Tuple` host-effect goal was assembled, which is invalid by construction.","triggerScenarios":"Reached when the next solver evaluates a `HostEffectPredicate` for the `Tuple` trait (lang item) with a const effect and falls into the built-in tuple candidate branch (effect_goals.rs:360).","commonSituations":"Nightly with `const_trait_impl` and a variadic-tuple generic that ends up emitting a `const Tuple` obligation; interaction of `host_effects` with `min_const_generics`/tuple-impl-trait machinery; solver regression.","solutions":["Audit const bounds to ensure none transitively requires `const Tuple` (it is never satisfiable).","Disable `const_trait_impl` / `-Znext-solver` to confirm the feature-gated path is the cause.","Reduce to a minimal reproducer and file an ICE report.","Upgrade nightly — host-effects assembly is under active revision."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// The Tuple lang trait is not const. Reject tuple-construction in const eval that needs the trait.\n// i.e. do not require `T: Tuple` (or rely on tuple trait bounds) inside a const obligation.\nconst fn no_tuple_trait_in_const<T>(_t: &T) where T: Sized {}\n// (avoid `where T: std::tuple::Tuple` style bounds in const fn)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't introduce custom tuple-trait bounds (nightly `Tuple` trait) and then evaluate them in const contexts.","If you need compile-time tuples, use explicit struct types or concrete tuple arities instead of a generic `T: Tuple` bound.","Keep nightly tuple-trait experimentation out of crates that ship const-generic APIs."],"tags":["rustc-ice","const-traits","host-effects","tuple","auto-traits","nightly","compiler-internal"],"analyzedSha":"22057b88b091743bc0fd8d592a9264f0a6951403","analyzedAt":"2026-08-03T08:09:25.915Z","schemaVersion":2}