diff options
| author | lcnr <rust@lcnr.de> | 2023-12-18 07:49:46 +0100 | 
|---|---|---|
| committer | lcnr <rust@lcnr.de> | 2023-12-18 08:47:29 +0100 | 
| commit | ca718ffd2dc27f3d45a1f0a80ba405bd0bfa8ecb (patch) | |
| tree | 8b3469798c49533eb97810a98569fe0a114b7477 /compiler/rustc_middle/src/traits/solve.rs | |
| parent | 321b6565a5f8ebf6f23622fc91ea1191a54f2a38 (diff) | |
| download | rust-ca718ffd2dc27f3d45a1f0a80ba405bd0bfa8ecb.tar.gz rust-ca718ffd2dc27f3d45a1f0a80ba405bd0bfa8ecb.zip | |
track the source of nested goals
Diffstat (limited to 'compiler/rustc_middle/src/traits/solve.rs')
| -rw-r--r-- | compiler/rustc_middle/src/traits/solve.rs | 18 | 
1 files changed, 18 insertions, 0 deletions
| diff --git a/compiler/rustc_middle/src/traits/solve.rs b/compiler/rustc_middle/src/traits/solve.rs index 27a1e64a78b..dd5b57eed46 100644 --- a/compiler/rustc_middle/src/traits/solve.rs +++ b/compiler/rustc_middle/src/traits/solve.rs @@ -233,6 +233,24 @@ impl<'tcx> TypeVisitable<TyCtxt<'tcx>> for PredefinedOpaques<'tcx> { } } +/// Why a specific goal has to be proven. +/// +/// This is necessary as we treat nested goals different depending on +/// their source. +#[derive(Copy, Clone, Debug, PartialEq, Eq)] +pub enum GoalSource { + Misc, + /// We're proving a where-bound of an impl. + /// + /// FIXME(-Znext-solver=coinductive): Explain how and why this + /// changes whether cycles are coinductive. + /// + /// This also impacts whether we erase constraints on overflow. + /// Erasing constraints is generally very useful for perf and also + /// results in better error messages by avoiding spurious errors. + ImplWhereBound, +} + #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, HashStable)] pub enum IsNormalizesToHack { Yes, | 
