Refine error spans for const args in hir typeck

This commit is contained in:
Michael Goulet
2023-03-09 21:53:18 +00:00
parent df7fd9995f
commit e55f73ae47
4 changed files with 49 additions and 24 deletions

View File

@@ -1051,6 +1051,21 @@ impl<'tcx> TermKind<'tcx> {
}
}
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
pub enum ParamTerm {
Ty(ParamTy),
Const(ParamConst),
}
impl ParamTerm {
pub fn index(self) -> usize {
match self {
ParamTerm::Ty(ty) => ty.index as usize,
ParamTerm::Const(ct) => ct.index as usize,
}
}
}
/// This kind of predicate has no *direct* correspondent in the
/// syntax, but it roughly corresponds to the syntactic forms:
///