Don't check for recursion in generator witness fields
This commit is contained in:
parent
dfb9f5df2c
commit
82a2215481
19 changed files with 102 additions and 124 deletions
|
@ -40,7 +40,7 @@ pub trait Key: Sized {
|
|||
None
|
||||
}
|
||||
|
||||
fn ty_adt_id(&self) -> Option<DefId> {
|
||||
fn ty_def_id(&self) -> Option<DefId> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
@ -406,9 +406,10 @@ impl<'tcx> Key for Ty<'tcx> {
|
|||
DUMMY_SP
|
||||
}
|
||||
|
||||
fn ty_adt_id(&self) -> Option<DefId> {
|
||||
match self.kind() {
|
||||
fn ty_def_id(&self) -> Option<DefId> {
|
||||
match *self.kind() {
|
||||
ty::Adt(adt, _) => Some(adt.did()),
|
||||
ty::Coroutine(def_id, ..) => Some(def_id),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
@ -452,6 +453,10 @@ impl<'tcx, T: Key> Key for ty::ParamEnvAnd<'tcx, T> {
|
|||
fn default_span(&self, tcx: TyCtxt<'_>) -> Span {
|
||||
self.value.default_span(tcx)
|
||||
}
|
||||
|
||||
fn ty_def_id(&self) -> Option<DefId> {
|
||||
self.value.ty_def_id()
|
||||
}
|
||||
}
|
||||
|
||||
impl Key for Symbol {
|
||||
|
@ -550,7 +555,7 @@ impl<'tcx> Key for (ValidityRequirement, ty::ParamEnvAnd<'tcx, Ty<'tcx>>) {
|
|||
DUMMY_SP
|
||||
}
|
||||
|
||||
fn ty_adt_id(&self) -> Option<DefId> {
|
||||
fn ty_def_id(&self) -> Option<DefId> {
|
||||
match self.1.value.kind() {
|
||||
ty::Adt(adt, _) => Some(adt.did()),
|
||||
_ => None,
|
||||
|
|
|
@ -1387,6 +1387,8 @@ rustc_queries! {
|
|||
) -> Result<ty::layout::TyAndLayout<'tcx>, &'tcx ty::layout::LayoutError<'tcx>> {
|
||||
depth_limit
|
||||
desc { "computing layout of `{}`", key.value }
|
||||
// we emit our own error during query cycle handling
|
||||
cycle_delay_bug
|
||||
}
|
||||
|
||||
/// Compute a `FnAbi` suitable for indirect calls, i.e. to `fn` pointers.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue