Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 0b5dd42

Browse files
committed
Add some comments about why never!() never happens
1 parent d33d5fc commit 0b5dd42

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

crates/hir_ty/src/lower.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,8 @@ impl<'a> TyLoweringContext<'a> {
749749
had_explicit_args = true;
750750
substs.push(x);
751751
} else {
752-
never!();
752+
// we just filtered them out
753+
never!("Unexpected lifetime argument");
753754
}
754755
}
755756
}
@@ -1673,6 +1674,10 @@ pub(crate) fn lower_to_chalk_mutability(m: hir_def::type_ref::Mutability) -> Mut
16731674
}
16741675
}
16751676

1677+
/// Checks if the provided generic arg matches its expected kind, then lower them via
1678+
/// provided closures. Use unknown if there was kind mismatch.
1679+
///
1680+
/// Returns `Some` of the lowered generic arg. `None` if the provided arg is a lifetime.
16761681
pub(crate) fn generic_arg_to_chalk<'a, T>(
16771682
db: &dyn HirDatabase,
16781683
kind_id: Either<TypeParamId, ConstParamId>,

0 commit comments

Comments
 (0)