diff options
| author | Rémy Rakic <remy.rakic+github@gmail.com> | 2024-12-30 11:06:54 +0000 |
|---|---|---|
| committer | Rémy Rakic <remy.rakic+github@gmail.com> | 2025-01-01 12:13:33 +0000 |
| commit | ff1aaa52ff5deadcb94995978b894aba3b7c8a37 (patch) | |
| tree | 9602c2d794f9f5ce86dc3937fa9ed3bd8aff50bf /compiler | |
| parent | 56e7575ddd00ad4754493c66891810bf9095cd65 (diff) | |
| download | rust-ff1aaa52ff5deadcb94995978b894aba3b7c8a37.tar.gz rust-ff1aaa52ff5deadcb94995978b894aba3b7c8a37.zip | |
remove empty `util` module
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_borrowck/src/lib.rs | 1 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/util/collect_writes.rs | 35 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/util/mod.rs | 3 |
3 files changed, 0 insertions, 39 deletions
diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index b061a450c83..61934eba846 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -81,7 +81,6 @@ mod session_diagnostics; mod type_check; mod universal_regions; mod used_muts; -mod util; /// A public API provided for the Rust compiler consumers. pub mod consumers; diff --git a/compiler/rustc_borrowck/src/util/collect_writes.rs b/compiler/rustc_borrowck/src/util/collect_writes.rs deleted file mode 100644 index 55f1073176a..00000000000 --- a/compiler/rustc_borrowck/src/util/collect_writes.rs +++ /dev/null @@ -1,35 +0,0 @@ -use rustc_middle::mir::visit::{PlaceContext, Visitor}; -use rustc_middle::mir::{Body, Local, Location}; - -pub(crate) trait FindAssignments { - // Finds all statements that assign directly to local (i.e., X = ...) - // and returns their locations. - fn find_assignments(&self, local: Local) -> Vec<Location>; -} - -impl<'tcx> FindAssignments for Body<'tcx> { - fn find_assignments(&self, local: Local) -> Vec<Location> { - let mut visitor = FindLocalAssignmentVisitor { needle: local, locations: vec![] }; - visitor.visit_body(self); - visitor.locations - } -} - -// The Visitor walks the MIR to return the assignment statements corresponding -// to a Local. -struct FindLocalAssignmentVisitor { - needle: Local, - locations: Vec<Location>, -} - -impl<'tcx> Visitor<'tcx> for FindLocalAssignmentVisitor { - fn visit_local(&mut self, local: Local, place_context: PlaceContext, location: Location) { - if self.needle != local { - return; - } - - if place_context.is_place_assignment() { - self.locations.push(location); - } - } -} diff --git a/compiler/rustc_borrowck/src/util/mod.rs b/compiler/rustc_borrowck/src/util/mod.rs deleted file mode 100644 index 5f2960b768b..00000000000 --- a/compiler/rustc_borrowck/src/util/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -mod collect_writes; - -pub(crate) use collect_writes::FindAssignments; |
