From fc5c2956b11e29f931cec010e3f38461ec4ac309 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Wed, 12 Feb 2020 13:33:43 -0800 Subject: [PATCH] Impl `GenKill` for old dataflow framework's `GenKillSet` This impl is temporary and will be removed along with the old dataflow framework. It allows us to reuse the transfer function of new dataflow analyses when defining old ones --- src/librustc_mir/dataflow/generic/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/librustc_mir/dataflow/generic/mod.rs b/src/librustc_mir/dataflow/generic/mod.rs index ea643042c5f8..23b22550a3b0 100644 --- a/src/librustc_mir/dataflow/generic/mod.rs +++ b/src/librustc_mir/dataflow/generic/mod.rs @@ -395,5 +395,16 @@ impl GenKill for BitSet { } } +// For compatibility with old framework +impl GenKill for crate::dataflow::GenKillSet { + fn gen(&mut self, elem: T) { + self.gen(elem); + } + + fn kill(&mut self, elem: T) { + self.kill(elem); + } +} + #[cfg(test)] mod tests;