Refine error spans for const args in hir typeck
This commit is contained in:
@@ -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:
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user