diff options
| author | Michael Goulet <michael@errs.io> | 2025-03-22 23:49:14 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-04-22 16:50:38 +0000 |
| commit | 169955f3be4659e486db9b7dabafdbcee18819a3 (patch) | |
| tree | 3f177bf429a65bf9e08c8dbfe33384a0a00a7ad4 /compiler/rustc_middle/src | |
| parent | 67df5b9cfa990720d6606c663e451acd059def47 (diff) | |
| download | rust-169955f3be4659e486db9b7dabafdbcee18819a3.tar.gz rust-169955f3be4659e486db9b7dabafdbcee18819a3.zip | |
Properly drain pending obligations for coroutines
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/query/mod.rs | 9 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/query/plumbing.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_middle/src/ty/context.rs | 8 |
3 files changed, 17 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index e94f088304b..4d4096b0225 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -387,6 +387,15 @@ rustc_queries! { } } + query stalled_generators_within( + key: LocalDefId + ) -> &'tcx ty::List<LocalDefId> { + desc { + |tcx| "computing the opaque types defined by `{}`", + tcx.def_path_str(key.to_def_id()) + } + } + /// Returns the explicitly user-written *bounds* on the associated or opaque type given by `DefId` /// that must be proven true at definition site (and which can be assumed at usage sites). /// diff --git a/compiler/rustc_middle/src/query/plumbing.rs b/compiler/rustc_middle/src/query/plumbing.rs index a099f770417..c16adef63ea 100644 --- a/compiler/rustc_middle/src/query/plumbing.rs +++ b/compiler/rustc_middle/src/query/plumbing.rs @@ -366,11 +366,11 @@ macro_rules! define_callbacks { pub type Storage<'tcx> = <$($K)* as keys::Key>::Cache<Erase<$V>>; - // Ensure that keys grow no larger than 80 bytes by accident. + // Ensure that keys grow no larger than 96 bytes by accident. // Increase this limit if necessary, but do try to keep the size low if possible #[cfg(target_pointer_width = "64")] const _: () = { - if size_of::<Key<'static>>() > 88 { + if size_of::<Key<'static>>() > 96 { panic!("{}", concat!( "the query `", stringify!($name), diff --git a/compiler/rustc_middle/src/ty/context.rs b/compiler/rustc_middle/src/ty/context.rs index fa2f1cf1a1c..f8f66b58c1d 100644 --- a/compiler/rustc_middle/src/ty/context.rs +++ b/compiler/rustc_middle/src/ty/context.rs @@ -106,7 +106,7 @@ impl<'tcx> Interner for TyCtxt<'tcx> { ) -> Self::PredefinedOpaques { self.mk_predefined_opaques_in_body(data) } - type DefiningOpaqueTypes = &'tcx ty::List<LocalDefId>; + type LocalDefIds = &'tcx ty::List<LocalDefId>; type CanonicalVars = CanonicalVarInfos<'tcx>; fn mk_canonical_var_infos(self, infos: &[ty::CanonicalVarInfo<Self>]) -> Self::CanonicalVars { self.mk_canonical_var_infos(infos) @@ -674,9 +674,13 @@ impl<'tcx> Interner for TyCtxt<'tcx> { self.anonymize_bound_vars(binder) } - fn opaque_types_defined_by(self, defining_anchor: LocalDefId) -> Self::DefiningOpaqueTypes { + fn opaque_types_defined_by(self, defining_anchor: LocalDefId) -> Self::LocalDefIds { self.opaque_types_defined_by(defining_anchor) } + + fn stalled_generators_within(self, defining_anchor: Self::LocalDefId) -> Self::LocalDefIds { + self.stalled_generators_within(defining_anchor) + } } macro_rules! bidirectional_lang_item_map { |
