diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-06-10 16:17:38 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-06-12 08:53:59 +0000 |
| commit | 0bc2001879558ba0d51b6a246f5178853f9ff21e (patch) | |
| tree | 5747a489de57f4aed39d2e9c9477a02b1ab7744d /compiler/rustc_data_structures | |
| parent | 39e7bf6826946bea847b8680e73cbca12c8d9732 (diff) | |
| download | rust-0bc2001879558ba0d51b6a246f5178853f9ff21e.tar.gz rust-0bc2001879558ba0d51b6a246f5178853f9ff21e.zip | |
Require any function with a tait in its signature to actually constrain a hidden type
Diffstat (limited to 'compiler/rustc_data_structures')
| -rw-r--r-- | compiler/rustc_data_structures/src/obligation_forest/mod.rs | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/compiler/rustc_data_structures/src/obligation_forest/mod.rs b/compiler/rustc_data_structures/src/obligation_forest/mod.rs index d477b86da74..3883b0736db 100644 --- a/compiler/rustc_data_structures/src/obligation_forest/mod.rs +++ b/compiler/rustc_data_structures/src/obligation_forest/mod.rs @@ -146,8 +146,6 @@ pub enum ProcessResult<O, E> { #[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)] struct ObligationTreeId(usize); -type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>; - pub struct ObligationForest<O: ForestObligation> { /// The list of obligations. In between calls to [Self::process_obligations], /// this list only contains nodes in the `Pending` or `Waiting` state. @@ -310,18 +308,25 @@ pub struct Error<O, E> { pub backtrace: Vec<O>, } -impl<O: ForestObligation> ObligationForest<O> { - pub fn new() -> ObligationForest<O> { - ObligationForest { - nodes: vec![], - done_cache: Default::default(), - active_cache: Default::default(), - reused_node_vec: vec![], - obligation_tree_id_generator: (0..).map(ObligationTreeId), - error_cache: Default::default(), +mod helper { + use super::*; + pub type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>; + impl<O: ForestObligation> ObligationForest<O> { + pub fn new() -> ObligationForest<O> { + ObligationForest { + nodes: vec![], + done_cache: Default::default(), + active_cache: Default::default(), + reused_node_vec: vec![], + obligation_tree_id_generator: (0..).map(ObligationTreeId), + error_cache: Default::default(), + } } } +} +use helper::*; +impl<O: ForestObligation> ObligationForest<O> { /// Returns the total number of nodes in the forest that have not /// yet been fully resolved. pub fn len(&self) -> usize { |
