From 270f1510bebd3d7b1bb688283ee254a9a3988218 Mon Sep 17 00:00:00 2001 From: Georgiy Komarov Date: Sat, 20 Jan 2024 07:39:33 -0300 Subject: [PATCH 1/2] rustc_mir_dataflow: Add exports for external tools Added back previously available exports: * Forward/Backward: used when implementing `AnalysisDomain` * Engine: used in user's code to solve the dataflow problem * SwitchIntEdgeEffects: used when implementing functions of the `Analysis` trait * graphviz: potentially useful for debugging purposes These exports are used when implementing external tools based on MIR dataflow framework. Closes #120130 --- compiler/rustc_mir_dataflow/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_mir_dataflow/src/lib.rs b/compiler/rustc_mir_dataflow/src/lib.rs index b805f8ca23eb4..637e6ca83ef52 100644 --- a/compiler/rustc_mir_dataflow/src/lib.rs +++ b/compiler/rustc_mir_dataflow/src/lib.rs @@ -21,10 +21,10 @@ pub use self::drop_flag_effects::{ move_path_children_matching, on_all_children_bits, on_lookup_result_bits, }; pub use self::framework::{ - fmt, lattice, visit_results, Analysis, AnalysisDomain, Direction, GenKill, GenKillAnalysis, - JoinSemiLattice, MaybeReachable, Results, ResultsCursor, ResultsVisitable, ResultsVisitor, + fmt, graphviz, lattice, visit_results, Analysis, AnalysisDomain, Backward, Direction, Engine, + Forward, GenKill, GenKillAnalysis, JoinSemiLattice, MaybeReachable, Results, ResultsCursor, + ResultsVisitable, ResultsVisitor, SwitchIntEdgeEffects, }; -use self::framework::{Backward, SwitchIntEdgeEffects}; use self::move_paths::MoveData; pub mod debuginfo; From 7842043b992587505358540dd3dfe50684c13f5f Mon Sep 17 00:00:00 2001 From: Georgiy Komarov Date: Sat, 20 Jan 2024 16:52:18 -0300 Subject: [PATCH 2/2] Add a warning comment --- compiler/rustc_mir_dataflow/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/rustc_mir_dataflow/src/lib.rs b/compiler/rustc_mir_dataflow/src/lib.rs index 637e6ca83ef52..8d189babee891 100644 --- a/compiler/rustc_mir_dataflow/src/lib.rs +++ b/compiler/rustc_mir_dataflow/src/lib.rs @@ -16,6 +16,8 @@ extern crate rustc_middle; use rustc_middle::ty; +// Please change the public `use` directives cautiously, as they might be used by external tools. +// See issue #120130. pub use self::drop_flag_effects::{ drop_flag_effects_for_function_entry, drop_flag_effects_for_location, move_path_children_matching, on_all_children_bits, on_lookup_result_bits,