Move late-bound arg type checks to resolve_bound_vars
This commit is contained in:
parent
fded2e95ab
commit
cec7835d7a
10 changed files with 171 additions and 87 deletions
|
@ -3,6 +3,7 @@
|
|||
use crate::ty;
|
||||
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_errors::ErrorGuaranteed;
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::{ItemLocalId, OwnerId};
|
||||
use rustc_macros::HashStable;
|
||||
|
@ -13,6 +14,7 @@ pub enum ResolvedArg {
|
|||
EarlyBound(/* decl */ DefId),
|
||||
LateBound(ty::DebruijnIndex, /* late-bound index */ u32, /* decl */ DefId),
|
||||
Free(DefId, /* lifetime decl */ DefId),
|
||||
Error(ErrorGuaranteed),
|
||||
}
|
||||
|
||||
/// A set containing, at most, one known element.
|
||||
|
|
|
@ -149,6 +149,9 @@ impl<'tcx> Const<'tcx> {
|
|||
ty::ConstKind::Bound(debruijn, ty::BoundVar::from_u32(index)),
|
||||
ty,
|
||||
)),
|
||||
Some(rbv::ResolvedArg::Error(guar)) => {
|
||||
Some(tcx.const_error_with_guaranteed(ty, guar))
|
||||
}
|
||||
arg => bug!("unexpected bound var resolution for {:?}: {arg:?}", expr.hir_id),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue