{"id":"b2e2328c260d2cc6","repo":"rust-lang/rust","slug":"fusediterator-does-not-have-an-associated-type","errorCode":null,"errorMessage":"`FusedIterator` does not have an associated type: {:?}","messagePattern":"`FusedIterator` 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":884,"sourceCode":"                    cx.alias_term_kind_from_def_id(\n                        goal.predicate.alias.expect_projection_def_id().into(),\n                    ),\n                    [self_ty],\n                ),\n                term,\n            }\n            .upcast(cx),\n            // Technically, we need to check that the iterator type is Sized,\n            // but that's already proven by the generator being WF.\n            [],\n        )\n    }\n\n    fn consider_builtin_fused_iterator_candidate(\n        _ecx: &mut EvalCtxt<'_, D>,\n        goal: Goal<I, Self>,\n    ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {\n        panic!(\"`FusedIterator` does not have an associated type: {:?}\", goal);\n    }\n\n    fn consider_builtin_async_iterator_candidate(\n        ecx: &mut EvalCtxt<'_, D>,\n        goal: Goal<I, Self>,\n    ) -> Result<Candidate<I>, NoSolutionOrRerunNonErased> {\n        let self_ty = goal.predicate.self_ty();\n        let ty::Coroutine(def_id, args) = self_ty.kind() else {\n            return Err(NoSolution.into());\n        };\n\n        // Coroutines are not AsyncIterators unless they come from `gen` desugaring\n        let cx = ecx.cx();\n        if !cx.coroutine_is_async_gen(def_id) {\n            return Err(NoSolution.into());\n        }\n\n        ecx.probe_builtin_trait_candidate(BuiltinImplSource::Misc).enter(|ecx| {","sourceCodeStart":866,"sourceCodeEnd":902,"githubUrl":"https://github.com/rust-lang/rust/blob/22057b88b091743bc0fd8d592a9264f0a6951403/compiler/rustc_next_trait_solver/src/solve/normalizes_to.rs#L866-L902","documentation":"consider_builtin_fused_iterator_candidate (normalizes_to.rs:884) panics unconditionally. The FusedIterator marker trait (core::iter::FusedIterator) has no associated types, so a NormalizesTo projection goal against it is impossible. assembly/mod.rs only routes FusedIterator trait goals (handled in trait_goals.rs); reaching this normalizes_to.rs stub means the solver erroneously built a projection goal for an associated-type-less trait.","triggerScenarios":"A NormalizesTo goal whose trait_ref is the FusedIterator lang item reaches the next-solver builtin-candidate assembly. This cannot arise from valid surface Rust (FusedIterator has no associated items to project) and signals an internal solver/goal-construction bug.","commonSituations":"Nightly rustc regression in the next solver's goal-kind classification; adversarial fuzzing of the solver; not produced by normal iterator/fusion code.","solutions":["Update to the latest nightly (rustup update nightly).","Disable -Znext-solver (remove the flag or -Znext-solver=no).","File an ICE at https://github.com/rust-lang/rust/issues with the goal printed in the panic and a minimal reproducer.","Bisect nightlies to locate the introducing commit."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// FusedIterator is a marker trait (no assoc types/items).\n// Use it only as `T: Iterator + FusedIterator`; never `<I as FusedIterator>::X`.\nfn fused_only<I: Iterator + FusedIterator>() {} // OK\n","typeGuard":"trait _GuardFused<I: Iterator + FusedIterator> {} // compile-time-only sentinel\n","tryCatchPattern":null,"preventionTips":["Treat `FusedIterator` as a behavioral marker; it carries no associated items.","Project `Item` from `Iterator`, never from `FusedIterator`.","Lint against the token `as FusedIterator)>::`."],"tags":["rust","rustc","trait-solver","next-solver","ice","panic","builtin-impl","associated-type","fused-iterator"],"analyzedSha":"22057b88b091743bc0fd8d592a9264f0a6951403","analyzedAt":"2026-08-03T08:09:25.915Z","schemaVersion":2}