{"record":{"id":"f0912a7cf081e541","repo":"rust-lang/rust","slug":"missing-qself-for-t","errorCode":null,"errorMessage":"missing QSelf for <T>::...","messagePattern":"missing QSelf for <T>::\\.\\.\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler/rustc_ast_lowering/src/path.rs","lineNumber":168,"sourceCode":"        if let Some(bound_modifier_allowed_features) = bound_modifier_allowed_features {\n            path.span = self.mark_span_with_reason(\n                DesugaringKind::BoundModifier,\n                path.span,\n                Some(bound_modifier_allowed_features),\n            );\n        }\n\n        // Simple case, either no projections, or only fully-qualified.\n        // E.g., `std::mem::size_of` or `<I as Iterator>::Item`.\n        if unresolved_segments == 0 {\n            return hir::QPath::Resolved(qself, path);\n        }\n\n        // Create the innermost type that we're projecting from.\n        let mut ty = if path.segments.is_empty() {\n            // If the base path is empty that means there exists a\n            // syntactical `Self`, e.g., `&i32` in `<&i32>::clone`.\n            qself.expect(\"missing QSelf for <T>::...\")\n        } else {\n            // Otherwise, the base path is an implicit `Self` type path,\n            // e.g., `Vec` in `Vec::new` or `<I as Iterator>::Item` in\n            // `<I as Iterator>::Item::default`.\n            let new_id = self.next_id();\n            self.arena.alloc(self.ty_path(new_id, path.span, hir::QPath::Resolved(qself, path)))\n        };\n\n        // Anything after the base path are associated \"extensions\",\n        // out of which all but the last one are associated types,\n        // e.g., for `std::vec::Vec::<T>::IntoIter::Item::clone`:\n        // * base path is `std::vec::Vec<T>`\n        // * \"extensions\" are `IntoIter`, `Item` and `clone`\n        // * type nodes are:\n        //   1. `std::vec::Vec<T>` (created above)\n        //   2. `<std::vec::Vec<T>>::IntoIter`\n        //   3. `<<std::vec::Vec<T>>::IntoIter>::Item`\n        // * final path is `<<<std::vec::Vec<T>>::IntoIter>::Item>::clone`","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/compiler/rustc_ast_lowering/src/path.rs#L150-L186","documentation":"path.rs:168: when lowering a path with associated projections (unresolved_segments != 0) and an empty base path, the code does qself.expect(\"missing QSelf for <T>::...\"). The invariant: an empty base path with trailing projections implies a syntactic Self (e.g. `<&i32>::clone`), so a QSelf must be present.","triggerScenarios":"Path lowering encounters a `<...>::proj` form where the base segments are empty but qself is None, an inconsistent state produced by an earlier lowering/resolution step.","commonSituations":"Compiler bug in path lowering for fully-qualified associated paths; not reachable from well-formed source.","solutions":["File a rustc ICE with the minimized path expression that triggers it.","Rewrite the associated path to avoid the empty-base-with-projection form (use an explicit type base).","Bisect across nightlies with cargo bisect-rustc.","Try the equivalent code on stable to confirm it is a regression."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat as a compiler ICE; report with the minimized path expression.","Rewrite associated paths to use an explicit type base rather than an empty-base projection.","Bisect with cargo bisect-rustc and try stable.","Pin to a known-good nightly."],"tags":["rust","path-lowering","compiler-internal","ice"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}