Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/lower/path.rs')
-rw-r--r--crates/hir-ty/src/lower/path.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir-ty/src/lower/path.rs b/crates/hir-ty/src/lower/path.rs
index 554a191d9d..c67c69520d 100644
--- a/crates/hir-ty/src/lower/path.rs
+++ b/crates/hir-ty/src/lower/path.rs
@@ -1234,6 +1234,12 @@ pub(crate) fn substs_from_args_and_bindings<'db>(
};
params.next();
substs.push(self_ty);
+ } else if has_self_arg {
+ // A qualified path `<T as Trait>::Assoc` where `Trait` resolved to something without a
+ // `Self` parameter, e.g. a struct. `check_generic_args_len()` skips the self type
+ // unconditionally, so drop it here too instead of matching it against a real parameter.
+ // FIXME: Report a diagnostic here, rustc emits `E0404: expected trait, found struct`.
+ args.next();
}
loop {