diff --git a/rr_frontend/translation/src/search.rs b/rr_frontend/translation/src/search.rs index 82d7381332bd6263ca0942d553fc375a215b6fe5..f50038c4c5617380bfbb1ce7ed810df066d8aeb8 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 2d792f0b3d4e29f810479ba8aa8bdb44b26070fe..95b6be3d23b8faa93c179e3a3e3fc901ba540ca5 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 2d0d3ccaa110370b590ce88c5471e0a8c4ac830c..8fa4dea374af1515b90185ef896aad251b731b02 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 aed03748dc7e5b17854f255ca78d137643f6f07e..a7a9cc40d40359c5e1557250033d5463840e57eb 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 d160c9e2eac85624541e44c3d66b7104cbad6452..4fa27a4b07d25699c79384565cae83cb51a73307 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 43aaee3c1f0faade7c5fe9dcfe8811a79d5a7487..6176103f367a2d4c3da473cc8273841afe7deccb 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 daa9aebcf1b7c957a9acebc9a84c7e9313432bc2..e468d7be3c55dee9f59890dcc89a045011be30d1 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 58af65e400e63ac270ab9e3ef506340513b82fb1..2c8e7e7cd600bb223caa7cf68f05c0a30494211d 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: ///