Unnamed repository; edit this file 'description' to name the repository.
Merge pull request #21879 from cuiweixie/fix/generics-type-or-const-idx-bound
fix: Correct type_or_const param index bound in debug_assert
Chayim Refael Friedman 7 weeks ago
parent 9253d39 · parent 834ad9c · commit 4d9af83
-rw-r--r--crates/hir-ty/src/generics.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/hir-ty/src/generics.rs b/crates/hir-ty/src/generics.rs
index b1500bcdb7..b3c888da8e 100644
--- a/crates/hir-ty/src/generics.rs
+++ b/crates/hir-ty/src/generics.rs
@@ -185,7 +185,7 @@ impl Generics {
if param.parent == self.def {
let idx = param.local_id.into_raw().into_u32() as usize;
debug_assert!(
- idx <= self.params.len_type_or_consts(),
+ idx < self.params.len_type_or_consts(),
"idx: {} len: {}",
idx,
self.params.len_type_or_consts()