From 3192900b51e40fc771e9979061d85c48883e84e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lennard=20G=C3=A4her?= <l.gaeher@posteo.de>
Date: Thu, 2 Jan 2025 15:58:14 +0100
Subject: [PATCH] remove unused imports

---
 rr_frontend/translation/src/search.rs          |  9 ++-------
 rr_frontend/translation/src/shims/flat.rs      | 11 +++--------
 rr_frontend/translation/src/shims/mod.rs       |  5 ++---
 rr_frontend/translation/src/shims/registry.rs  |  1 -
 rr_frontend/translation/src/traits/mod.rs      |  2 +-
 rr_frontend/translation/src/traits/registry.rs |  2 --
 rr_frontend/translation/src/types/local.rs     |  6 +++---
 rr_frontend/translation/src/utils.rs           |  8 +-------
 8 files changed, 12 insertions(+), 32 deletions(-)

diff --git a/rr_frontend/translation/src/search.rs b/rr_frontend/translation/src/search.rs
index 82d7381..f50038c 100644
--- a/rr_frontend/translation/src/search.rs
+++ b/rr_frontend/translation/src/search.rs
@@ -5,16 +5,11 @@
 use std::mem;
 
 use log::{info, trace};
-use rr_rustc_interface::ast::ast;
-use rr_rustc_interface::data_structures::fx::FxHashSet;
 use rr_rustc_interface::hir::def_id::{DefId, CRATE_DEF_INDEX};
-use rr_rustc_interface::middle::mir;
 use rr_rustc_interface::middle::ty::{self, TyCtxt};
-use rr_rustc_interface::{hir, middle, span};
-use serde::{Deserialize, Serialize};
+use rr_rustc_interface::{middle, span};
 
-use crate::spec_parsers::get_export_as_attr;
-use crate::{force_matches, types, Environment};
+use crate::types;
 
 /// Gets an instance for a path.
 /// Taken from Miri <https://github.com/rust-lang/miri/blob/31fb32e49f42df19b45baccb6aa80c3d726ed6d5/src/helpers.rs#L48>.
diff --git a/rr_frontend/translation/src/shims/flat.rs b/rr_frontend/translation/src/shims/flat.rs
index 2d792f0..95b6be3 100644
--- a/rr_frontend/translation/src/shims/flat.rs
+++ b/rr_frontend/translation/src/shims/flat.rs
@@ -6,19 +6,14 @@
 
 //! Provides a flat representation of types that is stable across compilations.
 
-use std::mem;
-
 use log::{info, trace};
-use rr_rustc_interface::ast::ast;
-use rr_rustc_interface::data_structures::fx::FxHashSet;
-use rr_rustc_interface::hir::def_id::{DefId, CRATE_DEF_INDEX};
-use rr_rustc_interface::middle::mir;
+use rr_rustc_interface::hir::def_id::DefId;
 use rr_rustc_interface::middle::ty::{self, TyCtxt};
-use rr_rustc_interface::{hir, middle, span};
+use rr_rustc_interface::hir;
 use serde::{Deserialize, Serialize};
 
 use crate::spec_parsers::get_export_as_attr;
-use crate::{attrs, search, types, Environment};
+use crate::{attrs, search, Environment};
 
 /// An item path that receives generic arguments.
 #[derive(Clone, Eq, PartialEq, Debug, Serialize, Deserialize)]
diff --git a/rr_frontend/translation/src/shims/mod.rs b/rr_frontend/translation/src/shims/mod.rs
index 2d0d3cc..8fa4dea 100644
--- a/rr_frontend/translation/src/shims/mod.rs
+++ b/rr_frontend/translation/src/shims/mod.rs
@@ -7,11 +7,10 @@
 pub mod flat;
 pub mod registry;
 
-use std::collections::{HashMap, HashSet};
+use std::collections::HashMap;
 use std::fs::File;
-use std::io::{Read, Write};
 use std::path::{Path, PathBuf};
-use std::{fs, io, process};
+use std::{fs, io};
 
 /// Find `RefinedRust` modules in the given loadpath.
 fn scan_loadpath(path: &Path, storage: &mut HashMap<String, PathBuf>) -> io::Result<()> {
diff --git a/rr_frontend/translation/src/shims/registry.rs b/rr_frontend/translation/src/shims/registry.rs
index aed0374..a7a9cc4 100644
--- a/rr_frontend/translation/src/shims/registry.rs
+++ b/rr_frontend/translation/src/shims/registry.rs
@@ -18,7 +18,6 @@ use serde::{Deserialize, Serialize};
 use typed_arena::Arena;
 
 use crate::shims::flat;
-use crate::utils::*;
 
 type Path<'a> = Vec<&'a str>;
 
diff --git a/rr_frontend/translation/src/traits/mod.rs b/rr_frontend/translation/src/traits/mod.rs
index d160c9e..4fa27a4 100644
--- a/rr_frontend/translation/src/traits/mod.rs
+++ b/rr_frontend/translation/src/traits/mod.rs
@@ -4,7 +4,7 @@
 // If a copy of the BSD-3-clause license was not distributed with this
 // file, You can obtain one at https://opensource.org/license/bsd-3-clause/.
 
-use std::collections::{HashMap, HashSet};
+use std::collections::HashMap;
 
 use derive_more::Display;
 use log::{info, trace};
diff --git a/rr_frontend/translation/src/traits/registry.rs b/rr_frontend/translation/src/traits/registry.rs
index 43aaee3..6176103 100644
--- a/rr_frontend/translation/src/traits/registry.rs
+++ b/rr_frontend/translation/src/traits/registry.rs
@@ -5,11 +5,9 @@
 // file, You can obtain one at https://opensource.org/license/bsd-3-clause/.
 
 use std::cell::RefCell;
-use std::cmp::Ordering;
 use std::collections::{HashMap, HashSet};
 use std::fmt::Write;
 
-use derive_more::Display;
 use log::{info, trace};
 use radium::{self, coq, specs};
 use rr_rustc_interface::hir::def_id::{DefId, LocalDefId};
diff --git a/rr_frontend/translation/src/types/local.rs b/rr_frontend/translation/src/types/local.rs
index daa9aeb..e468d7b 100644
--- a/rr_frontend/translation/src/types/local.rs
+++ b/rr_frontend/translation/src/types/local.rs
@@ -6,8 +6,8 @@
 
 //! A wrapper around a `translator::TX` for the case we are translating the body of a function.
 
-use std::cell::{OnceCell, RefCell};
-use std::collections::{BTreeMap, HashMap, HashSet};
+use std::cell::RefCell;
+use std::collections::HashMap;
 use std::fmt::Write;
 
 use log::{info, trace, warn};
@@ -19,7 +19,7 @@ use crate::base::*;
 use crate::environment::borrowck::facts;
 use crate::environment::{polonius_info, Environment};
 use crate::regions::TyRegionCollectFolder;
-use crate::traits::registry::{self, GenericTraitUse};
+use crate::traits::registry::GenericTraitUse;
 use crate::traits::resolution;
 use crate::types::translator::*;
 use crate::types::tyvars::*;
diff --git a/rr_frontend/translation/src/utils.rs b/rr_frontend/translation/src/utils.rs
index 58af65e..2c8e7e7 100644
--- a/rr_frontend/translation/src/utils.rs
+++ b/rr_frontend/translation/src/utils.rs
@@ -5,19 +5,13 @@
 
 //! Utility functions for manipulating places.
 
-use std::mem;
-
 use log::{info, trace};
-use rr_rustc_interface::ast::ast;
 use rr_rustc_interface::data_structures::fx::FxHashSet;
-use rr_rustc_interface::hir::def_id::{DefId, CRATE_DEF_INDEX};
 use rr_rustc_interface::middle::mir;
 use rr_rustc_interface::middle::ty::{self, TyCtxt};
 use rr_rustc_interface::{hir, middle, span};
-use serde::{Deserialize, Serialize};
 
-use crate::spec_parsers::get_export_as_attr;
-use crate::{force_matches, types, Environment};
+use crate::force_matches;
 
 /// Check if the place `potential_prefix` is a prefix of `place`. For example:
 ///
-- 
GitLab