1
Fork 0

Don't ICE when RPITIT captures more method args than trait definition

This commit is contained in:
Michael Goulet 2024-09-15 16:41:00 -04:00
parent 13b5a4e43b
commit 1e9fa7eb79
5 changed files with 73 additions and 17 deletions

View file

@ -255,7 +255,9 @@ impl<'tcx> Generics {
let param = self.param_at(param.index as usize, tcx);
match param.kind {
GenericParamDefKind::Lifetime => param,
_ => bug!("expected lifetime parameter, but found another generic parameter"),
_ => {
bug!("expected lifetime parameter, but found another generic parameter: {param:#?}")
}
}
}
@ -264,7 +266,7 @@ impl<'tcx> Generics {
let param = self.param_at(param.index as usize, tcx);
match param.kind {
GenericParamDefKind::Type { .. } => param,
_ => bug!("expected type parameter, but found another generic parameter"),
_ => bug!("expected type parameter, but found another generic parameter: {param:#?}"),
}
}
@ -273,7 +275,7 @@ impl<'tcx> Generics {
let param = self.param_at(param.index as usize, tcx);
match param.kind {
GenericParamDefKind::Const { .. } => param,
_ => bug!("expected const parameter, but found another generic parameter"),
_ => bug!("expected const parameter, but found another generic parameter: {param:#?}"),
}
}