Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/utils.rs')
-rw-r--r--crates/hir-ty/src/utils.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/hir-ty/src/utils.rs b/crates/hir-ty/src/utils.rs
index f640242f3b..ba98bbe3ed 100644
--- a/crates/hir-ty/src/utils.rs
+++ b/crates/hir-ty/src/utils.rs
@@ -230,8 +230,8 @@ pub(super) fn associated_type_by_name_including_super_traits(
}
/// It is a bit different from the rustc equivalent. Currently it stores:
-/// - 0: the function signature, encoded as a function pointer type
-/// - 1..n: generics of the parent
+/// - 0..n-1: generics of the parent
+/// - n: the function signature, encoded as a function pointer type
///
/// and it doesn't store the closure types and fields.
///
@@ -242,7 +242,7 @@ pub(crate) struct ClosureSubst<'a>(pub(crate) &'a Substitution);
impl<'a> ClosureSubst<'a> {
pub(crate) fn parent_subst(&self) -> &'a [GenericArg] {
match self.0.as_slice(Interner) {
- [_, x @ ..] => x,
+ [x @ .., _] => x,
_ => {
never!("Closure missing parameter");
&[]
@@ -252,7 +252,7 @@ impl<'a> ClosureSubst<'a> {
pub(crate) fn sig_ty(&self) -> &'a Ty {
match self.0.as_slice(Interner) {
- [x, ..] => x.assert_ty_ref(Interner),
+ [.., x] => x.assert_ty_ref(Interner),
_ => {
unreachable!("Closure missing sig_ty parameter");
}